带有 DMVPN 和双 ISP 的 Cisco PBR

网络工程 虚拟专用网 pbr
2021-07-05 05:04:27

我有一个带有 2 个 ISP 的 DMVPN 集线器。我在辐条之间设置了两条隧道,每个 ISP 一条隧道。我想将其中一条 ISP 链接专用于语音流量和故障转移。我很难同时实现这两个目标。在我当前的配置中,语音可以随心所欲地传播,但我无法进行故障转移。限制似乎是因为在路由映射下使用 set interface 时没有验证可用性,并且当连接丢失时隧道接口不会关闭。有没有另一种方法来完成我正在寻找的东西?

这是相关的配置部分:

track 89 ip sla 89 reachability
!
track 245 ip sla 245 reachability

interface Tunnel0
 ip address 10.10.255.1 255.255.255.192
 ip nhrp map multicast dynamic
 ip nhrp network-id 1
 tunnel source GigabitEthernet0/1.245
 tunnel mode gre multipoint
 tunnel key 0
 tunnel route-via GigabitEthernet0/1.245 mandatory
 tunnel protection ipsec profile IPSec-Profile1
!
interface Tunnel1
 ip address 10.10.255.65 255.255.255.192
 ip nhrp map multicast dynamic
 ip nhrp network-id 2
 tunnel source GigabitEthernet0/1.89
 tunnel mode gre multipoint
 tunnel key 64
 tunnel route-via GigabitEthernet0/1.89 mandatory
 tunnel protection ipsec profile IPSec-Profile2

ip route 0.0.0.0 0.0.0.0 1.1.1.1 200 track 89
ip route 0.0.0.0 0.0.0.0 2.2.2.2 200 track 245

ip access-list extended VoIP
 permit ip any any dscp ef

ip sla 89
 icmp-echo 1.1.1.1 source-interface GigabitEthernet0/1.89
ip sla schedule 89 life forever start-time now
ip sla 245
 icmp-echo 2.2.2.2 source-interface GigabitEthernet0/1.245
ip sla schedule 245 life forever start-time now

route-map policyRouting permit 10
 match ip address VoIP
 set interface Tunnel1

更新:看起来行为在 IOS 中发生了变化。在旧版本中,如果在路由表中找不到与路由映射中设置的接口匹配的相应路由,则策略将拒绝该数据包并继续进行正常转发。在新版本中,它策略性地将数据包路由到路由表中找到的下一跳 IP,但通过路由映射中指定的接口。就我而言,这会导致数据包通过隧道 1 路由到隧道 0 的 IP。这会导致它失败。

从辐条调试 - 较旧的 IOS:

    *Jun  3 16:39:18.279: IP: route map policyRouting, item 10, permit
    *Jun  3 16:39:18.279: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2 (Tunnel0), len 1228, policy rejected -- normal forwarding
    *Jun  3 16:39:18.279: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2, len 1228, policy match
    *Jun  3 16:39:18.279: IP: route map policyRouting, item 10, permit
    *Jun  3 16:39:18.279: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2 (Tunnel0), len 1228, policy rejected -- normal forwarding
    *Jun  3 16:39:18.279: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2, len 1228, policy match
    *Jun  3 16:39:18.279: IP: route map policyRouting, item 10, permit
    *Jun  3 16:39:18.279: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2 (Tunnel0), len 1228, policy rejected -- normal forwarding

从辐条调试 - 较新的 IOS:

    *Jun  3 16:10:15.807: IP: route map policyRouting, item 10, permit
    *Jun  3 16:10:15.807: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2 (Tunnel1), len 1228, policy routed
    *Jun  3 16:10:15.807: IP: FastEthernet0/0 to Tunnel1 10.10.255.1
    *Jun  3 16:10:15.807: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2, len 1228, policy match
    *Jun  3 16:10:15.807: IP: route map policyRouting, item 10, permit
    *Jun  3 16:10:15.807: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2 (Tunnel1), len 1228, policy routed
    *Jun  3 16:10:15.807: IP: FastEthernet0/0 to Tunnel1 10.10.255.1
    *Jun  3 16:10:15.807: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2, len 1228, policy match
    *Jun  3 16:10:15.807: IP: route map policyRouting, item 10, permit
    *Jun  3 16:10:15.807: IP: s=10.10.17.2 (FastEthernet0/0), d=10.1.4.2 (Tunnel1), len 1228, policy routed
2个回答

这就是我想出的方法,直到找到更好的方法。

    event manager environment downInterface t1
    event manager environment upInterface t1
    event manager applet ShutInterface
     event track 89 state down
     action 0 cli command "enable"
     action 1 cli command "conf t"
     action 2 cli command "interface $downInterface"
     action 3 cli command "shut"
     action 4 cli command "end"
     action 5 syslog priority errors msg "Shutting down $downInterface"
    event manager applet NoshutInterface
     event track 89 state up
     action 0 cli command "enable"
     action 1 cli command "conf t"
     action 2 cli command "interface $upInterface"
     action 3 cli command "no shut"
     action 4 cli command "end"
     action 5 syslog priority informational msg "Enabling $upInterface"

我认为您需要添加到您的路线图。

设置 ip 下一跳 YOUR_IP_ADDRESS

其中 YOUR_IP_ADDRESS 是您要路由到的下一跳路由器。

例如)

route-map policyRouting permit 10
 match ip address VoIP
 set ip next-hop x.y.z.w

您应该能够保留 set interface 命令,但是路由器应该自动选择与其路由表匹配的接口。如果没有 set ip next-hop 命令,路由器将根据其路由表转发数据包 - 无论所需的接口如何。

对于基于 12.2 的代码 - 查看Cisco 的文档