Trunk端口的配置步驟如下(xià):
一(yī) 組網需求:
1.SwitchA與SwitchB用trunk互連,相同VLAN的PC之間可以互訪,不同VLAN的PC之間禁止互訪;
2.PC1與PC2之間在不同VLAN,通過設置上層三層交換機SwitchB的VLAN接口10的IP地址爲10.1.1.254/24,VLAN接口20的IP地址爲20.1.1.254/24可以實現VLAN間的互訪。
二 組網圖:
1.VLAN内互訪,VLAN間禁訪
2.通過三層交換機實現VLAN間互訪
三 配置步驟:
實現VLAN内互訪VLAN間禁訪配置過程
SwitchA相關配置:
1.創建(進入)VLAN10,将E0/1加入到VLAN10
[SwitchA]vlan 10
[SwitchA-vlan10]port Ethernet 0/1
2.創建(進入)VLAN20,将E0/2加入到VLAN20
[SwitchA]vlan 20
[SwitchA-vlan20]port Ethernet 0/2
3.将端口G1/1配置爲Trunk端口,并允許VLAN10和VLAN20通過
[SwitchA]interface GigabitEthernet 1/1
[SwitchA-GigabitEthernet1/1]port link-type trunk
[SwitchA-GigabitEthernet1/1]port trunk permit vlan 10 20
SwitchB相關配置:
1.創建(進入)VLAN10,将E0/10加入到VLAN10 [SwitchB]vlan 10
[SwitchB-vlan10]port Ethernet 0/10
2.創建(進入)VLAN20,将E0/20加入到VLAN20
[SwitchB]vlan 20
[SwitchB-vlan20]port Ethernet 0/20
3.将端口G1/1配置爲Trunk端口,并允許VLAN10和VLAN20通過 [SwitchB]interface GigabitEthernet 1/1
[SwitchB-GigabitEthernet1/1]port link-type trunk [SwitchB-GigabitEthernet1/1]port trunk permit vlan 10 20
通過三層交換機實現VLAN間互訪的配置
SwitchA相關配置:
1.創建(進入)VLAN10,将E0/1加入到VLAN10 [SwitchA]vlan 10
[SwitchA-vlan10]port Ethernet 0/1
2.創建(進入)VLAN20,将E0/2加入到VLAN20
[SwitchA]vlan 20
[SwitchA-vlan20]port Ethernet 0/2
3.将端口G1/1配置爲Trunk端口,并允許VLAN10和VLAN20通過 [SwitchA]interface GigabitEthernet 1/1
[SwitchA-GigabitEthernet1/1]port link-type trunk [SwitchA-GigabitEthernet1/1]port trunk permit vlan 10 20
SwitchB相關配置:
1.創建VLAN10
[SwitchB]vlan 10
2.設置VLAN10的虛接口地址
[SwitchB]interface vlan 10
[SwitchB-int-vlan10]ip address 10.1.1.254 255.255.255.0
3.創建VLAN20
[SwitchB]vlan 20
4.設置VLAN20的虛接口地址
[SwitchB]interface vlan 20
[SwitchB-int-vlan20]ip address 20.1.1.254 255.255.255.0
5.将端口G1/1配置爲Trunk端口,并允許VLAN10和VLAN20通過
[SwitchA]interface GigabitEthernet 1/1
[SwitchA-GigabitEthernet1/1]port link-type trunk
[SwitchA-GigabitEthernet1/1]port trunk permit vlan 10 20
聯系電話(huà):020-87518715
聯系郵箱:services@picusit.com
公司名稱:鄭州易科計算機服務有限公司
公司地址:廣州市天河區龍口西路100号中(zhōng)明大(dà)廈1601