A-A+

华为USG防火墙ip-link与静态路由、PBR(策略路由)联动

2015年11月27日 站长资讯 暂无评论

假设ip-link检测目标202.100.1.2失效,则对应的静态路由失效,对应的PBR1策略路由也失效。所以源地址192.168.2.0网段选择下一跳202.100.2.2作为出口路由,当ip-link检测目标202.100.1.2成功,则对应的静态路由生效,对应的PBR1策略路由也随之生效,所以源地址192.168.2.0网段依然选择下一条202.100.1.2作为出口路由。

  1. interfaceGigabitEthernet0/0/0.2  
  2. vlan-type dot1q 2                                                          //vlan2的网关//  
  3. ip address 192.168.2.254 255.255.255.0  
  4. #  
  5. interfaceGigabitEthernet0/0/0.3  
  6. vlan-type dot1q 3                          //vlan3的网关//  
  7. ip address 192.168.3.254 255.255.255.0  
  8. #  
  9. interfaceGigabitEthernet0/0/1  
  10. ip address 202.100.1.1 255.255.255.0  
  11. #  
  12. trust  
  13. priority is 85  
  14. interface of the zone is (3):  
  15.     GigabitEthernet0/0/0.2  
  16.     GigabitEthernet0/0/0.3  
  17. #   
  18. ctc  
  19. priority is 10  
  20. interface of the zone is (1):  
  21.     GigabitEthernet0/0/1  
  22. #  
  23. cnc                                         
  24. priority is 20  
  25. interface of the zone is (1):  
  26.     GigabitEthernet0/0/2  
  27. #  
  28. ------------------------------------------------------------------------------------  
  29. policy interzonetrust ctc outbound  
  30. policy 0  
  31.   action permit  
  32.   policy source 192.168.2.0 mask 24  
  33.   policy source 192.168.3.0 mask 24  
  34. #  
  35. policy interzonetrust cnc outbound  
  36. policy 0  
  37.   action permit  
  38.   policy source 192.168.2.0 mask 24  
  39.   policy source 192.168.3.0 mask 24  
  40. # www.xiaoxiongboke.com/huawei  
  41.   
  42.   
  43. ----------------------------------------------------------------------  
  44. nat-policy interzonetrust ctc outbound  
  45. policy 0  
  46.   action source-nat  
  47.   policy source 192.168.2.0 mask 24  
  48.   policy source 192.168.3.0 mask 24  
  49.   easy-ip GigabitEthernet0/0/1  
  50. #  
  51. nat-policy interzonetrust cnc outbound  
  52. policy 0  
  53.   action source-nat  
  54.   policy source 192.168.2.0 mask 24  
  55.   policy source 192.168.3.0 mask 24  
  56.   easy-ip GigabitEthernet0/0/2  
  57. ----------------------------------------------------------------------------  
  58. policy-based-routePBR1 permit node 1  
  59.   if-match acl 3001              
  60.   apply ip-address next-hop 202.100.1.2      匹配acl3001的流量设置下一跳为202.100.1.2  
  61. #  
  62. policy-based-route PBR2 permit node 2  
  63.   if-match acl 3002  
  64.   apply ip-address next-hop 202.100.2.2      匹配acl3001的流量设置下一跳为202.100.2.2  
  65.   
  66.   
  67. #  
  68. acl number 3001  
  69. rule 5 deny ip destination192.168.3.0 0.0.0.255       目标到达192.168.3.0的路由不匹配策略  
  70. rule 10 permit ip source 192.168.2.0 0.0.0.255  
  71. #  
  72. acl number 3002  
  73. rule 1 deny ip destination192.168.2.0 0.0.0.255        目标到达192.168.2.0的路由不匹配策略  
  74. rule 5 permit ip source 192.168.3.0 0.0.0.255  
  75. ip-link 2destination 202.100.2.2 interface GigabitEthernet 0/0/2 mode icmp  
  76. ip-link 1destination 202.100.1.2 interface GigabitEthernet 0/0/1 mode icmp  
  77. ip route-static 0.0.0.0 0.0.0.0 202.100.1.2track ip-link 1  
  78. ip route-static 0.0.0.0 0.0.0.0 202.100.2.2track ip-link 2  
  79.   
  80. interfaceGigabitEthernet0/0/0.2  
  81. ip policy-based-route PBR1  
  82. #  
  83. interfaceGigabitEthernet0/0/0.3  
  84. ip policy-based-route PBR2  

综述:ip-link检测影响静态路由,静态路由影响策略路由。

标签:

给我留言