当前位置:   article > 正文

VRRP小练习_the virtual ip address is not within a subnet on t

the virtual ip address is not within a subnet on this interface

 1.配置IP及改名(太简单省略)

2.SW1配置:

  1. SW1
  2. <Huawei>u t m
  3. <Huawei>sys
  4. [Huawei]
  5. [Huawei]sys SW1
  6. [SW1]vlan bat 10 20 13
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW1]vlan 10
  9. [SW1-vlan10]q
  10. [SW1]int v 10
  11. [SW1-Vlanif10]ip add 192.168.10.251 24 #配置SW1 vlan10 IP
  12. [SW1-Vlanif10]int v 20
  13. [SW1-Vlanif20]ip add 192.168.20.251 24 #配置SW1的Vlan 20 IP
  14. [SW1-Vlanif20]vrrp vrid 20 virt 192.168.20.254 #在vlan 20虚接口配置vrrp
  15. [SW1-Vlanif20]vrrp vrid 10 virt 192.168.10.254 #证明无法在vlan 20上配置不在vlan 20 所属网段的虚拟ip地址
  16. Error: The virtual IP address is not within a subnet on this interface.
  17. [SW1-Vlanif20]int v 10
  18. [SW1-Vlanif10]vrrp vrid 10 virt 192.168.10.254 #在vlan 10虚接口配置vrrp
  19. [SW1-Vlanif10]vrrp vrid 10 pri 130 #设为master路由
  20. [SW1-Vlanif10]vrrp vrid 10 track int g0/0/2 redu 100 #做上行接口跟踪
  21. [SW1-Vlanif10]q
  22. [SW1]int g 0/0/1
  23. [SW1-GigabitEthernet0/0/1]p l t
  24. [SW1-GigabitEthernet0/0/1]p t a v 10 20
  25. [SW1-GigabitEthernet0/0/1]q
  26. [SW1]int vlan 10
  27. [SW1-Vlanif10]ip route #证明无法在虚接口视图下配置静态路由
  28. [SW1-Vlanif10]q
  29. [SW1]ip route-static 192.168.3.0 24 192.168.13.3
  30. [SW1]int v 13
  31. [SW1-Vlanif13]ip add 192.168.13.1 24
  32. [SW1-Vlanif13]q
  33. [SW1]int g0/0/2
  34. [SW1-GigabitEthernet0/0/2]p l a
  35. [SW1-GigabitEthernet0/0/2]p d v 13
  36. [SW1-GigabitEthernet0/0/2]q
  37. [SW1]ip route-s 0.0.0.0 0 192.168.13.3 #拓扑图内还有2.0网段,省事情直接写默认路由

3.SW2配置:

  1. SW2
  2. <Huawei>u t m
  3. <Huawei>sys
  4. [Huawei]sys SW@ #按错了
  5. [SW@]sys SW2
  6. [SW2]vlan bat 10 20
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW2]int v 10
  9. [SW2-Vlanif10]ip add 192.168.10.252 24 #设置vlan 10的ip地址
  10. [SW2-Vlanif10]vrrp vrid 10 vir 192.168.10.254 #配置vlan 10的vrrp 由于SW210.0网段的master路由,故不配置优先级了
  11. [SW2-Vlanif10]int v 20
  12. [SW2-Vlanif20]ip add 192.168.20.252 24 #设置vlan 20的ip
  13. [SW2-Vlanif20]vrrp vrid 20 vir 192.168.20.254 #配置vlan 20的vrrp
  14. [SW2-Vlanif20]vrrp vrid 20 pri 130
  15. [SW2-Vlanif20]vrrp vrid 20 track int g0/0/2 redu 100 #配置上行接口跟踪
  16. [SW2-Vlanif20]q
  17. [SW2]int g0/0/2
  18. [SW2-GigabitEthernet0/0/2]p l a
  19. [SW2-GigabitEthernet0/0/2]p d v 20
  20. [SW2-GigabitEthernet0/0/2]int g 0/0/1
  21. [SW2-GigabitEthernet0/0/1]p l a
  22. [SW2-GigabitEthernet0/0/1]p l t
  23. [SW2-GigabitEthernet0/0/1]p t a v 20
  24. [SW2-GigabitEthernet0/0/1]q
  25. [SW2]ip route-s 192.168.3.0 24 192.168.23.3
  26. [SW2]vlan bat 23
  27. Info: This operation may take a few seconds. Please wait for a moment...done.
  28. [SW2]int g 0/0/2
  29. [SW2-GigabitEthernet0/0/2]p d v 23
  30. [SW2-GigabitEthernet0/0/2]q
  31. [SW2]int v 23
  32. [SW2-Vlanif23]ip add 192.168.23.1 24
  33. [SW2-Vlanif23]q
  34. [SW2]ip route-s 0.0.0.0 0 192.168.23.3

4. SW3配置:

  1. SW3
  2. <Huawei>u t m
  3. <Huawei>sys
  4. [Huawei]sys SW3
  5. [SW3]vlan bat 10 20
  6. Info: This operation may take a few seconds. Please wait for a moment...done.
  7. [SW3]int g 0/0/1
  8. [SW3-GigabitEthernet0/0/1]p l a
  9. [SW3-GigabitEthernet0/0/1]p d v 10
  10. [SW3-GigabitEthernet0/0/1]int g 0/0/2
  11. [SW3-GigabitEthernet0/0/2]p l a
  12. [SW3-GigabitEthernet0/0/2]p d v 20
  13. [SW3-GigabitEthernet0/0/2]q
  14. [SW3]port-g g g0/0/3 g0/0/4
  15. [SW3-port-group]p l t
  16. [SW3-GigabitEthernet0/0/3]p l t
  17. [SW3-GigabitEthernet0/0/4]p l t
  18. [SW3-port-group]p t a v 10 20
  19. [SW3-GigabitEthernet0/0/3]p t a v 10 20
  20. [SW3-GigabitEthernet0/0/4]p t a v 10 20

5.R1配置:

  1. R1:
  2. <Huawei>u t m
  3. Info: Current terminal monitor is off.
  4. <Huawei>sys
  5. Enter system view, return user view with Ctrl+Z.
  6. [Huawei]int g 0/0/0
  7. [Huawei-GigabitEthernet0/0/0]ip add 192.168.13.3 24
  8. [Huawei-GigabitEthernet0/0/0]int g 0/0/1
  9. [Huawei-GigabitEthernet0/0/1]ip add 192.168.23.3 24
  10. [Huawei-GigabitEthernet0/0/1]int g0/0/2
  11. [Huawei-GigabitEthernet0/0/2]ip add 192.168.3.254 24
  12. [Huawei-GigabitEthernet0/0/2]q
  13. [Huawei]ip route-s 192.168.0.0 16 192.168.13.1
  14. [Huawei]ip route-s 192.168.0.0 16 192.168.23.1 pre 70

6.测试:

1)完好时测试

2)SW1故障测试

问题出在SW2的g0/0/1口
PC1带有vlan10标签的数据帧无法通过故要新加命令:
[SW2-GigabitEthernet0/0/1]p t a v 10

3)SW2故障测试:

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/天景科技苑/article/detail/976269
推荐阅读
  

闽ICP备14008679号