Demo 2: Virtuaalilähiverkot Kytkimen tyhjäys Cisco 2950- ja 3550-kytkimissä on oletuksena Ethernet VLAN 1 (default), johon kaikki Ethernet-portit kuuluvat: Switch#del flash:vlan.dat Delete filename [vlan.dat]? Delete flash:vlan.dat? [confirm] Switch#sh vlan VLAN Name Status Ports ---- ---------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21, Fa0/22, Fa0/23, Fa0/24 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ----- - 1 enet 100001 1500 - - - - - 1002 1003 1002 fddi 101002 1500 - - - - - 1 1003 1003 tr 101003 1500 1005 0 - - srb 1 1002 1004 fdnet 101004 1500 - - 1 ibm - 0 0 1005 trnet 101005 1500 - - 1 ibm - 0 0 Kytkinkohtaiset virtuaalilähiverkot Virtuaaliverkot luodaan kytkimen VLAN-tietokantaan, ei normaalissa määrittelymoodissa. Uutta VLANia luotaessa kannattaa sille antaa kuvaava nimi, muut parametrit voi jättää oletusarvoihin. Switch#vlan database Switch(vlan)#vlan 10 name Engineering? are Maximum number of All Route Explorer hops for this VLAN backupcrf Backup CRF mode of the VLAN bridge Bridging characteristics of the VLAN media Media type of the VLAN mtu VLAN Maximum Transmission Unit parent ID number of the Parent VLAN of FDDI or Token Ring type VLANs ring Ring number of FDDI or Token Ring type VLANs said IEEE 802.10 SAID state Operational state of the VLAN ste Maximum number of Spanning Tree Explorer hops for this VLAN stp Spanning tree characteristics of the VLAN VANHA MAANTIE 6 MONITASOKYTKENTÄ 1
tb-vlan1 tb-vlan2 zero <cr> ID number of the first translational VLAN for this VLAN (or zero if none) ID number of the second translational VLAN for this VLAN (or if none) Switch(vlan)#vlan 10 name Engineering VLAN 10 added: Name: Engineering Switch(vlan)#vlan 20 name Accounting VLAN 20 added: Name: Accounting Switch(vlan)#exit APPLY completed. Switch#sh vlan VLAN Name Status Ports ---- -------------------------------------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4, Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21, Fa0/22, Fa0/23, Fa0/24 10 Engineering active 20 Accounting active 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active... Seuraavaksi voimme määritellä kytkimen portit kuulumaan haluttuun virtuaalilähiverkkoon. Cisco 3550:ssä voidaan antaa liitäntöjen ryhmä (range), mutta 2950:ssä kukin portti pitää määritellä erikseen. Komentohistoriaa kannattaa hyödyntää määrittelyissä. Switch#conf t Enter configuration commands, one per line. Switch(config)#int FastEthernet 0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)#int fa 0/2 Switch(config-if)#switchport access vlan 10 Switch(config-if)#int fa 0/3 Switch(config-if)#switchport access vlan 10 Switch(config-if)#int fa 0/4 Switch(config-if)#switchport access vlan 20 Switch(config-if)#end End with CNTL/Z. VANHA MAANTIE 6 MONITASOKYTKENTÄ 2
VLAN-määrittelyt kannattaa aina tarkistaa: Switch#sh vlan 00:07:22: %SYS-5-CONFIG_I: Configured from console by consolen VLAN Name Status Ports ---- ---------------------------- --------- ------------------------------- 1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8, Fa0/9, Fa0/10, Fa0/11, Fa0/12, Fa0/13, Fa0/14, Fa0/15, Fa0/16, Fa0/17, Fa0/18, Fa0/19, Fa0/20, Fa0/21, Fa0/22, Fa0/23, Fa0/24 10 Engineering active Fa0/1, Fa0/2, Fa0/3 20 Accounting active Fa0/4... Keskitetyt VLANit Kun virtuaaliverkot sisältävät portteja useammasta kytkimestä, tulee VLANien numeron, nimen ja identifikaation olla täsmälleen sama kaikissa kytkimissä. Ciscon valmistajakohtainen VTP (Virtual Trunking Protocol) mahdollistaa virtuaalilähiverkkojen keskitetyn luonnin. Kun käytetään VTP-palvelimen VLAN-tietokantaa, vältetään VLANien luonnin mahdolliset ongelmat. Ensin on syytä määritellä käsin nopeus ja FD/HD-toiminta kytkimien väliselle yhteydelle: DlSwitch#conf t Enter configuration commands, one per line. DlSwitch(config)#int fa 0/24 DlSwitch(config-if)#speed 100 DlSwitch(config-if)#duplex full End with CNTL/Z. Seuraavaksi määritellään kytkimien välinen linkki runkoyhteydeksi, joka kuljettaa usean VLANin kehyksiä. Kehyksiin merkitään VLAN-tieto IEEE 802.1Q-lisäotsikolla. Cisco 2950 tukee vain 802.1Q-merkintää: DlSwitch(config-if)#switchport mode trunk DlSwitch(config-if)#exit DlSwitch(config)#exit DlSwitch#sh int fastethernet 0/1 switchport Name: Fa0/1 Switchport: Enabled Administrative mode: static access Operational Mode: static access Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking VANHA MAANTIE 6 MONITASOKYTKENTÄ 3
VLAN-palvelimeksi kannattaa valita jakelukerroksen kytkin. VTP-palvelimelle määritellään sen rooli ja VLAN-alue. DlSwitch#del flash:vlan.dat Delete filename [vlan.dat]? Delete flash:vlan.dat? [confirm] DlSwitch# DlSwitch#vlan database DlSwitch(vlan)#vtp server Device mode already VTP SERVER. DlSwitch(vlan)#vtp domain evtek Changing VTP domain name from NULL to evtek DlSwitch(vlan)#exit APPLY completed. DlSwitch#sh vtp status Configuration Revision : 0 Number of existing VLANs : 5 : Server : 0x94 0x9B 0xE5 0x29 0x38 0xBF 0xB3 0xC9 Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 VLANit luodaan vain VTP-palvelimelle, joka jakaa virtuaalilähiverkkojen tiedot VTPasiakkaille. Kukin VLAN-määrittely kasvattaa VTP-versionumeroa: DlSwitch#vlan database DlSwitch(vlan)#vlan 10 name Engineering VLAN 10 added: Name: Engineering DlSwitch(vlan)#exit APPLY completed. DlSwitch#sh vtp status Configuration Revision : 1 Number of existing VLANs : 6 : Server : 0x47 0x41 0xEC 0x28 0x82 0x46 0x0B 0x90 Configuration last modified by 0.0.0.0 at 3-1-93 00:05:16 VANHA MAANTIE 6 MONITASOKYTKENTÄ 4
VTP-määrittely on jakautunut VLAN-tietokantaan ja laitekonfiguraatioon, joten se kannattaa tarkistaa sekä määrittelylistauksesta että sh vtp status-määrittelystä: DlSwitch#sh run begin 0/24 interface FastEthernet0/24 duplex full speed 100 switchport mode trunk interface VLAN1 no ip directed-broadcast no ip route-cache line con 0 transport input none stopbits 1 line vty 5 15 end DlSwitch#sh vtp status Configuration Revision : 1 Number of existing VLANs : 5 : Server : 0x94 0x9B 0xE5 0x29 0x38 0xBF 0xB3 0xC9 Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 VTP-asiakas Muut kytkimet saavat VLAN-tiedot palvelimelta, joten ne määritellään kytkimiksi. Varmin tapa liittää uusi kytkin VTP-alueelle on tyhjätä sen konfiguraatio ja VLAN-tietokanta ja määritellä sen rooliksi VTP-asiakas heti uudelleenkäynnistyksen jälkeen: Switch#erase start Erasing the nvram filesystem will remove all files Continue? [confirm] [OK] Erase of nvram: complete Switch#del flash:vlan.dat Delete filename [vlan.dat]? Delete flash:vlan.dat? [confirm] Switch#reload System configuration has been modified. Save? [yes/no]: n Proceed with reload? [confirm]... Continue with configuration dialog? [yes/no]: n Press RETURN to get started. VANHA MAANTIE 6 MONITASOKYTKENTÄ 5
Switch>ena Switch#vlan database Switch(vlan)#vtp client Setting device to VTP CLIENT mode. Switch(vlan)#vtp domain evtek Changing VTP domain name from NULL to evtek Switch(vlan)#exit In CLIENT state, no apply attempted. Nyt voimme määritellä kytkimen portit VLANeihin: Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname AlSwitch AlSwitch(config)#int fa 0/1 AlSwitch(config-if)#switchport mode access AlSwitch(config-if)#switchport access vlan 10 AlSwitch(config-if)#int fa 0/2 AlSwitch(config-if)#switchport access vlan 20 AlSwitch(config-if)#exit AlSwitch(config)#exit AlSwitch# AlSwitch#show vtp status Configuration Revision : 1 Number of existing VLANs : 5 : Client : 0x94 0x9B 0xE5 0x29 0x38 0xBF 0xB3 0xC9 Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 VANHA MAANTIE 6 MONITASOKYTKENTÄ 6