-
组网环境
-
实现说明
外网出口交换机上有2条运营商线路,出外网的流量到达交换机后需要流量在2条线路上负载均衡,由于考虑到还会有其他运营商线路接入,且要求运营商流量来回路径一致,所以单纯通过静态路由迭代无法实现,此处可以使用pbr+静态路由迭代的配置方式实现上述需求。
-
配置说明
vlan 100
description 流量路径-1
#
vlan 101
description 流量路径-2
#
interface Vlan-interface100
description 流量路径-1
ip address 1.1.1.1 255.255.255.0
#
interface Vlan-interface101
description 流量路径-2
ip address 2.2.2.1 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan 100
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan 101
#
nqa entry admin 1
type icmp-echo
destination ip 1.1.1.2
frequency 100
next-hop ip 1.1.1.2
reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
#
nqa entry admin 2
type icmp-echo
destination ip 2.2.2.2
frequency 100
next-hop ip 2.2.2.2
reaction 1 checked-element probe-fail threshold-type consecutive 5 action-type trigger-only
#
nqa schedule admin 1 start-time now lifetime forever
nqa schedule admin 2 start-time now lifetime forever
#
track 1 nqa entry admin 1 reaction 1
track 2 nqa entry admin 2 reaction 1
#
acl advanced 3000
rule 0 permit ip source 10.0.0.0 0.0.0.8
#
policy-based-route aaa permit node 1
if-match acl 3000
apply next-hop 111.111.111.111
#
ip route-static 111.111.111.111 32 1.1.1.1 track 1
ip route-static 111.111.111.111 32 2.2.2.1 track 2
#