使用ENSP模拟器实现
实验:双出口访问外网nat 策略路由配置
1、内网使用nat访问外网
2、访问联通流量默认走联通线路,电信流量默走电信线路
3、当线路出现故障时,可切换到另一个链路
4、来回路径一致
5、通过NQA技术检测网络状态,连通性
配置一个外网的DNS服务器做为NQA测试的路由
ip route-s 188.202.98.1 32 11.1.1.1
ip route-s 202.98.224.68 32 12.1.1.1
配置NQA监测网络连通
===nqa
nqa test-instance cucc liantong
test-type icmp
destination-address ipv4 188.202.98.1
frequency 5
probe-count 1
start now
qu
nqa test-instance ctcc dianxin
test-type icmp
destination-address ipv4 202.98.224.68
frequency 5
probe-count 1
start now
配置默认路由访问外网,配置Nqa如果失效,路由也失效
ip route-s 0.0.0.0 0 11.1.1.1 track nqa cucc liantong
ip route-s 0.0.0.0 0 12.1.1.1 track nqa ctcc dianxin
ar1策略路由
acl 2000
rule per
qu
int g0/0/1
nat out 2000
acl 3000
rule per ip dest 43.243.228.1 0
rule per ip dest 188.202.98.1 0
qu
acl 3001
rule per ip dest 27.34.232.1 0
rule per ip dest 202.98.224.68 0
策略路由
traffic classifier ctcc operator or
if-match acl 3001
qu
traffic classifier cucc operator or
if-match acl 3000
qu
traffic behavior tocucc
redirect ip-nexthop 11.1.1.1 track nqa cucc liantong
qu
traffic behavior toctcc
redirect ip-nexthop 12.1.1.1 track nqa ctcc dianxin
qu
traffic policy p1
classifier cucc behavior tocucc
classifier ctcc behavior toctcc
qu
int g0/0/0
traffic-p p1 in