多语言展示
当前在线:871今日阅读:23今日分享:25

华为交换机多VLAN配置及VLAN间互通配置

实验要求:         ①、Switch1、Switch2、Switch3作为接入二层交换机;创建业务Vlan100、Vlan200、Vlan300作为业务Vlan;创建Vlan999作为设备的管理Vlan。         ②、Switch1的GigabitEthernet0/0/1~16口配置Vlan100;Switch2的GigabitEthernet0/0/1~8口配置Vlan100、GigabitEthernet0/0/9~16口配置Vlan200;Switch3的GigabitEthernet0/0/1~8口配置Vlan200、GigabitEthernet0/0/9~16口配置Vlan300;         ③、在核心路由器Router上配置DHCP服务,分别为Vlan100、Vlan200、Vlan300提供IP地址的分发业务。         ④、使部署在Vlan100上的PC1、Vlan200上的PC2和PC4、Vlan300上的PC3、PC5之间能够互相通讯;并且每台PC均能与网络上的交换机、路由器能通讯。
拓扑结构说明:
1

①、PC1、PC2、PC3、PC4、PC5设置动态获取IP地址。 ②、Switch1、Switch2和Switch3作为接入交换机。Switch0作为汇聚交换机,可以不做Vlan其他非实验的Vlan配置。③、在路由器Router上配置DHCP服务,分别为Vlan100、Vlan200、Vlan300提供IP地址的分发业务。④、如拓扑结构中所标示,为各个设备的管理地址。

设备配置清单:
1

Router的配置清单:[V200R003C00] system-view[Huawei]sysname Router[Router]vlan batch 100 200 300 999[Router]dhcp enable[Router]ip pool ForVlan100[Router-ip-pool-ForVlan100]network 192.168.10.0 mask 255.255.255.0[Router-ip-pool-ForVlan100]excluded-ip-address 192.168.10.2 192.168.10.99[Router-ip-pool-ForVlan100]excluded-ip-address 192.168.10.200 192.168.10.254[Router-ip-pool-ForVlan100]dns-list 172.16.8.8[Router-ip-pool-ForVlan100]gateway-list 192.168.10.1[Router-ip-pool-ForVlan100]quit[Router]ip pool ForVlan200[Router-ip-pool-ForVlan200]network 192.168.20.0 mask 255.255.255.0[Router-ip-pool-ForVlan200]excluded-ip-address 192.168.20.2 192.168.20.99[Router-ip-pool-ForVlan200]excluded-ip-address 192.168.20.200 192.168.20.254[Router-ip-pool-ForVlan200]dns-list 172.16.8.8[Router-ip-pool-ForVlan200]gateway-list 192.168.20.1[Router-ip-pool-ForVlan200]quit[Router]ip pool ForVlan300[Router-ip-pool-ForVlan300]network 192.168.30.0 mask 255.255.255.0[Router-ip-pool-ForVlan300]excluded-ip-address 192.168.30.2 192.168.30.99[Router-ip-pool-ForVlan300]excluded-ip-address 192.168.30.200 192.168.30.254[Router-ip-pool-ForVlan300]dns-list 172.16.8.8[Router-ip-pool-ForVlan300]gateway-list 192.168.30.1[Router-ip-pool-ForVlan300]quit[Router]interface Vlanif 100[Router-Vlanif100]ip address 192.168.10.1 255.255.255.0[Router-Vlanif100]dhcp select global[Router-Vlanif100]quit[Router]interface Vlanif 200[Router-Vlanif200]ip address 192.168.20.1 255.255.255.0[Router-Vlanif200]dhcp select global[Router-Vlanif200]quit[Router]interface Vlanif 300[Router-Vlanif300]ip address 192.168.30.1 255.255.255.0[Router-Vlanif300]dhcp select global[Router-Vlanif300]quit[Router]interface Vlanif999[Router-Vlanif999]description Management-vlan[Router-Vlanif999]ip address 192.168.99.11 255.255.255.0[Router-Vlanif999]quit[Router]interface Ethernet0/0/1[Router-Ethernet0/0/1]description To_Switch0[Router-Ethernet0/0/1]port link-type trunk[Router-Ethernet0/0/1]port trunk allow-pass vlan 2 to 4094[Router-Ethernet0/0/1]quit[Router]interface Ethernet0/0/3[Router-Ethernet0/0/3]description To_Switch3[Router-Ethernet0/0/3]port link-type trunk[Router-Ethernet0/0/3]port trunk allow-pass vlan 2 to 4094[Router-Ethernet0/0/3]quit[Router]interface Ethernet0/0/8[Router-Ethernet0/0/8]description To_Output[Router-Ethernet0/0/8]quit

2

Switch0的配置清单: system-view[Huawei]sysname Switch0[Switch0]vlan batch 100 200 999[Switch0-Vlanif999]description Management-vlan[Switch0-Vlanif999]ip address 192.168.99.21 255.255.255.0[Switch0-Vlanif999]quit[Switch0]interface GigabitEthernet0/0/21[Switch0-GigabitEthernet0/0/21]description To_Switch1[Switch0-GigabitEthernet0/0/21]port link-type trunk[Switch0-GigabitEthernet0/0/21]port trunk allow-pass vlan 2 to 4094[Switch0-GigabitEthernet0/0/21]quit[Switch0]interface GigabitEthernet0/0/22[Switch0-GigabitEthernet0/0/22]description To_Switch2[Switch0-GigabitEthernet0/0/22]port link-type trunk[Switch0-GigabitEthernet0/0/22]port trunk allow-pass vlan 2 to 4094[Switch0-GigabitEthernet0/0/22]quit[Switch0]interface GigabitEthernet0/0/24[Switch0-GigabitEthernet0/0/24]description To_Router[Switch0-GigabitEthernet0/0/24]port link-type trunk[Switch0-GigabitEthernet0/0/24]port trunk allow-pass vlan 2 to 4094[Switch0-GigabitEthernet0/0/24]quit[Switch0]ip route-static 0.0.0.0 0.0.0.0 192.168.99.11

3

Switch1的配置清单: system-view[Huawei]sysname Switch1[Switch1]vlan batch 100 999[Switch1]interface Vlanif999[Switch1-Vlanif999]description Management-vlan[Switch1-Vlanif999]ip address 192.168.99.31 255.255.255.0[Switch1-Vlanif999]quit[Switch1]port-group 123[Switch1-port-group-123]group-member GigabitEthernet 0/0/1 to g0/0/16[Switch1-port-group-123]port link-type access[Switch1-port-group-123]port default vlan 100[Switch1-port-group-123]quit[Switch1]undo port-group 123[Switch1]interface GigabitEthernet0/0/24[Switch1-GigabitEthernet0/0/24]description To_Switch0[Switch1-GigabitEthernet0/0/24]port link-type trunk[Switch1-GigabitEthernet0/0/24]port trunk allow-pass vlan 2 to 4094[Switch1-GigabitEthernet0/0/24]quit[Switch1]ip route-static 0.0.0.0 0.0.0.0 192.168.99.11

4

Switch2的配置清单: system-view[Huawei]sysname Switch2[Switch2]vlan batch 100 200 999[Switch2]interface Vlanif999[Switch2-Vlanif999]description Management-vlan[Switch2-Vlanif999]ip address 192.168.99.32 255.255.255.0[Switch2-Vlanif999]quit[Switch2]port-group 123[Switch2-port-group-123]group-member GigabitEthernet 0/0/1 to g0/0/8[Switch2-port-group-123]port link-type access[Switch2-port-group-123]port default vlan 100[Switch2-port-group-123]quit[Switch2]undo port-group 123[Switch2]port-group 456[Switch2-port-group-456]group-member GigabitEthernet 0/0/9 to g0/0/16[Switch2-port-group-456]port link-type access[Switch2-port-group-456]port default vlan 200[Switch2-port-group-456]quit[Switch2]undo port-group 456[Switch2]interface GigabitEthernet0/0/24[Switch2-GigabitEthernet0/0/24]description To_Switch0[Switch2-GigabitEthernet0/0/24]port link-type trunk[Switch2-GigabitEthernet0/0/24]port trunk allow-pass vlan 2 to 4094[Switch2-GigabitEthernet0/0/24]quit[Switch2]ip route-static 0.0.0.0 0.0.0.0 192.168.99.11

5

Switch3的配置清单: system-view[Huawei]sysname Switch3[Switch3]vlan batch 200 300 999[Switch3]interface Vlanif999[Switch3-Vlanif999]description Management-vlan[Switch3-Vlanif999]ip address 192.168.99.23 255.255.255.0[Switch3-Vlanif999]quit[Switch3]port-group 123[Switch3-port-group-123]group-member GigabitEthernet 0/0/1 to g0/0/8[Switch3-port-group-123]port link-type access[Switch3-port-group-123]port default vlan 200[Switch3-port-group-123]quit[Switch3]undo port-group 123[Switch3]port-group 456[Switch3-port-group-456]group-member GigabitEthernet 0/0/9 to g0/0/16[Switch3-port-group-456]port link-type access[Switch3-port-group-456]port default vlan 300[Switch3-port-group-456]quit[Switch3]undo port-group 456[Switch3]interface GigabitEthernet0/0/24[Switch3-GigabitEthernet0/0/24]description To_Router[Switch3-GigabitEthernet0/0/24]port link-type trunk[Switch3-GigabitEthernet0/0/24]port trunk allow-pass vlan 2 to 4094[Switch3-GigabitEthernet0/0/24]quit[Switch3]ip route-static 0.0.0.0 0.0.0.0 192.168.99.11

模拟测试:
1

检验PC1、PC2、PC3、PC4、PC5获取的IP地址信息所有PC均正常从路由器Router上正确获取IP地址等参数。

2

PC1到PC3、PC1到PC5、PC3到PC5的连通测试所有的通讯测试均正常。

3

PC1到Router的连通测试(这里直接对Router管理地址进行测试)

4

PC1到Switch0、Switch1、Switch2、Switch3的连通测试所有的通讯测试均正常。

5

在此时配置中,没有对路由器和交换机进行远程登录配置。因此,只要能正常Ping通设备,就认为该设备可以进行远程管理,而不做远程登录测试。

推荐信息