1 基础交换网络设计
1.1 问题
1)如图连接网络设备
2)不同的设备属于不同的 VLAN
3)配置交换机,确保相同 VLAN 的设备可以互通
1.2 方案
搭建实验环境,如图 - 1 所示。
图 - 1
1.3 步骤
实现此案例需要按照如下步骤进行。
1)在每个交换机上,批量创建相同的 VLAN
1. <Huawei>system-view //进入系统模式
2. \[Huawei\]sysname SWx//更改设备名称(x表示 1~8,10)
4. \[SWx\]vlan batch 10 20 30 40 66 88
2)交换机之间的链路,配置为 Trunk,并允许所有的 VLAN 通过
1. \[SW1\]port-group group-member gi0/0/11 gi0/0/12
2. \[SW1-port-group\]port link-type trunk
3. \[SW1-port-group\]port trunk allow-pass vlan all
4. \[SW1-port-group\]quit
5. \[SW2\]port-group group-member gi0/0/11 gi0/0/12
6. \[SW2-port-group\]port link-type trunk
7. \[SW2-port-group\]port trunk allow-pass vlan all
8. \[SW2-port-group\]quit
9. \[SW3\]port-group group-member gi0/0/11 gi0/0/12
10. \[SW3-port-group\]port link-type trunk
11. \[SW3-port-group\]port trunk allow-pass vlan all
12. \[SW3-port-group\]quit
13. \[SW4\]port-group group-member gi0/0/11 gi0/0/12 gi0/0/23
14. \[SW4-port-group\]port link-type trunk
15. \[SW4-port-group\]port trunk allow-pass vlan all
16. \[SW4-port-group\]quit
17. \[SW5\]port-group group-member gi0/0/1 to gi0/0/4 gi0/0/9 gi0/0/10 gi0/0/20
18. \[SW5-port-group\]port link-type trunk
19. \[SW5-port-group\]port trunk allow-pass vlan all
20. \[SW5-port-group\]quit
21. \[SW6\]port-group group-member gi0/0/1 to gi0/0/4 gi0/0/9 gi0/0/10 gi0/0/20 gi0/0/24
22. \[SW6-port-group\]port link-type trunk
23. \[SW6-port-group\]port trunk allow-pass vlan all
24. \[SW6-port-group\]quit
25. \[SW7\]port-group group-member gi0/0/9 gi0/0/10 gi0/0/24
26. \[SW7-port-group\]port link-type trunk
27. \[SW7-port-group\]port trunk allow-pass vlan all
28. \[SW7-port-group\]quit
29. \[SW8\]port-group group-member gi0/0/9 gi0/0/10 gi0/0/24
30. \[SW8-port-group\]port link-type trunk
31. \[SW8-port-group\]port trunk allow-pass vlan all
32. \[SW8-port-group\]quit
33. \[SW10\]port-group group-member gi0/0/23 gi0/0/24
34. \[SW10-port-group\]port link-type trunk
35. \[SW10-port-group\]port trunk allow-pass vlan all
36. \[SW10-port-group\]quit
3)交换机和终端设备互联的端口,加入到正确的 VLAN
1. \[SW1\]interface GigabitEthernet 0/0/1
2. \[SW1-GigabitEthernet0/0/1\]port link-type access
3. \[SW1-GigabitEthernet0/0/1\]port default vlan 10
4. \[SW1-GigabitEthernet0/0/1\]quit
5. \[SW1\]interface GigabitEthernet 0/0/2
6. \[SW1-GigabitEthernet0/0/2\]port link-type access
7. \[SW1-GigabitEthernet0/0/2\]port default vlan 20
8. \[SW1-GigabitEthernet0/0/2\]quit
9. \[SW2\]interface GigabitEthernet 0/0/3
10. \[SW2-GigabitEthernet0/0/3\]port link-type access
11. \[SW2-GigabitEthernet0/0/3\]port default vlan 10
12. \[SW2-GigabitEthernet0/0/3\]quit
13. \[SW2\]interface GigabitEthernet 0/0/4
14. \[SW2-GigabitEthernet0/0/4\]port link-type access
15. \[SW2-GigabitEthernet0/0/4\]port default vlan 30
16. \[SW2-GigabitEthernet0/0/4\]quit
17. \[SW3\]interface GigabitEthernet 0/0/5
18. \[SW3-GigabitEthernet0/0/5\]port link-type access
19. \[SW3-GigabitEthernet0/0/5\]port default vlan 20
20. \[SW3-GigabitEthernet0/0/5\]quit
21. \[SW3\]interface GigabitEthernet 0/0/6
22. \[SW3-GigabitEthernet0/0/6\]port link-type access
23. \[SW3-GigabitEthernet0/0/6\]port default vlan 40
24. \[SW3-GigabitEthernet0/0/6\]quit
25. \[SW4\]interface GigabitEthernet 0/0/7
26. \[SW4-GigabitEthernet0/0/7\]port link-type access
27. \[SW4-GigabitEthernet0/0/7\]port default vlan 40
28. \[SW4-GigabitEthernet0/0/7\]quit
29. \[SW4\]interface GigabitEthernet 0/0/8
30. \[SW4-GigabitEthernet0/0/8\]port link-type access
31. \[SW4-GigabitEthernet0/0/8\]port default vlan 30
32. \[SW4-GigabitEthernet0/0/8\]quit
33. \[SW5\]interface GigabitEthernet 0/0/8
34. \[SW5-GigabitEthernet0/0/8\]port link-type access
35. \[SW5-GigabitEthernet0/0/8\]port default vlan 88
36. \[SW5-GigabitEthernet0/0/8\]quit
38. \[SW10\]interface GigabitEthernet 0/0/6
39. \[SW10-GigabitEthernet0/0/6\]port link-type access
40. \[SW10-GigabitEthernet0/0/6\]port default vlan 66
41. \[SW10-GigabitEthernet0/0/6\]quit
2 DHCP 服务器部署
2.1 问题
1)如图配置 IP 地址
2)DHCP 服务器属于 VLAN 66,网关部署在 SW6 上
3)DHCP 客户端分别属于 vlan10/20/30/40,网关配置在 SW6 上
2.2 方案
搭建实验环境,如图 - 2 所示。
图 - 2
2.3 步骤
实现此案例需要按照如下步骤进行。
1)配置终端设备 – PC1
设置 PC1-PC8 为 DHCP 客户端
2)配置 DHCP 服务器
1. <Huawei>system-view //进入系统模式
2. \[Huawei\]sysname DHCP//更改设备名称
3. \[DHCP\]interface gi0/0/0
4. \[DHCP-GigabitEthernet0/0/0\]ip address 192.168.66.1 24
5. \[DHCP-GigabitEthernet0/0/0\]quit
6. \[DHCP\]dhcp enable
7. \[DHCP\]ip pool VLAN10
8. \[DHCP-ip-pool-VLAN10\]network 192.168.10.0 mask 24
9. \[DHCP-ip-pool-VLAN10\]gateway-list 192.168.10.254
10. \[DHCP-ip-pool-VLAN10\]dns-list 8.8.8.8
11. \[DHCP-ip-pool-VLAN10\]quit
12. \[DHCP\]ip pool VLAN20
13. \[DHCP-ip-pool-VLAN20\]network 192.168.20.0 mask 24
14. \[DHCP-ip-pool-VLAN20\]gateway-list 192.168.20.254
15. \[DHCP-ip-pool-VLAN20\]dns-list 8.8.8.8
16. \[DHCP-ip-pool-VLAN20\]quit
17. \[DHCP\]ip pool VLAN30
18. \[DHCP-ip-pool-VLAN30\]network 192.168.30.0 mask 24
19. \[DHCP-ip-pool-VLAN30\]gateway-list 192.168.30.254
20. \[DHCP-ip-pool-VLAN30\]dns-list 8.8.8.8
21. \[DHCP-ip-pool-VLAN30\]quit
22. \[DHCP\]ip pool VLAN40
23. \[DHCP-ip-pool-VLAN40\]network 192.168.40.0 mask 24
24. \[DHCP-ip-pool-VLAN40\]gateway-list 192.168.40.254
25. \[DHCP-ip-pool-VLAN40\]dns-list 8.8.8.8
26. \[DHCP-ip-pool-VLAN40\]quit
3)配置 DHCP 中继
1. \[SW6\]dhcp enable
2. \[SW6\]interface vlanif 66
3. \[SW6-Vlanif66\]ip address 192.168.66.254 24
4. \[SW6-Vlanif66\]quit
5. \[SW6\]interface vlanif 10
6. \[SW6-Vlanif10\]ip address 192.168.10.254 quit
7. \[SW6-Vlanif10\]dhcp select relay
8. \[SW6-Vlanif10\]dhcp relay server-ip 192.168.66.1
9. \[SW6-Vlanif10\]quit
10. \[SW6\]interface vlanif 20
11. \[SW6-Vlanif20\]ip address 192.168.20.254 quit
12. \[SW6-Vlanif20\]dhcp select relay
13. \[SW6-Vlanif20\]dhcp relay server-ip 192.168.66.1
14. \[SW6-Vlanif20\]quit
15. \[SW6\]interface vlanif 30
16. \[SW6-Vlanif30\]ip address 192.168.30.254 quit
17. \[SW6-Vlanif30\]dhcp select relay
18. \[SW6-Vlanif30\]dhcp relay server-ip 192.168.66.1
19. \[SW6-Vlanif30\]quit
20. \[SW6\]interface vlanif 40
21. \[SW6-Vlanif40\]ip address 192.168.40.254 quit
22. \[SW6-Vlanif40\]dhcp select relay
23. \[SW6-Vlanif40\]dhcp relay server-ip 192.168.66.1
24. \[SW6-Vlanif40\]quit
4)配置 DHCP 服务器与 DHCP 中继互通
1. \[DHCP\] ip route-static 0.0.0.0 0 192.168.66.254
https://tts.tmooc.cn/ttsPage/NTD/NTDTN202109/PROJECT2/DAY01/CASE/01/index.html