我们有以下Juniper MX80设置:

set interfaces ae2 unit 200 description ISP1
set interfaces ae2 unit 200 vlan-id 200
set interfaces ae2 unit 200 family inet address 200.200.200.2/30
set interfaces ae2 unit 201 description ISP2
set interfaces ae2 unit 201 vlan-id 201
set interfaces ae2 unit 201 family inet address 201.201.201.2/30'

我们还与ISP1和ISP2 Build 了BGP连接 .

set protocols bgp group isp1-peer type external
set protocols bgp group isp1-peer peer-as 200
set protocols bgp group isp1-peer neighbor 200.200.200.1
set protocols bgp group isp2-peer type external
set protocols bgp group isp2-peer peer-as 201
set protocols bgp group isp2-peer neighbor 201.201.201.1

和ISP1上的默认路由

set routing-options static route 0.0.0.0/0 next-hop 200.200.200.1

现在我们想要设置类似Linux的PBR(FBF),以便从互联网访问Juniper . 因此,如果ISP1关闭,我们可以连接ISP2地址 . 对于linux来说它看起来像

# ip route add default via 200.200.200.1 table 101
# ip rule add from 200.200.200.2 table 101