{"id":452,"date":"2020-04-06T15:32:01","date_gmt":"2020-04-06T13:32:01","guid":{"rendered":"http:\/\/tech.sosthe.sk\/?page_id=452"},"modified":"2020-04-06T15:32:01","modified_gmt":"2020-04-06T13:32:01","slug":"6-uvodna-konfiguracia-switcha","status":"publish","type":"page","link":"http:\/\/tech.sosthe.sk\/index.php\/ccna\/cisco-ios\/6-uvodna-konfiguracia-switcha\/","title":{"rendered":"6. \u00davodn\u00e1 konfigur\u00e1cia switcha"},"content":{"rendered":"<div class=\"entry-content\">\n<h3><span>Za\u010diatok konfigur\u00e1cie<\/span><\/h3>\n<p><span>Pripoj\u00edme switch na nap\u00e1janie.<\/span><\/p>\n<p><span>Pripoj\u00edme sa s\u00e9riov\u00fdm k\u00e1blom do konzolov\u00e9ho portu.<\/span><\/p>\n<p><span>Pokia\u013e na switchi neexistuje\u00a0<\/span><strong><em><span>startup-config<\/span><\/em><\/strong><span>\u00a0, tak sa spust\u00ed sprievodca\u00a0<\/span><strong><em><span>express setup<\/span><\/em><\/strong><span>\u00a0, ten je lep\u0161ie vypn\u00fa\u0165 a nastavi\u0165 v\u0161etko s doh\u013eadom.<\/span><\/p>\n<p><span>Na \u010distom switchi nie s\u00fa \u017eiadne hesl\u00e1, tak\u017ee sa m\u00f4\u017eeme hne\u010f dosta\u0165 do konfigur\u00e1cie.<\/span><\/p>\n<pre><span style=\"font-size: 10pt;\">SWITCH&gt; <strong>enable                          <\/strong>\/\/ prepnutie do privilegovan\u00e9ho modu \r\nSWITCH # <strong>configure terminal              <\/strong>\/\/ prepnutie do glob\u00e1lnej konfigur\u00e1cie \r\nSWITCH (config) # <strong>hostname DS1-3750       <\/strong>\/\/ nastavenie mena switche<\/span><\/pre>\n<h3><span>Nastavenie \u010dasu<\/span><\/h3>\n<p><span>Nastav\u00edme spr\u00e1vny \u010das (kv\u00f4li log\u00e1m a pod.), M\u00f4\u017eeme tak urobi\u0165 manu\u00e1lne<\/span><\/p>\n<pre><span style=\"font-size: 10pt;\">SWITCH # <strong>clock set 16:26:00 29 nov 2006     <\/strong>\/\/ nastavenie \u010dasu<\/span><\/pre>\n<p><span>alebo lep\u0161ie automaticky pomocou NTP servera, pre t\u00fato konfigur\u00e1ciu existuje rad pr\u00edkazov, ale hlavn\u00e9 je tento<\/span><\/p>\n<pre><span style=\"font-size: 10pt;\">SWITCH (config) # <strong>ntp server 10.0.0.50       <\/strong>\/\/ ur\u010denia NTP servera<\/span><\/pre>\n<p><span>E\u0161te treba nastavi\u0165 spr\u00e1vnu \u010dasov\u00fa z\u00f3nu<\/span><\/p>\n<pre><span style=\"font-size: 10pt;\">SWITCH (config) # <strong>clock timezone GMT 1       <\/strong>\/\/ nastavenie \u010dasovej z\u00f3ny<\/span><\/pre>\n<h3><span>\u010cas pre logami a debug<\/span><\/h3>\n<p><span>\u0160tandardne sa \u010dasov\u00e9 \u00fadaje pre logami a debug zobrazuj\u00fa ako \u010das od \u0161tartu switcha, \u010do asi v\u00e4\u010d\u0161inou nie je pohodln\u00e9, preto je lep\u0161ie prepn\u00fa\u0165 zobrazenie na norm\u00e1lny \u010das a d\u00e1tum.<\/span><\/p>\n<pre><span style=\"font-size: 10pt;\">SWITCH (config) # <strong>service timestamps debug datetime<\/strong> \r\nSWITCH (config) # <strong>service timestamps log datetime<\/strong><\/span><\/pre>\n<h3><span>Nastavenie hesla pre pr\u00edstup do privilegovan\u00e9ho m\u00f3du<\/span><\/h3>\n<pre><span style=\"font-size: 10pt;\">SWITCH (config) # <strong>enable secret c <\/strong> \t\t\t\/\/ heslo (tu c) ulo\u017een\u00e9 pomocou MD5 hashe<\/span><\/pre>\n<h3><span>Nastavenie IP adresy switcha (pre VLAN 1)<\/span><\/h3>\n<p><span>Pre pohodlnej\u0161ie spravovanie switcha k nemu asi budeme chcie\u0165 pristupova\u0165 po IP (\u010di u\u017e pomocou webu, telnetu alebo SSH), preto je potrebn\u00e9 nastavi\u0165 jeho IP adresu. V optim\u00e1lnej\u0161\u00edm pr\u00edpade vytvor\u00edme VLANy, nastav\u00edme Trunk a porty, a do spr\u00e1vcovskej VLANy nastav\u00edme IP adresu switcha.\u00a0V pr\u00edpade jednoduch\u0161\u00edm, kedy nepou\u017e\u00edvame VLANy alebo pre \u00favodn\u00e9 nastavenie, vyu\u017eijeme defaultn\u00fd VLAN 1, do ktorej patria v\u0161etky porty.<\/span><\/p>\n<pre><span style=\"font-size: 10pt;\">SWITCH (config) # <strong>interface vlan 1                             <\/strong>\/\/ prepneme sa do konfigur\u00e1cie rozhrannie VLAN1 \r\nSWITCH (config-if) # <strong>ip address 192.168.190.2 255.255.255.0    <\/strong>\/\/ nastav\u00edm IP adresu a podsie\u0165 \r\nSWITCH (config-if) # <strong>no shutdown <\/strong>                              \/\/ zapneme rozhranie<\/span><\/pre>\n<p><span>V pr\u00edpade, \u017ee chceme na switch pristupova\u0165 aj z in\u00e9ho subnetu, mus\u00edme nastavi\u0165 adresu br\u00e1ny (aby vedel kam zasiela\u0165 odpovede).<\/span><\/p>\n<pre><span style=\"font-size: 10pt;\">SWITCH (config) # <strong>ip default-gateway <\/strong><strong>192.168.190.1 <\/strong>            \/\/ adresa br\u00e1ny<\/span><\/pre>\n<h3><span>Nastavenie pr\u00edstupu cez telnet, SSH, SNMP<\/span><\/h3>\n<p><span>V nadv\u00e4znosti na minul\u00fd krok zapneme pr\u00edstup cez telnet \u010di SSH a pokia\u013e ho vyu\u017e\u00edvame, tak nastav\u00edme SNMP.\u00a0Bolo pop\u00edsan\u00e9 v \u010dl\u00e1nku <\/span><span>&#8211; komunik\u00e1cia so switchom<\/span><span>\u00a0.<\/span><\/p>\n<h3><span>Vypnutie nevyu\u017e\u00edvan\u00fdch slu\u017eieb<\/span><\/h3>\n<p><span>Z bezpe\u010dnostn\u00e9ho h\u013eadiska je dobr\u00e9 vypn\u00fa\u0165 r\u00f4zne slu\u017eby, ktor\u00e9 na switchi defaultne be\u017e\u00ed, ale my ich nechceme vyu\u017e\u00edva\u0165.\u00a0Medzi tieto slu\u017eby m\u00f4\u017ee patri\u0165 HTTP (web server), CDP (Cisco Discovery Protocol), VTP (VLAN Trunking Protocol), a \u010fal\u0161ie.\u00a0Viac o slu\u017eb\u00e1ch na switchi niekedy nabud\u00face.<\/span><\/p>\n<h3><span>Na z\u00e1ver &#8211; ulo\u017eenie konfigur\u00e1cie<\/span><\/h3>\n<p><span>Op\u00e4\u0165 zopakujem d\u00f4le\u017eit\u00e9 upozornenie.\u00a0Na z\u00e1ver konfigur\u00e1cie treba vykonan\u00e9 zmeny ulo\u017ei\u0165 do startup konfigur\u00e1cie, aby sme o ne pri re\u0161tarte nepri\u0161li.<\/span><\/p>\n<pre><span style=\"font-size: 10pt;\">SWITCH # <strong>copy running-config startup-config    <\/strong>\/\/ ulo\u017ei\u0165 \r\nDestination filename [startup-config]?      \/\/ dotaz na meno, stla\u010dte ENTER\r\nBuilding configuration ...\r\n[OK]<\/span><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Za\u010diatok konfigur\u00e1cie Pripoj\u00edme switch na nap\u00e1janie. Pripoj\u00edme sa s\u00e9riov\u00fdm k\u00e1blom do konzolov\u00e9ho portu. Pokia\u013e na switchi neexistuje\u00a0startup-config\u00a0, tak sa spust\u00ed sprievodca\u00a0express setup\u00a0, ten je lep\u0161ie&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":431,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"http:\/\/tech.sosthe.sk\/index.php\/wp-json\/wp\/v2\/pages\/452"}],"collection":[{"href":"http:\/\/tech.sosthe.sk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/tech.sosthe.sk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/tech.sosthe.sk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tech.sosthe.sk\/index.php\/wp-json\/wp\/v2\/comments?post=452"}],"version-history":[{"count":1,"href":"http:\/\/tech.sosthe.sk\/index.php\/wp-json\/wp\/v2\/pages\/452\/revisions"}],"predecessor-version":[{"id":453,"href":"http:\/\/tech.sosthe.sk\/index.php\/wp-json\/wp\/v2\/pages\/452\/revisions\/453"}],"up":[{"embeddable":true,"href":"http:\/\/tech.sosthe.sk\/index.php\/wp-json\/wp\/v2\/pages\/431"}],"wp:attachment":[{"href":"http:\/\/tech.sosthe.sk\/index.php\/wp-json\/wp\/v2\/media?parent=452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}