当前位置:   article > 正文

华为防火墙 策略路由实现多ISP接入Internet_防火墙多点接入

防火墙多点接入

组网需求:

企业分别从ISP1和ISP2租用了一条链路

  • PC3用户上网访问Server1时走ISP1
  • PC4用户上网访问Server1时走ISP2

拓扑图 

一、ISP1 运营商 R1路由器
  1. <Huawei>sys
  2. [Huawei]sys R1
  3. [R1]un in en
  4. [R1]int g0/0/0
  5. [R1-GigabitEthernet0/0/0]ip addr 2.2.2.2 24
  6. [R1-GigabitEthernet0/0/0]quit
  7. [R1]int g0/0/1
  8. [R1-GigabitEthernet0/0/1]ip addr 10.2.2.2 24
  9. [R1-GigabitEthernet0/0/1]quit
  10. # 配置OSPF
  11. [R1]ospf 1
  12. [R1-ospf-1]area 0
  13. [R1-ospf-1-area-0.0.0.0]network 10.2.2.0 0.0.0.255
  14. [R1-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255
 二、ISP2 运营商 R2路由器
  1. <Huawei>sys
  2. [Huawei]sys R2
  3. [R2]un in en
  4. [R2]int g0/0/0
  5. [R2-GigabitEthernet0/0/0]ip addr 3.3.3.3 24
  6. [R2-GigabitEthernet0/0/0]quit
  7. [R2]
  8. [R2]int g0/0/1
  9. [R2-GigabitEthernet0/0/1]ip addr 10.3.3.3 24
  10. [R2-GigabitEthernet0/0/1]quit
  11. # 配置OSPF
  12. [R2]ospf 1
  13. [R2-ospf-1]area 0
  14. [R2-ospf-1-area-0.0.0.0]network 10.3.3.0 0.0.0.255
  15. [R2-ospf-1-area-0.0.0.0]network 3.3.3.0 0.0.0.255
三、R6路由器
  1. <Huawei>sys
  2. [Huawei]sys R6
  3. [R6]un in en
  4. [R6]int g0/0/0
  5. [R6-GigabitEthernet0/0/0]ip addr 10.2.2.1 24
  6. [R6-GigabitEthernet0/0/0]quit
  7. [R6]int g0/0/1
  8. [R6-GigabitEthernet0/0/1]ip addr 10.3.3.1 24
  9. [R6-GigabitEthernet0/0/1]quit
  10. [R6]int g0/0/2
  11. [R6-GigabitEthernet0/0/2]ip addr 10.1.1.1 24
  12. [R6-GigabitEthernet0/0/2]quit
  13. # 配置OSPF
  14. [R6]ospf 1
  15. [R6-ospf-1]area 0
  16. [R6-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
  17. [R6-ospf-1-area-0.0.0.0]network 10.2.2.0 0.0.0.255
  18. [R6-ospf-1-area-0.0.0.0]network 10.3.3.0 0.0.0.255
四、防火墙

1、配置接口IP并加入相应的安全区域

  1. <USG6000V1>sys
  2. [USG6000V1]sys FW1
  3. [FW1]un in en
  4. [FW1]dhcp enable
  5. # 桥接本地环回网卡,实现登陆WEB管理页面
  6. [FW1]int g0/0/0
  7. [FW1-GigabitEthernet0/0/0]undo ip addr 192.168.0.1 24
  8. [FW1-GigabitEthernet0/0/0]ip addr 192.168.137.10 24
  9. [FW1-GigabitEthernet0/0/0]service-manage all permit
  10. [FW1-GigabitEthernet0/0/0]quit
  11. [FW1]int g1/0/0
  12. [FW1-GigabitEthernet1/0/0]ip addr 2.2.2.1 24
  13. [FW1-GigabitEthernet1/0/0]service-manage all permit
  14. [FW1-GigabitEthernet1/0/0]quit
  15. [FW1]int g1/0/1
  16. [FW1-GigabitEthernet1/0/1]ip addr 3.3.3.1 24
  17. [FW1-GigabitEthernet1/0/1]service-manage all permit
  18. [FW1-GigabitEthernet1/0/1]quit
  19. [FW1]firewall zone untrust
  20. [FW1-zone-untrust]add int g1/0/0
  21. [FW1-zone-untrust]add int g1/0/1
  22. [FW1-zone-untrust]quit
  23. [FW1]int g1/0/2
  24. [FW1-GigabitEthernet1/0/2]ip addr 172.16.1.1 24
  25. [FW1-GigabitEthernet1/0/2]service-manage all permit
  26. [FW1-GigabitEthernet1/0/2]dhcp select int
  27. [FW1-GigabitEthernet1/0/2]quit
  28. [FW1]int g1/0/3
  29. [FW1-GigabitEthernet1/0/3]ip addr 172.16.2.1 24
  30. [FW1-GigabitEthernet1/0/3]service-manage all permit
  31. [FW1-GigabitEthernet1/0/3]dhcp select int
  32. [FW1-GigabitEthernet1/0/3]quit
  33. [FW1]firewall zone trust
  34. [FW1-zone-trust]add int g1/0/2
  35. [FW1-zone-trust]add int g1/0/3
  36. [FW1-zone-trust]quit

2、创建地址列表

  1. [FW1]ip address-set 172.16.1.* type object
  2. [FW1-object-address-set-172.16.1.*]address 0 172.16.1.0 mask 24
  3. [FW1-object-address-set-172.16.1.*]ip address-set 172.16.2.* type object
  4. [FW1-object-address-set-172.16.2.*]address 0 172.16.2.0 mask 24
  5. [FW1-object-address-set-172.16.2.*]quit

3、配置安全策略

  1. [FW1]security-policy
  2. [FW1-policy-security]rule name "untrust to local"
  3. [FW1-policy-security-rule-untrust to local]source-zone untrust
  4. [FW1-policy-security-rule-untrust to local]destination-zone local
  5. [FW1-policy-security-rule-untrust to local]action permit
  6. [FW1-policy-security-rule-untrust to local]rule name "local to untrust"
  7. [FW1-policy-security-rule-local to untrust]source-zone local
  8. [FW1-policy-security-rule-local to untrust]destination-zone untrust
  9. [FW1-policy-security-rule-local to untrust]action permit
  10. [FW1-policy-security-rule-local to untrust]rule name "trust to untrust"
  11. [FW1-policy-security-rule-trust to untrust]source-zone trust
  12. [FW1-policy-security-rule-trust to untrust]destination-zone untrust
  13. [FW1-policy-security-rule-trust to untrust]source-address address-set 172.16.1.*
  14. [FW1-policy-security-rule-trust to untrust]source-address address-set 172.16.2.*
  15. [FW1-policy-security-rule-trust to untrust]action permit
  16. [FW1-policy-security-rule-trust to untrust]quit

4、配置NAT策略

  1. [FW1-policy-security]nat-policy
  2. [FW1-policy-nat]rule name "snat 1"
  3. [FW1-policy-nat-rule-snat 1]source-zone trust
  4. [FW1-policy-nat-rule-snat 1]egress-interface GigabitEthernet1/0/0
  5. [FW1-policy-nat-rule-snat 1]source-address address-set 172.16.1.*
  6. [FW1-policy-nat-rule-snat 1]action source-nat easy-ip
  7. [FW1-policy-nat-rule-snat 1]rule name "snat 2"
  8. [FW1-policy-nat-rule-snat 2]source-zone trust
  9. [FW1-policy-nat-rule-snat 2]egress-interface GigabitEthernet1/0/1
  10. [FW1-policy-nat-rule-snat 2]source-address address-set 172.16.2.*
  11. [FW1-policy-nat-rule-snat 2]action source-nat easy-ip
  12. [FW1-policy-nat-rule-snat 2]quit

5、配置策略路由

  1. [FW1]policy-based-route
  2. [FW1-policy-pbr]rule name "no policy route 1" 3
  3. [FW1-policy-pbr-rule-no policy route 1]ingress-interface GigabitEthernet1/0/2
  4. [FW1-policy-pbr-rule-no policy route 1]source-address address-set 172.16.1.*
  5. [FW1-policy-pbr-rule-no policy route 1]destination-address address-set 172.16.2.*
  6. [FW1-policy-pbr-rule-no policy route 1]action no-pbr
  7. [FW1-policy-pbr]rule name "no policy route 2" 4
  8. [FW1-policy-pbr-rule-no policy route 2]ingress-interface GigabitEthernet1/0/3
  9. [FW1-policy-pbr-rule-no policy route 2]source-address address-set 172.16.2.*
  10. [FW1-policy-pbr-rule-no policy route 2]destination-address address-set 172.16.1.*
  11. [FW1-policy-pbr-rule-no policy route 2]action no-pbr
  12. [FW1-policy-pbr-rule-no policy route 2]rule name "policy route 1" 1
  13. [FW1-policy-pbr-rule-policy route 1]ingress-interface GigabitEthernet1/0/2
  14. [FW1-policy-pbr-rule-policy route 1]source-address address-set 172.16.1.*
  15. [FW1-policy-pbr-rule-policy route 1]action pbr egress-interface GigabitEthernet1/0/0 next-hop 2.2.2.2
  16. [FW1-policy-pbr-rule-policy route 1]rule name "policy route 2" 2
  17. [FW1-policy-pbr-rule-policy route 2]ingress-interface GigabitEthernet1/0/3
  18. [FW1-policy-pbr-rule-policy route 2]source-address address-set 172.16.2.*
  19. [FW1-policy-pbr-rule-policy route 2]action pbr egress-interface GigabitEthernet1/0/1 next-hop 3.3.3.3
  20. [FW1-policy-pbr-rule-policy route 2]quit

6、配置OSPF

  1. [FW1-policy-nat]ospf 1
  2. [FW1-ospf-1]area 0
  3. [FW1-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255
  4. [FW1-ospf-1-area-0.0.0.0]network 3.3.3.0 0.0.0.255
  5. [FW1-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255
  6. [FW1-ospf-1-area-0.0.0.0]network 172.16.2.0 0.0.0.255
五、WEB 端查看

1、接口列表

2、安全策略

(1)untrust to local

(2)local to untrust

(3)trust to untrust

3、NAT策略

(1)snat 1

(2)snat 2 

4、地址表

5、策略路由

(1)policy route 1


(2)policy route 2

 

(3)no policy route 1

 

(4)no policy route 4

 

六、测试

1、PC3 访问 Server1

PC4 访问 Server1 

通过上图分析得知,PC3 所在的172.16.1.0网段 访问 10.1.1.2 时出接口为 GE1/0/0。PC4 所在的172.16.2.0网段 访问 10.1.1.2 时出接口为 GE1/0/1

2、我们拿 PC3 访问 PC4,看下内网是否正常

  1. PC3>ping 172.16.2.81
  2. Ping 172.16.2.81: 32 data bytes, Press Ctrl_C to break
  3. From 172.16.2.81: bytes=32 seq=1 ttl=127 time=63 ms
  4. From 172.16.2.81: bytes=32 seq=2 ttl=127 time=62 ms
  5. From 172.16.2.81: bytes=32 seq=3 ttl=127 time=63 ms
  6. From 172.16.2.81: bytes=32 seq=4 ttl=127 time=46 ms
  7. From 172.16.2.81: bytes=32 seq=5 ttl=127 time=47 ms
  8. --- 172.16.2.81 ping statistics ---
  9. 5 packet(s) transmitted
  10. 5 packet(s) received
  11. 0.00% packet loss
  12. round-trip min/avg/max = 46/56/63 ms

我们发现是互通的,这里要注意一下,因为我已经在上面配置了 no pbr 不做策略路由,否则是不通的。 如果你的环境有 IPSecVPN 也需要做 no pbr

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

闽ICP备14008679号