我正在尝试让 4G 故障转移在 Cisco C1111-8P-LTELA 路由器上工作。我有一个通常与 IP SLA 一起使用的已知工作解决方案,以及一个本地 PBR 路由映射,该路由映射根据源 IP 将流量从正确的接口中强制输出。这种情况下的问题是我不知道 LTE 接口的 WAN IP,因为它是动态的。
最终我的问题是:当源 IP 是动态的时,无论当前的默认路由是什么,如何让 IP SLA 流量正确发送出所需的源接口?
我想不出一种方法来匹配来自动态 IP 或特定出口接口的流量,所以 PBR 似乎不是一个选项?
这是我通常使用的配置 - 这将强制每个 WAN 的源 IP 的流量离开正确的接口,无论哪个 WAN 当前处于活动状态,从而允许两个 WAN 的 IP SLA 始终工作。
以前我们的 4G 是通过以太网连接到外部加密狗,所以我们能够在两个 WAN 接口上都有一个静态 IP,但是现在有了这个 LTE 路由器,动态 4G 地址,这现在不起作用,我不是确定如何处理它。
我尝试过的事情
我尝试在 PBR 中添加一个子句以匹配接口名称,但这不起作用,因为它似乎匹配所有流量,包括 LAN 流量,并强制它超过 4G,这会中断我与路由器的本地连接,并使用光纤(主 WAN)离线。匹配范围太广了。
route-map PBR-SRC-ADDR permit 20 description Route traffic with source interface of Cellular0/2/0 to interface Cellular0/2/0 regardless of default route. match interface Cellular0/2/0 set interface Cellular0/2/0 exit我考虑让 4G IP SLA ping 一个不同的 IP 地址,其中 /32始终通过 Cellular0/2/0 路由。问题是,当我们 99% 的时间都拥有完全可用的光纤 WAN 时,将任何目的地的所有流量强制使用 4G 是不可接受的。这最终可能会导致用户出现性能问题。
配置
! This is the LTE 4G Interface - usually this would be just an Ethernet WAN with a static IP but now it is negotiated.
interface Cellular0/2/0
ip address negotiated
ip nat outside
ip tcp adjust-mss 1318
dialer in-band
dialer idle-timeout 0
dialer watch-group 1
dialer-group 1
ipv6 enable
pulse-time 1
!Create the SLAs
! SLA for the fibre WAN
ip sla 1
icmp-echo 8.8.8.8 source-interface gi0/0/0
threshold 4000
frequency 5
ip sla schedule 1 life forever start-time now
! SLA for fibre WAN
ip sla 2
icmp-echo 139.130.4.4 source-interface gi0/0/0
threshold 4000
frequency 5
ip sla schedule 2 life forever start-time now
! SLA for 4G
ip sla 3
icmp-echo 8.8.8.8 source-interface cellular0/2/0
threshold 4000
frequency 5
ip sla schedule 3 life forever start-time now
! SLA for 4G
ip sla 4
icmp-echo 139.130.4.4 source-interface cellular0/2/0
threshold 4000
frequency 5
ip sla schedule 4 life forever start-time now
ip access-list extended PBR-SRC-ADDR-Traffic
!Replace XXX with your WAN IP
permit ip host XXX any
! Normally this would be a static IP
ip access-list extended PBR-SRC-4G-Traffic
permit ip host 192.168.0.100 any
!The below is to ensure in event of the 4G interface being offline that the router will failback to the fibre internet connection
route-map PBR-SRC-ADDR permit 10
description Route traffic with N1 source via Gi0/0/0
match ip address PBR-SRC-ADDR-Traffic
!Replace XXX with the gateway for your internet service
set ip next-hop XXX
! This will force traffic with 4G's source IP (usually static) to the next hop of the 4G Router.
! With this new LTE router the 4G is on Cellular 0/2/0 and the IP is unknown.
route-map PBR-SRC-ADDR permit 20
description Route traffic with 4G source via 4G
match ip address PBR-SRC-4G-Traffic
set ip next-hop 192.168.0.1
! Make sure you set this AFTER the route-map exists, otherwise it doesn't apply.
ip local policy route-map PBR-SRC-ADDR
!Create the Tracking objects
track 1 ip sla 1
delay down 20 up 10
track 2 ip sla 2
delay down 20 up 10
track 3 ip sla 3
delay down 20 up 10
track 4 ip sla 4
delay down 20 up 10
track 5 list boolean or
object 1
object 2
track 6 list boolean or
object 3
object 4
!Replace xxx with Gateway IP of internet service
! Primary WAN
ip route 0.0.0.0 0.0.0.0 xxx 10 track 5
! 4G WAN
ip route 0.0.0.0 0.0.0.0 Cellular0/2/0 15 track 6
! Primary WAN
ip route 0.0.0.0 0.0.0.0 xxx 20
! 4G WAN
ip route 0.0.0.0 0.0.0.0 Cellular0/2/0 25