VLAN及交换机级联
设备名称 | IP地址 | 网关 |
---|---|---|
PCA | 10.1.1.1/24 | 10.1.1.254 |
PCB | 10.1.2.1/24 | 10.1.2.254 |
PCC | 10.1.1.2/24 | 10.1.1.254 |
PCD | 10.1.2.2/24 | 10.1.2.254 |
<H3C>display interfaceGigabitEthernet 1/0/1 查看端口信息
在交换机上划分VLAN(实现VLAN隔离,PCA--PCCping不通)
[SWA]vlan 10
[SWA -vlan10]port GigabitEthernet 1/0/1
[SWA]vlan 20
[SWA -vlan20]port GigabitEthernet 1/0/2
[SWB]vlan 10
[SWB]vlan 20
[SWB]interface GigabitEthernet 1/0/1
[SWB -GigabitEthernet1/0/1]port access vlan10
[SWB]interface GigabitEthernet 1/0/2
[SWB -GigabitEthernet1/0/2]port access vlan20
配置TRUNK端口(实现跨交换机互通)(同VLAN能ping通)
[SWA]interface GigabitEthernet 1/0/24
[SWA-GigabitEthernet1/0/24]port link-typetrunk
[SWA-GigabitEthernet1/0/24]port trunkpermit vlan 10 20
[SWB]interface GigabitEthernet 1/0/24
[SWB-GigabitEthernet1/0/24]port link-typetrunk
[SWB-GigabitEthernet1/0/24]port trunkpermit vlan 10 20
[SWC]vlan 10
[SWC]vlan 20
[SWC]interface GigabitEthernet 1/0/23
[SWC-GigabitEthernet1/0/23]port link-typetrunk
[SWC-GigabitEthernet1/0/23]port trunkpermit vlan 10 20
[SWC]interface GigabitEthernet 1/0/24
[SWC-GigabitEthernet1/0/24]port link-typetrunk
[SWC-GigabitEthernet1/0/24]port trunkpermit vlan 10 20
配置三层交换机实现VLAN间路由(各台PC之间能够ping通)
[SWC]interface Vlan-interface 10
[SWC-Vlan-interface10]ip address 10.1.1.254255.255.255.0
[SWC]interface Vlan-interface 20
[SWC-Vlan-interface20]ip address 10.1.2.254255.255.255.0
IP地址 |
网关 |
IP地址 |