实验要求: ①、Switch1、Switch2、Switch3作为接入二层交换机;创建Vlan100、Vlan200、Vlan300作为业务Vlan;创建Vlan999作为设备的管理Vlan。 ②、Switch1的GigabitEthernet0/0/1~16口配置Vlan100;GigabitEthernet0/0/24口配置为上联口,上联到路由器Switch0。 ③、Switch2的GigabitEthernet0/0/1~8口配置Vlan100、GigabitEthernet0/0/9~16口配置Vlan200;GigabitEthernet0/0/24口配置为上联口,上联到路由器Switch0。 ④、Switch3的GigabitEthernet0/0/1~8口配置Vlan200、GigabitEthernet0/0/9~16口配置Vlan300;GigabitEthernet0/0/24口配置为上联口,上联到路由器Router。 ⑤、在核心路由器Router上旁路接入DHCP Server,并配置成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 Server,作为DHCP服务器,分别为Vlan100、Vlan200、Vlan300提供IP地址的分发业务。路由器Router上配置DHCP中继。 ④、如拓扑结构中所标示,为各个设备的管理地址。
2、平台搭建:①、按照拓扑结构图所示,摆放好设备,并使用直连线连接好各个设备。②、开启所有的设备。
设备配置清单:
1、Router的配置清单:[V200R003C00]<Huawei争犸禀淫> system-view[Huawei]sysname Router[Router]vlan b锾攒揉敫atch 100 200 300 888 999[Router]dhcp enable[Router]interface Vlanif 100[Router-Vlanif100]ip address 192.168.10.1 255.255.255.0[Router-Vlanif100]dhcp select relay[Router-Vlanif100]dhcp relay server-ip 192.168.88.254[Router-Vlanif100]quit[Router]interface Vlanif 200[Router-Vlanif200]ip address 192.168.20.1 255.255.255.0[Router-Vlanif200]dhcp select relay[Router-Vlanif200]dhcp relay server-ip 192.168.88.254[Router-Vlanif200]quit[Router]interface Vlanif 300[Router-Vlanif300]ip address 192.168.30.1 255.255.255.0[Router-Vlanif300]dhcp select relay[Router-Vlanif300]dhcp relay server-ip 192.168.88.254[Router-Vlanif300]quit[Router]interface Vlanif888[Router-Vlanif888]ip address 192.168.88.253 255.255.255.0[Router-Vlanif888]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/0[Router-Ethernet0/0/0]description To_DHCPServer[Router-Ethernet0/0/0]port link-type trunk[Router-Ethernet0/0/0]port trunk allow-pass vlan 2 to 4094[Router-Ethernet0/0/0]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[Router]ip route-static 0.0.0.0 0.0.0.0 192.168.88.254
2、DHCP Server的配置清单:[V200R003C00]<Huawei> syst髫潋啜缅em-view[Huawei]sysname DHCPServer[DHCPServer]vlan batch 888 999[DHCPServer]dhcp enable[DHCPServer]ip pool ForVlan100[DHCPServer-ip-pool-ForVlan100]network 192.168.10.0 mask 255.255.255.0[DHCPServer-ip-pool-ForVlan100]excluded-ip-address 192.168.10.2 192.168.10.99[DHCPServer-ip-pool-ForVlan100]excluded-ip-address 192.168.10.200 192.168.10.254[DHCPServer-ip-pool-ForVlan100]dns-list 172.16.8.8[DHCPServer-ip-pool-ForVlan100]gateway-list 192.168.10.1[DHCPServer-ip-pool-ForVlan100]quit[DHCPServer]ip pool ForVlan200[DHCPServer-ip-pool-ForVlan200]network 192.168.20.0 mask 255.255.255.0[DHCPServer-ip-pool-ForVlan200]excluded-ip-address 192.168.20.2 192.168.20.99[DHCPServer-ip-pool-ForVlan200]excluded-ip-address 192.168.20.200 192.168.20.254[DHCPServer-ip-pool-ForVlan200]dns-list 172.16.8.8[DHCPServer-ip-pool-ForVlan200]gateway-list 192.168.20.1[DHCPServer-ip-pool-ForVlan200]quit[DHCPServer]ip pool ForVlan300[DHCPServer-ip-pool-ForVlan300]network 192.168.30.0 mask 255.255.255.0[DHCPServer-ip-pool-ForVlan300]excluded-ip-address 192.168.30.2 192.168.30.99[DHCPServer-ip-pool-ForVlan300]excluded-ip-address 192.168.30.200 192.168.30.254[DHCPServer-ip-pool-ForVlan300]dns-list 172.16.8.8[DHCPServer-ip-pool-ForVlan300]gateway-list 192.168.30.1[DHCPServer-ip-pool-ForVlan300]quit[DHCPServer]interface Vlanif888[DHCPServer-Vlanif888]ip address 192.168.88.254 255.255.255.0[DHCPServer-Vlanif888]dhcp select global[DHCPServer-Vlanif888]quit[DHCPServer]interface Vlanif999[DHCPServer-Vlanif999]description Management-vlan[DHCPServer-Vlanif999]ip address 192.168.99.254 255.255.255.0[DHCPServer-Vlanif999]quit[DHCPServer]interface Ethernet0/0/0[DHCPServer-Ethernet0/0/0]description To_Router[DHCPServer-Ethernet0/0/0]port link-type trunk[DHCPServer-Ethernet0/0/0]port trunk allow-pass vlan 2 to 4094[DHCPServer-Ethernet0/0/0]quit[DHCPServer]ip route-static 0.0.0.0 0.0.0.0 192.168.88.253
3、Switch0的配置清单:<Huawei> 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
4、Switch1的配置清单:<Huawei> 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
5、Switch2的配置清单:<Huawei> system-v坡纠课柩iew[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
6、Switch3的配置清单:<Huawei> 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、DHCPServer的连通测试(这里直接对Router、DHCPServer的管理地址进行测试)
4、PC1到Switch0、Switch1、Switch2、Switch3的连通测试所有的通讯测试均正常。