
课程咨询: 400-996-5531 / 投诉建议: 400-111-8989
认真做教育 专心促就业
项目一:使用eNSP搭建实验环境,配置单臂路由实现VLAN 10与VLAN 20互通
首先配置交换机:
1. [Huawei]vlan batch 10 20
2. [Huawei]int e0/0/1
3. [Huawei-Ethernet0/0/1]port link-t access
4. [Huawei-Ethernet0/0/1]port default vlan 10
5. [Huawei-Ethernet0/0/1]int e0/0/2
6. [Huawei-Ethernet0/0/2]port link-t access
7. [Huawei-Ethernet0/0/2]port default vlan 20
8. [Huawei]int g0/0/1
9. [Huawei-GigabitEthernet0/0/1]port link-t trunk
10. [Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
然后配置路由器:
1. [Huawei]int g0/0/1.1
2. [Huawei-GigabitEthernet0/0/1.1]dot1q termination vid 10
3. [Huawei-GigabitEthernet0/0/1.1]ip add 10.10.0.1 24
4. [Huawei-GigabitEthernet0/0/1.1]arp broadcast enable
5. [Huawei-GigabitEthernet0/0/1.1]int g0/0/1.2
6. [Huawei-GigabitEthernet0/0/1.2]dot1q termination vid 20
7. [Huawei-GigabitEthernet0/0/1.2]ip add 10.20.0.1 24
8. [Huawei-GigabitEthernet0/0/1.2]arp broadcast enable
全部配置完成之后使用ping命令进行测试,证明PC1可以ping通PC2
项目二:使用多台交换机实现多交换机VLAN间通信
首先,在二层交换机SW1和SW2上配置VLAN:
1. [SW1]vlan 2
2. [SW1]vlan 3
3. [SW1]interface Ethernet0/0/1
4. [SW1-Ethernet0/0/1]port link-type access
5. [SW1-Ethernet0/0/1]port default vlan 1
6. [SW1]interface Ethernet0/0/2
7. [SW1-Ethernet0/0/2]port link-type access
8. [SW1-Ethernet0/0/2]port default vlan 2
9. [SW1]interface Ethernet0/0/3
10. [SW1-Ethernet0/0/3]port link-type access
11. [SW1-Ethernet0/0/3]port default vlan 3
12. [SW1]int g0/0/1
13. [SW1-GigabitEthernet0/0/1]port link-type trunk
14. [SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
15. [SW2]vlan 4
16. [SW2]vlan 5
17. [SW2]interface Ethernet0/0/1
18. [SW2-Ethernet0/0/1]port link-type access
19. [SW2-Ethernet0/0/1]port default vlan 4
20. [SW2]interface Ethernet0/0/2
21. [SW2-Ethernet0/0/2]port link-type access
22. [SW2-Ethernet0/0/2]port default vlan 5
23. [SW2]int g0/0/1
24. [SW2-GigabitEthernet0/0/1]port link-type trunk
25. [SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
然后配置三层交换机:
1. [SW3]vlan batch 1 to 5
2. [SW3]int g0/0/1
3. [SW3-GigabitEthernet0/0/1]port link-type trunk
4. [SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan all
5. [SW3]int g0/0/2
6. [SW3-GigabitEthernet0/0/2]port link-type trunk
7. [SW3-GigabitEthernet0/0/2]port trunk allow-pass vlan all
8. [SW3]int Vlanif 1
9. [SW3-Vlanif1]ip add 192.168.1.254 24
10. [SW3]int Vlanif 2
11. [SW3-Vlanif2]ip add 192.168.2.254 24
12. [SW3]int Vlanif 3
13. [SW3-Vlanif3]ip add 192.168.3.254 24
14. [SW3]int Vlanif 4
15. [SW3-Vlanif1]ip add 192.168.4.254 24
16. [SW3]int Vlanif 5
17. [SW3-Vlanif2]ip add 192.168.5.254 24
配置完成后测试PC机之间是否可以ping通
项目三:首先查看当前根网桥,然后通过修改交换机的优先级来分配根网桥
首先,查看没个交换机的mac地址找出根网桥
1. [SW1]stp mode stp
2. [SW2]stp mode stp
3. [SW3]stp mode stp
4. [SW4]stp mode stp
5. [SW1]dis stp
6. -------[CIST Global Info][Mode STP]-------
7. CIST Bridge :32768.4c1f-cc3b-03cb
8. Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
9. Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
10. CIST Root/ERPC :32768.4c1f-cc17-3481 / 200000
11. CIST RegRoot/IRPC :32768.4c1f-cc3b-03cb / 0
12. CIST RootPortId :128.2
13. BPDU-Protection :Disabled
14. TC or TCN received :106
15. TC count per hello :0
16. STP Converge Mode :Normal
17. Time since last TC :0 days 0h:9m:8s
18. Number of TC :12
19. Last TC occurred :Ethernet0/0/2
20. [SW2]dis stp
21. -------[CIST Global Info][Mode STP]-------
22. CIST Bridge :32768.4c1f-cc17-3481
23. Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
24. Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
25. CIST Root/ERPC :32768.4c1f-cc17-3481 / 0
26. CIST RegRoot/IRPC :32768.4c1f-cc17-3481 / 0
27. CIST RootPortId :0.0
28. BPDU-Protection :Disabled
29. TC or TCN received :23
30. TC count per hello :0
31. STP Converge Mode :Normal
32. Time since last TC :0 days 0h:9m:52s
33. Number of TC :13
34. Last TC occurred :Ethernet0/0/4
35. [SW3]dis stp
36. -------[CIST Global Info][Mode STP]-------
37. CIST Bridge :32768.4c1f-cc50-3d65
38. Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
39. Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
40. CIST Root/ERPC :32768.4c1f-cc17-3481 / 400000
41. CIST RegRoot/IRPC :32768.4c1f-cc50-3d65 / 0
42. CIST RootPortId :128.4
43. BPDU-Protection :Disabled
44. TC or TCN received :92
45. TC count per hello :0
46. STP Converge Mode :Normal
47. Time since last TC :0 days 0h:10m:26s
48. Number of TC :11
49. Last TC occurred :Ethernet0/0/4
50. [SW4]dis stp
51. -------[CIST Global Info][Mode STP]-------
52. CIST Bridge :32768.4c1f-cc22-4507
53. Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
54. Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
55. CIST Root/ERPC :32768.4c1f-cc17-3481 / 200000
56. CIST RegRoot/IRPC :32768.4c1f-cc22-4507 / 0
57. CIST RootPortId :128.2
58. BPDU-Protection :Disabled
59. TC or TCN received :49
60. TC count per hello :0
61. STP Converge Mode :Normal
62. Time since last TC :0 days 0h:11m:12s
63. Number of TC :13
64. Last TC occurred :Ethernet0/0/2
找出根网桥后,修改它的优先级,改变根网桥:
1. [SW1]stp priority 4096
2. [SW1]dis stp
3. -------[CIST Global Info][Mode STP]-------
4. CIST Bridge :4096 .4c1f-cc3b-03cb
5. Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
6. Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
7. CIST Root/ERPC :4096 .4c1f-cc3b-03cb / 0
8. CIST RegRoot/IRPC :4096 .4c1f-cc3b-03cb / 0
9. CIST RootPortId :0.0
10. BPDU-Protection :Disabled
11. TC or TCN received :108
12. TC count per hello :0
13. STP Converge Mode :Normal
14. Time since last TC :0 days 0h:0m:14s
15. Number of TC :15
16. Last TC occurred :Ethernet0/0/3
现在已经把SW1改为了根网桥。
【免责声明】本文部分系转载,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权和其它问题,请在30日内与联系我们,我们会予以更改或删除相关文章,以保证您的权益!