一台路由器连接有线另外通过4G拨号无线上网,有线正常走有线,当有线断了通过NQA 探测切换到无线,请求推荐一个配置案列的链接。
(0)
最佳答案
1、双出口,写两个缺省路由走这两个出口,调整路由优先级,走有线出口的优先级高,正常时默认走有线出口
2、走有线的静态路由联动track,配置nqa探测,当nqa探测失败联动track使静态路由失效
案例可以找配置手册track模块。nqa/track联动静态路由。
(0)
暂无评论
以下是一个配置案例:
interface GigabitEthernet0/0/0
description Connection to LAN
ip address 192.168.1.1 255.255.255.0
nqa test-instance 1
test-type icmp
destination-ip-address 8.8.8.8
control enable
frequency 5
timeout 1000
threshold 2
nqa test-instance 2
test-type icmp
destination-ip-address 8.8.4.4
control enable
frequency 5
timeout 1000
threshold 2
interface Cellular0/0/0
description Connection to 4G network
ip address negotiated
dialer in-band
dialer string internet
dialer-group 1
nqa test-instance 3
test-type icmp
destination-ip-address 8.8.8.8
control enable
frequency 5
timeout 1000
threshold 2
nqa test-instance 4
test-type icmp
destination-ip-address 8.8.4.4
control enable
frequency 5
timeout 1000
threshold 2
ip route 0.0.0.0 0.0.0.0 Cellular0/0/0
ip route 0.0.0.0 0.0.0.0 192.168.1.254 10
ip sla auto discovery
ip sla schedule 1 life forever start-time now
track 1 ip sla 1 reachability
ip sla schedule 2 life forever start-time now
track 2 ip sla 2 reachability
ip sla schedule 3 life forever start-time now
track 3 ip sla 3 reachability
ip sla schedule 4 life forever start-time now
track 4 ip sla 4 reachability
access-list 101 permit ip any any
route-map SLA1 permit 10
match ip address 101
set ip next-hop verify-availability 192.168.1.254 10 track 1
route-map SLA2 permit 10
match ip address 101
set ip next-hop verify-availability Cellular0/0/0 track 3
interface GigabitEthernet0/0/0
description Connection to LAN
ip address 192.168.1.1 255.255.255.0
nqa test-instance 1
test-type icmp
destination-ip-address 8.8.8.8
control enable
frequency 5
timeout 1000
threshold 2
nqa test-instance 2
test-type icmp
destination-ip-address 8.8.4.4
control enable
frequency 5
timeout 1000
threshold 2
service-policy input SLA1
interface Cellular0/0/0
description Connection to 4G network
ip address negotiated
dialer in-band
dialer string internet
dialer-group 1
nqa test-instance 3
test-type icmp
destination-ip-address 8.8.8.8
control enable
frequency 5
timeout 1000
threshold 2
nqa test-instance 4
test-type icmp
destination-ip-address 8.8.4.4
control enable
frequency 5
timeout 1000
threshold 2
service-policy input SLA2
其中,路由器的GigabitEthernet0/0/0接口连接LAN,Cellular0/0/0接口连接4G网络。设置4个NQA实例,分别测试目标IP地址8.8.8.8和8.8.4.4的可用性。创建了两个路由映射:SLA1和SLA2。SLA1在GigabitEthernet0/0/0接口上应用,用于路由到192.168.1.254的有线网关,当有线网关不可用时,通过设置10并跟踪1自动切换到4G网络。SLA2应用到Cellular0/0/0接口上,用于在有线网关不可用时路由到Cellular0/0/0接口的4G网络。两个路由映射共同构成IP路由表中0.0.0.0/0的两条默认路由。使用SLA的自动切换可以实现在有线网关故障时无缝切换到4G网络,并提高网络可用性。
(0)
暂无评论
配置案例:
1. 配置有线和无线接口
interface GigabitEthernet0/0/0
description Connected to LAN
ip address 192.168.1.1 255.255.255.0
interface Cellular0/1/0
description Connected to 4G network
ip address dhcp
2. 配置NQA探测
ip sla 1
icmp-echo 8.8.8.8 source-interface GigabitEthernet0/0/0
frequency 30
ip sla schedule 1 life forever start-time now
track 1 ip sla 1 reachability
delay down 10 up 5
3. 配置静态路由和默认路由
ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0/0
ip route 8.8.8.8 255.255.255.255 Cellular0/1/0
4. 配置IP SLA跟踪并启用NAT
ip nat inside source list 1 interface Cellular0/1/0 overload
access-list 1 permit 192.168.1.0 0.0.0.255
ip sla monitor schedule 1 start-time now life forever
ip sla monitor reaction-configuration 1 react timeout threshold-type immediate action-type trapOnly
5. 配置路由跟踪
ip route 0.0.0.0 0.0.0.0 192.168.1.2 track 1
6. 配置故障转移
track 2 ip route 0.0.0.0 0.0.0.0 reachability
ip route 0.0.0.0 0.0.0.0 Cellular0/1/0 track 2
以上配置将在有线连接断开时自动切换到4G网络。
具体配置可能因设备型号和操作系统版本而有所不同。建议在实际环境中进行测试和调整。
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论