IP SLA(Internet Protocol Service-Level Agreement)互聯網服務等級協議,本實驗里通過發送測試報文,測試下一跳是否可達,結合Track實現冗余靜態路由的切換。
實驗環境:
模擬器:GNS3-1.5.2
路由器IOS 版本:C2691-ADVENTERPRISEK9-M)
交換機IOS版本:(C3640-IK9S-M), Version 12.4(10)
終端:VPCS
------------------------------網絡接口配置---------------------------------------------
R1:
R1#sho ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/1 172.16.20.1 YES NVRAM up up
FastEthernet1/0 192.168.1.2 YES NVRAM up up
Tunnel0 172.18.1.2 YES NVRAM up up
R1(config)#interface Tunnel0
ip address 172.18.1.2 255.255.255.0
keepalive 10 3
tunnel source FastEthernet0/1
tunnel destination 10.1.1.4
R2:
R2#sho ip inter bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/1 192.168.1.3 YES NVRAM up up
FastEthernet1/0 172.16.50.1 YES NVRAM up up
Tunnel0 172.18.2.2 YES NVRAM up up
R2(config)#interface Tunnel0
ip address 172.18.2.2 255.255.255.0
tunnel source FastEthernet1/0
tunnel destination 10.1.1.4
R3:
R3#sh ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/1 172.16.20.2 YES NVRAM up up
FastEthernet1/0 10.1.1.2 YES NVRAM up up
R4:
R4#show ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet1/0 172.16.50.2 YES NVRAM up up
FastEthernet1/1 10.1.1.3 YES NVRAM up up
R5:
R5#sh ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/10 10.248.0.1 YES NVRAM up up
Vlan10 10.1.1.4 YES NVRAM up up
Tunnel0 172.18.1.1 YES NVRAM up up
Tunnel1 172.18.2.1 YES NVRAM up up
R5(config)#interface Tunnel0
ip address 172.18.1.1 255.255.255.0
tunnel source Vlan10
tunnel destination 172.16.20.1
exit
interface Tunnel1
ip address 172.18.2.1 255.255.255.0
tunnel source Vlan10
tunnel destination 172.16.50.1
Sw1:
sw1#sh ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/1 unassigned YES unset up up
FastEthernet0/10 20.1.1.1 YES NVRAM up up
Vlan10 192.168.1.4 YES NVRAM up up
VPCS:
PC1> ip 20.1.1.2/24 20.1.1.1
PC2> ip 10.248.0.2/24 10.248.0.1
--------------------------------------------------IP SLA與靜態路由配置命令---------------------------------------------------------------
R1:
R1#conf t
R1(config)#ip sla monitor 10
R1(config-sla-monitor)#type echo protocol ipIcmpEcho 10.1.1.4 source-interface f0/1
R1(config-sla-monitor-echo)#timeout 500
R1(config-sla-monitor-echo)#frequency 2
R1(config-sla-monitor-echo)#exit
R1(config)#ip sla monitor schedule 10 life forever start-time now
R1(config)#track 10 rtr 10 reachability
R1(config-track)#exit
R1(config)#ip route 10.1.1.0 255.255.255.0 172.16.20.2
R1(config)#ip route 10.248.0.0 255.255.255.0 Tunnel0
R1(config)#ip route 20.1.1.0 255.255.255.0 192.168.1.4
R2:
R2#conf t
R2(config)#ip sla monitor 10
R2(config-sla-monitor)#type echo protocol ipIcmpEcho 10.1.1.4 source-interface f1/0
R2(config-sla-monitor-echo)#timeout 500
R2(config-sla-monitor-echo)#frequency 2
R2(config-sla-monitor-echo)#exit
R2(config)#ip sla monitor schedule 10 life forever start-time now
R2(config)#track 10 rtr 10 reachability
R2(config-track)#exit
R2(config)#ip route 10.1.1.0 255.255.255.0 172.16.50.2
R2(config)#ip route 10.248.0.0 255.255.255.0 Tunnel0
R2(config)#ip route 20.1.1.0 255.255.255.0 192.168.1.4
R3:
R3(config)#ip route 10.248.0.0 255.255.255.0 10.1.1.4
R3(config)#ip route 20.1.1.0 255.255.255.0 172.16.20.1
R3(config)#ip route 172.17.1.0 255.255.255.0 172.16.20.1
R3(config)#ip route 192.168.1.0 255.255.255.0 172.16.20.1
R4:
R4(config)#ip route 10.248.0.0 255.255.255.0 10.1.1.4
R4(config)#ip route 20.1.1.0 255.255.255.0 172.16.50.1
R4(config)#ip route 172.17.2.0 255.255.255.0 172.16.50.1
R4(config)#ip route 192.168.1.0 255.255.255.0 172.16.50.1
R5:
R5#conf t
R5(config)#ip sla monitor 10
R5(config(config-sla-monitor)#type echo protocol ipIcmpEcho 172.16.20.1 source-interface Vlan10 //從vlan10 去ping 172.16.20.1
R5 (config-sla-monitor-echo)#timeout 5000 //5秒沒有響應,認為掉線
R5 (config-sla-monitor-echo)#frequency 3 //每3秒PING 一次
R5(config)#ip sla monitor schedule 10 life forever start-time now
R5(config)#track 10 rtr 10 reachability
R5(config-track)#exit
R5(config)#ip route 20.1.1.0 255.255.255.0 Tunnel0 track 10
R5(config)#ip route 20.1.1.0 255.255.255.0 Tunnel1 10
R5(config)#ip route 172.16.20.0 255.255.255.0 Vlan10
R5(config)#ip route 172.16.50.0 255.255.255.0 Vlan10
-----------------------------------------------------VRRP配置---------------------------------------------------------------------
R1:
R1(config)#interface FastEthernet1/0
ip address 192.168.1.2 255.255.255.0
vrrp 10 ip 192.168.1.1
vrrp 10 priority 250
standby 1 preempt
vrrp 10 track 10 decrement 100 //當出現SLA出現中斷時,把自己的優先級降低100.
R1:
R2(config)#interface FastEthernet0/1
ip address 192.168.1.3 255.255.255.0
vrrp 10 ip 192.168.1.1
vrrp 10 priority 200
-----------------------------------------------------測試---------------------------------------------------------------------
中斷master任意節點,切線路自動切換.
在雙方設備條件允許情況下,可以使用 BFD檢測機制,提供毫秒級檢測。大多數情況下,由於網絡設備廠商不同、設備新舊程度不同,可能不支持BFD協議,所以IP SLA作為備選方案提供秒級的檢測。華為的NQA技術和cisco IP SLA類似。