(1)在二層交換機上配置vlan2、vlan3,分別將埠2、埠3劃到vlan2、vlan3;
(2)將二層交換機與三層交換機相連的埠f0/1都定義為trunk模式;
(3)在三層交換機上配置vlan2、vlan3,此時驗證二層交換機vlan2、vlan3下帶主機之間不能互相通訊;
(4)設定三層交換機vlan間通訊,建立vlan2、3的虛擬介面,並配置虛擬介面vlan2、3的ip地址;
(5)檢視三層交換機路由表
(6)將二層交換機vlan2、vlan3下的主機預設閘道器分別設定為相應虛擬介面的ip地址;
(7)驗證二層交換機vlan2、vlan3下的主機之間可以互相通訊;
[switch2]vlan2
[switch2-vlan2]portethernet0/2
[switch2-vlan2]vlan3
[switch2-vlan3]portethernet0/3
[switch2-vlan3]quit
(2)兩主機互ping,不通;
(3)定義二層交換機與三層交換機相連的埠f0/1為tagvlan(trunk)模式,允許所有vlan透過;
[switch2]interfae0/1(進入交換機介面0/1)
[switch2-ethernet0/1]portlink-typetrunk(將埠設定為trunk)
[switch2-ethernet0/1]porttrunkpermitvlanall//允許所有vlan透過。
[switch2-ethernet0/1]quit
[switch3]interfacee1/0/1
[switch3-ethernet1/0/1]portlink-typetrunk
[switch3-ethernet1/0/1]porttrunkpermitvlanall
(4)設定三層交換機vlan間通訊,建立vlan2、3的虛擬介面,並配置虛擬介面vlan2、3的ip地址;(先建立vlan2、vlan3)
[switch3]vlan2//建立vlan2
[switch3-vlan2]porte1/0/2
[switch3-vlan2]vlan3
[switch3-vlan3]interfacevlan2//進入vlan2虛介面
[switch3-vlan-interface2]ipaddress192.168.2.1255.255.255.0
[switch3-vlan-interface2]undoshutdown
vlan3的虛擬介面配置同上(ipaddress192.168.3.1255.255.255.0);
(1)在二層交換機上配置vlan2、vlan3,分別將埠2、埠3劃到vlan2、vlan3;
(2)將二層交換機與三層交換機相連的埠f0/1都定義為trunk模式;
(3)在三層交換機上配置vlan2、vlan3,此時驗證二層交換機vlan2、vlan3下帶主機之間不能互相通訊;
(4)設定三層交換機vlan間通訊,建立vlan2、3的虛擬介面,並配置虛擬介面vlan2、3的ip地址;
(5)檢視三層交換機路由表
(6)將二層交換機vlan2、vlan3下的主機預設閘道器分別設定為相應虛擬介面的ip地址;
(7)驗證二層交換機vlan2、vlan3下的主機之間可以互相通訊;
(1)在二層交換機上配置vlan2、vlan3,分別將埠2、埠3劃到vlan2、vlan3;
[switch2]vlan2
[switch2-vlan2]portethernet0/2
[switch2-vlan2]vlan3
[switch2-vlan3]portethernet0/3
[switch2-vlan3]quit
(2)兩主機互ping,不通;
(3)定義二層交換機與三層交換機相連的埠f0/1為tagvlan(trunk)模式,允許所有vlan透過;
[switch2]interfae0/1(進入交換機介面0/1)
[switch2-ethernet0/1]portlink-typetrunk(將埠設定為trunk)
[switch2-ethernet0/1]porttrunkpermitvlanall//允許所有vlan透過。
[switch2-ethernet0/1]quit
[switch3]interfacee1/0/1
[switch3-ethernet1/0/1]portlink-typetrunk
[switch3-ethernet1/0/1]porttrunkpermitvlanall
[switch2-ethernet0/1]quit
(4)設定三層交換機vlan間通訊,建立vlan2、3的虛擬介面,並配置虛擬介面vlan2、3的ip地址;(先建立vlan2、vlan3)
[switch3]vlan2//建立vlan2
[switch3-vlan2]porte1/0/2
[switch3-vlan2]vlan3
[switch3-vlan3]interfacevlan2//進入vlan2虛介面
[switch3-vlan-interface2]ipaddress192.168.2.1255.255.255.0
[switch3-vlan-interface2]undoshutdown
vlan3的虛擬介面配置同上(ipaddress192.168.3.1255.255.255.0);