双线双路和断线自动切换(sla与eem技术应用)

简介:

拓扑图:

 

 
实验要求:
1.R1 ping 5.5.5.5 数据包从R1-R2-R3-R5到达
2.R2 ping 123.1.1.5 数据包从R1-R2-R4-R5到达
3.R2、R3、R4、R5上不能运行动态路由协议
4.R2上能实现断线自动切换线路(在ping测试中实现自动切换)
 
配置:
 
R1上
R1>en
R1#conf t
R1(config)#int fa0/0
R1(config-if)#ip address 12.1.1.10 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 fa0/0
 
R2上
R2>en
R2#conf t
R2(config)#int fa0/0
R2(config-if)#ip address 12.1.1.1 255.255.255.0
R2(config-if)#ip nat inside
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#int fa1/0
R2(config-if)#ip address 23.1.1.2 255.255.255.0
R2(config-if)#ip nat outside
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#int fa2/0
R2(config-if)#ip address 24.1.1.2 255.255.255.0
R2(config-if)#ip nat outside
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#access-list 1 permit 12.1.1.0 0.0.0.255
R2(config)#route-map aaa permit 10
R2(config-route-map)#match ip addressress 1
R2(config-route-map)#match interface FastEthernet1/0
R2(config-route-map)#exit
R2(config)#route-map bbb permit 10
R2(config-route-map)#match ip addressress 1
R2(config-route-map)#match interface FastEthernet2/0
R2(config-route-map)#exit
R2(config)#ip nat inside source route-map aaa interface Fa1/0
R2(config)#ip nat inside source route-map bbb interface Fa2/0
R2(config)#ip sla monitor 1
R2(config-sla-monitor)#type echo protocol ipIcmpEcho 23.1.1.3 source-interface fa1/0
R2(config-sla-monitor-echo)#timeout 3000
R2(config-sla-monitor-echo)#frequency 3
R2(config-sla-monitor-echo)#exit
R2(config)#ip sla monitor schedule 1 life forever start-time now
R2(config)#ip sla monitor 2
R2(config-sla-monitor)#type echo protocol ipIcmpEcho 24.1.1.4 source-interface fa2/0
R2(config-sla-monitor-echo)#timeout 3000
R2(config-sla-monitor-echo)#frequency 3
R2(config-sla-monitor-echo)#exit
R2(config)#ip sla monitor schedule 2 life forever start-time now
R2(config)#track 1 rtr 1
R2(config)#track 2 rtr 2
R2(config)#ip route 5.5.5.0 255.255.255.0 24.1.1.4 100
R2(config)#ip route 123.1.1.5 255.255.255.255 23.1.1.3 100
R2(config)#ip route 5.5.5.0 255.255.255.0 23.1.1.3  track 1
R2(config)#ip route 123.1.1.5 255.255.255.255 24.1.1.4  track 2
R2(config)#event manager applet ccc
R2(config-applet)#event syslog pattern "Line protocol on Interface FastEthernet1/0, changed state to down"
R2(config-applet)#action 1 cli command "enable"
R2(config-applet)#action 2 cli command "clear ip nat trans *"
R2(config-applet)#exit
R2(config)#event manager applet ddd
R2(config-applet)#event syslog pattern "Line protocol on Interface FastEthernet2/0, changed state to down"
R2(config-applet)#action 1 cli command "enable"
R2(config-applet)#action 2 cli command "clear ip nat trans *"
R2(config-applet)#exit
 
R3上
R3>en
R3#conf t
R3(config)#int fa0/0
R3(config-if)#ip address 23.1.1.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#int fa1/0
R3(config-if)#ip address 123.1.1.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#ip route 5.5.5.0 255.255.255.0 123.1.1.5
 
R4上
R4>en
R4#conf t
R4(config)#int fa0/0
R4(config-if)#ip address 24.1.1.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#int fa1/0
R4(config-if)#ip address 123.1.1.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#ip route 5.5.5.0 255.255.255.0 123.1.1.5
 
R5上
R5>en
R5#conf t
R5(config)#int fa0/0
R5(config-if)#ip address 123.1.1.5 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#exit
R5(config)#int loopback 0
R5(config-if)#ip address 5.5.5.5 255.255.255.0
R5(config-if)#no shutdown
R5(config-if)#exit
R5(config)#ip route 0.0.0.0 0.0.0.0 fa0/0









本文转自 aaao 51CTO博客,原文链接:http://blog.51cto.com/nolinux/961838,如需转载请自行联系原作者

目录
相关文章
|
11天前
|
网络安全 数据安全/隐私保护 网络架构
为何使用长效静态IP会出现高延迟现象?
在使用长效静态IP时,出现高延迟的原因主要包括:1. 网络距离远、网络拥堵和网络质量差等环境因素;2. 服务器负载高、性能低等服务器相关问题;3. 代理协议加密、网络配置不当等配置因素;4. 目标服务器响应慢。这些因素都会影响数据传输速度,导致延迟增加。希望以上分析能帮助解决您的问题。
37 8
|
5月前
|
安全 物联网 定位技术
2G网络的逐渐关闭和基站撤销,对车联网的影响
车联网作为汽车与现代信息技术融合的产物,其发展和运营高度依赖于通信网络的支持。在当前的车联网体系中,由于成本、覆盖率和数据需求等多方面因素,2G设备仍然占据一定的比例。然而,随着全球范围内2G网络的逐渐关闭和基站撤销,车联网不可避免地会受到一定影响。以下是对这一影响的详细分析:
H3C服务器红灯故障解决方案
H3C服务器红灯故障解决方案
381 0
|
负载均衡 算法
leach协议性能对比仿真,包括死亡节点数,数据传输,网络能量消耗,簇头产生数以及负载均衡度
leach协议性能对比仿真,包括死亡节点数,数据传输,网络能量消耗,簇头产生数以及负载均衡度
363 0
leach协议性能对比仿真,包括死亡节点数,数据传输,网络能量消耗,簇头产生数以及负载均衡度