首页/网络/网络设备配置速查/双出口策略路由搭配 NAT(运营商分流)
NAT 与出口31 条

双出口策略路由搭配 NAT(运营商分流)

两条宽带按目的地址或源网段分流时:先用策略路由选出口,再在各自出口上分别做 NAT。三厂对应 policy-based-route / route-map + ip policy / policy-based-route。

网络设备配置速查网络更新于 2026-10-12
场景双运营商出口按策略分流
适用三厂路由器
要点策略路由只决定走哪条线;NAT 仍要在对应出口单独配置

华为 VRP

华为 VRP
acl number 3000
 rule 5 permit ip destination 1.2.3.0 0.0.0.255
policy-based-route ISP1 permit node 10
 if-match acl 3000
 apply output-interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/0
 ip policy-based-route ISP1
display policy-based-route

思科 IOS

思科 IOS
ip access-list extended ISP1_TRAFFIC
 permit ip any 1.2.3.0 0.0.0.255
route-map ISP1 permit 10
 match ip address ISP1_TRAFFIC
 set interface GigabitEthernet0/1
interface GigabitEthernet0/0
 ip policy route-map ISP1
show route-map

H3C Comware

H3C Comware
acl advanced 3000
 rule 0 permit ip destination 1.2.3.0 0.0.0.255
policy-based-route ISP1 permit node 10
 if-match acl 3000
 apply output-interface GigabitEthernet1/0/1
interface GigabitEthernet1/0/0
 ip policy-based-route ISP1
display policy-based-route
差异:思科用 route-map + set interface 指定出口;华为/H3C 用 policy-based-route + apply output-interface。分流后忘给某条线路配 NAT,会出现该线路流量“出去全丢”的隐蔽故障。

易错点

  • 策略路由只匹配了去程,回程仍按默认路由走别的线路,双线场景会出现“出去能通、回来丢包”的半通状态

数据来源与参考

  • 华为 VRP 策略路由配置
  • Cisco IOS PBR(ip policy route-map)
  • H3C Comware 策略路由配置

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌