核心交换机上有接两个出口路由,两个出口路由同时有两条VPN,平时要指定从电信路由器走vpn,但当电信线路断开后,自动切换到联通vpn,
因为路由器是内接口,电信,联通断线后,静态路由不能识别,还是指向两个路由器,因此想写个策略路由,并指定策略路由走电信线路,
这个策略要如何写
(0)
最佳答案
使用PBR+NQA联动,还可实现负载分担:
#
policy-based-route dail-line permit node 10
if-match acl 3001
apply next-hop 10.1.1.1 track 1
#
policy-based-route dail-link permit node 20
if-match acl 3002
apply next-hop 20.1.1.1 track 2
#
nqa entry admin test1
type icmp-echo
destination ip 100.1.1.1
frequency 1000
next-hop ip 10.1.1.1
reaction 1 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only
#
nqa entry admin test2
type icmp-echo
destination ip 200.1.1.1
frequency 1000
next-hop ip 20.1.1.1
reaction 1 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only
#
nqa schedule admin test1 start-time now lifetime forever
nqa schedule admin test2 start-time now lifetime forever
#
interface GigabitEthernet1/0/2
port link-mode route
ip address 10.1.1.2 255.255.255.0
nat outbound 3000
#
interface GigabitEthernet1/0/3
port link-mode route
ip address 20.1.1.2 255.255.255.0
nat outbound 3000
#
interface GigabitEthernet1/0/4
port link-mode route
ip address 1.1.1.1 255.255.255.0
nat hairpin enable
ip policy-based-route dail-line
#
ip route-static 0.0.0.0 0 10.1.1.1
ip route-static 0.0.0.0 0 20.1.1.1 preference 120
#
acl advanced 3000
rule 0 permit ip
#
acl advanced 3001
rule 1 permit ip source 192.168.1.0 0.0.0.255
#
acl advanced 3002
rule 0 permit ip source 172.16.1.0 0.0.0.255
#
track 1 nqa entry admin test1 reaction 1
track 2 nqa entry admin test2 reaction 1
#
ip route-static 0.0.0.0 0 10.1.1.1 track 1
ip route-static 0.0.0.0 0 20.1.1.1 track 2 preference 100
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论