0


华为ENSP综合实验:eth-trunk、vlan底层、vrrp负载分担、MSTP、DHCP中继

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录


前言

这个实验我尝试过很多次,在MSTP配置在整个拓扑图出现环路情况,不能正常获取到地址,开始以为是ensp系统bag,但经过多次排查后发现是MSTP配置问题,现在 实验步骤如下:


实验结果:PC1、PC2数据往LSW1走、PC3、PC4数据往LSW2走,当LW1设备g0/0/4断开,则切换到LW2上,PC1、PC2从LSW2路径走,往DHCP获取地址。当LW2设备g0/0/4链路断开,PC3、PC4能从LSW1链路走,往DHCP获取地址,具体配置如下(局域网dhcp服务器配置及负载分担)


1、eth-trunk配置:

  1. LSW1:
  2. sy
  3. un in en (关闭信息提示)
  4. interface Eth-Trunk1
  5. port link-type trunk
  6. port trunk allow-pass vlan 2 to 4094
  7. trunkport g 0/0/1 to 0/0/3 加入端口
  8. LSW2:
  9. sy
  10. un in en (关闭信息提示)
  11. interface Eth-Trunk1
  12. port link-type trunk
  13. port trunk allow-pass vlan 2 to 4094
  14. trunkport g 0/0/1 to 0/0/3

2、vlan二层配置:

  1. LSW1:
  2. vlan batch 10 20 30 40 100
  3. int g0/0/4
  4. port link-type access
  5. port default vlan 100
  6. int g0/0/5
  7. port link-t trunk
  8. port trunk allow-p vlan 10 20
  9. int g0/0/6
  10. port link-t trunk
  11. port trunk allow-p vlan 30 40
  12. LSW2:
  13. vlan batch 10 20 30 40 101
  14. int g0/0/4
  15. port link-type access
  16. port default vlan 101
  17. int g0/0/5
  18. port link-t trunk
  19. port trunk allow-p vlan 10 20
  20. int g0/0/6
  21. port link-t trunk
  22. port trunk allow-p vlan 30 40
  23. JIERU1:
  24. sy
  25. un in en
  26. vlan batch 10 20 30 40
  27. int g0/0/1
  28. port link-t trunk
  29. port trunk allow-p vlan 10 20
  30. int g0/0/2
  31. port link-t trunk
  32. port trunk allow-p vlan 10 20
  33. int g0/0/3
  34. port link-type access
  35. port default vlan 10
  36. int g0/0/4
  37. port link-type access
  38. port default vlan 20
  39. JIERU2:
  40. sy
  41. un in en
  42. vlan batch 10 20 30 40
  43. int g0/0/1
  44. port link-t trunk
  45. port trunk allow-p vlan 30 40
  46. int g0/0/2
  47. port link-t trunk
  48. port trunk allow-p vlan 30 40
  49. int g0/0/3
  50. port link-type access
  51. port default vlan 30
  52. int g0/0/4
  53. port link-type access
  54. port default vlan 40

3、MSTP配置:

  1. LSW1:
  2. stp enable
  3. stp region-configuration
  4. region-name 1
  5. instance 1 vlan 10 20
  6. instance 2 vlan 30 40
  7. active region-configuration
  8. stp instance 1 root primary 主根桥
  9. stp instance 2 root secondary 备用根桥
  10. LSW2:
  11. stp enable
  12. stp region-configuration
  13. region-name 1
  14. instance 1 vlan 10 20
  15. instance 2 vlan 30 40
  16. active region-configuration
  17. stp instance 1 root secondary
  18. stp instance 2 root primary
  19. JIERU1:
  20. stp enable
  21. stp region-configuration
  22. region-name 1
  23. instance 1 vlan 10 20
  24. instance 2 vlan 30 40
  25. active region-configuration
  26. JIERU2:
  27. stp enable
  28. stp region-configuration
  29. region-name 1
  30. instance 1 vlan 10 20
  31. instance 2 vlan 30 40
  32. active region-configuration

4、虚拟地址及vrrp配置:

  1. LSW1:
  2. interface Vlanif10
  3. ip address 10.1.1.254 255.255.255.0
  4. vrrp vrid 1 virtual-ip 10.1.1.1 vrrp虚拟网关
  5. vrrp vrid 1 priority 120 vrrp优先级(越大越优先)
  6. vrrp vrid 1 track interface GigabitEthernet0/0/4 reduced 50 端口监视
  7. interface Vlanif20
  8. ip address 20.1.1.254 255.255.255.0
  9. vrrp vrid 2 virtual-ip 20.1.1.1
  10. vrrp vrid 2 priority 120
  11. vrrp vrid 2 track interface GigabitEthernet0/0/4 reduced 50
  12. interface Vlanif30
  13. ip address 30.1.1.254 255.255.255.0
  14. vrrp vrid 3 virtual-ip 30.1.1.1
  15. ip address 40.1.1.254 255.255.255.0
  16. vrrp vrid 4 virtual-ip 40.1.1.1
  17. int vlanif 100
  18. ip address 100.1.1.1 24
  19. LSW2:
  20. interface Vlanif10
  21. ip address 10.1.1.253 255.255.255.0
  22. vrrp vrid 1 virtual-ip 10.1.1.1
  23. interface Vlanif20
  24. ip address 20.1.1.253 255.255.255.0
  25. vrrp vrid 2 virtual-ip 20.1.1.1
  26. interface Vlanif30
  27. ip address 30.1.1.253 255.255.255.0
  28. vrrp vrid 3 virtual-ip 30.1.1.1
  29. vrrp vrid 3 priority 120
  30. vrrp vrid 3 track interface GigabitEthernet0/0/4 reduced 50
  31. interface Vlanif40
  32. ip address 40.1.1.253 255.255.255.0
  33. vrrp vrid 4 virtual-ip 40.1.1.1
  34. vrrp vrid 4 priority 120
  35. vrrp vrid 4 track interface GigabitEthernet0/0/4 reduced 50
  36. interface vlanif 101
  37. ip address 101.1.1.1 24

5、配置dhcp服务器、dhcp中继、dhcp snooping、静态路由策略:

  1. DHCP服务器:
  2. sy
  3. un in en
  4. sys DHCP
  5. dhcp enable 开启服务
  6. ip pool 10
  7. gateway-list 10.1.1.1
  8. network 10.1.1.0 mask 255.255.255.0
  9. excluded-ip-address 10.1.1.253 10.1.1.254
  10. dns-list 8.8.8.8
  11. #
  12. ip pool 20
  13. gateway-list 20.1.1.1
  14. network 20.1.1.0 mask 255.255.255.0
  15. excluded-ip-address 20.1.1.253 20.1.1.254
  16. dns-list 8.8.8.8
  17. #
  18. ip pool 30
  19. gateway-list 30.1.1.1
  20. network 30.1.1.0 mask 255.255.255.0
  21. excluded-ip-address 30.1.1.253 30.1.1.254
  22. dns-list 8.8.8.8
  23. #
  24. ip pool 40
  25. gateway-list 40.1.1.1
  26. network 40.1.1.0 mask 255.255.255.0
  27. excluded-ip-address 40.1.1.253 40.1.1.254
  28. dns-list 8.8.8.8
  29. interface GigabitEthernet0/0/0
  30. ip address 100.1.1.2 255.255.255.0
  31. dhcp select global
  32. #
  33. interface GigabitEthernet0/0/1
  34. ip address 101.1.1.2 255.255.255.0
  35. dhcp select global
  36. interface LoopBack0
  37. ip address 5.5.5.5 255.255.255.0
  38. #
  39. ip route-static 10.1.1.0 255.255.255.0 100.1.1.1
  40. ip route-static 10.1.1.0 255.255.255.0 101.1.1.1 preference 70
  41. ip route-static 20.1.1.0 255.255.255.0 100.1.1.1
  42. ip route-static 20.1.1.0 255.255.255.0 101.1.1.1 preference 70
  43. ip route-static 30.1.1.0 255.255.255.0 100.1.1.1 preference 70
  44. ip route-static 30.1.1.0 255.255.255.0 101.1.1.1
  45. ip route-static 40.1.1.0 255.255.255.0 100.1.1.1 preference 70
  46. ip route-static 40.1.1.0 255.255.255.0 101.1.1.1
  47. LSW1中继:
  48. dhcp en
  49. int v 10
  50. dhcp select relay
  51. dhcp relay server-ip 100.1.1.2
  52. int v 20
  53. dhcp select relay
  54. dhcp relay server-ip 100.1.1.2
  55. int v 30
  56. dhcp select relay
  57. dhcp relay server-ip 100.1.1.2
  58. int v 40
  59. dhcp select relay
  60. dhcp relay server-ip 100.1.1.2
  61. ip route-static 0.0.0.0 0 100.1.1.2
  62. LSW2中继:
  63. dhcp en
  64. int v 10
  65. dhcp select relay
  66. dhcp relay server-ip 101.1.1.2
  67. int v 20
  68. dhcp select relay
  69. dhcp relay server-ip 101.1.1.2
  70. int v 30
  71. dhcp select relay
  72. dhcp relay server-ip 101.1.1.2
  73. int v 40
  74. dhcp select relay
  75. dhcp relay server-ip 101.1.1.2
  76. ip route-static 0.0.0.0 0 101.1.1.2
  77. JIERU1 DHCP snooping配置:
  78. dhcp en
  79. dhcp snooping en
  80. vlan 10
  81. dhcp snooping enable
  82. vlan 20
  83. dhcp snooping enable
  84. int g/0/1
  85. dhcp snooping enable
  86. dhcp snooping trusted
  87. int g0/0/2
  88. dhcp snooping enable
  89. dhcp snooping trusted
  90. JIERU2 DHCP snooping配置:
  91. dhcp en
  92. dhcp snooping en
  93. vlan 30
  94. dhcp snooping enable
  95. vlan 40
  96. dhcp snooping enable
  97. int g/0/1
  98. dhcp snooping enable
  99. dhcp snooping trusted
  100. int g0/0/2
  101. dhcp snooping enable
  102. dhcp snooping trusted

配置完成:查看相关数据:

1、vrrp负载分担情况:

当断开LSW1g0/0/4端口时:

能完成自主切换主备。

当断开LSW2g0/0/4端口时:

也能进行主备切换。

2、查看PC获取地址情况:

均能获取地址,切访问到DHCP 回环网口5.5.5.5 实验完成

总结

这个实验结合了华为多种策略协议,适合做公司、部门内部网络规划,其中在在这个基础上可以添加ACL访问控制禁止部门互访,AC部署无线网络,也可以部署FTP、DNS、www服务器。在这个基础上可以增加多种网络元素,但也有不足之处,即没有做好核心部分下行的网络冗余及聚合链路的多样配置,当核心的下行接口故障,PC端则无法获取到地址,这个我目前还在寻找解决的方法,如有大神知晓,请留言相告,不胜感激。


本文转载自: https://blog.csdn.net/m0_63775189/article/details/127590897
版权归原作者 学海0涯 所有, 如有侵权,请联系我们删除。

“华为ENSP综合实验:eth-trunk、vlan底层、vrrp负载分担、MSTP、DHCP中继”的评论:

还没有评论