SLA(Service Level Agreement)
SLAとは、Cisco本家サイト「IP SLA の基本設定」の記載にある「IP SLA はリモートの機器に対して ICMP echo request など何らかのプローブパケットを送信し応答時間などを計測する機能です。IP SLA で収集した情報を元に object tracking, static routing などの他の機能と連携しルーティングを変更したり機器に何らかのアクションを取らせることができます。」のことである。ここでは、ある宛先からの応答の有無により、Static Routeを変更することとした。
環境
- 左のルーターIOU1と右のルーターIOU4の疎通を考える
- IOU1からIOU4へのルート
- メイン(正常時)ルート:IOU2(上)を経由
- IOU2ルートとなるIOU4のIPアドレス”172.16.10.1”が監視ターゲット
- バックアップルート:IOU3(下)を経由
- メイン(正常時)ルート:IOU2(上)を経由
- IOU4からIOU1へのルート
- メイン(正常時)ルート:IOU3(下)を経由
- IOU3ルートとなるIOU1のIPアドレス”192.168.20.1”が監視ターゲット
- バックアップルート:IOU2(上)を経由
- メイン(正常時)ルート:IOU3(下)を経由
設定
関連する部分のみ記載。
IOU1
hostname IOU1
track 11 ip sla 1 reachability
delay down 10 up 2
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0/0
ip address 192.168.10.1 255.255.255.0
!
interface Ethernet0/1
ip address 192.168.20.1 255.255.255.0
ip route 4.4.4.4 255.255.255.255 192.168.10.2 track 11
ip route 4.4.4.4 255.255.255.255 192.168.20.2 254
ip route 172.16.10.0 255.255.255.0 192.168.10.2
ip route 172.16.20.0 255.255.255.0 192.168.20.2
!
ip sla 1
icmp-echo 172.16.10.1
frequency 30
ip sla schedule 1 life forever start-time now
- ループバックIPアドレス:1.1.1.1
- Ethernet0/0 IPアドレス:192.168.10.1
- Ethernet0/1 IPアドレス:192.168.20.1
- sla1
- 172.16.10.1に対して30秒ごとにICMP-ECHOを永遠に送付
- track11
- sla1の到達性(疎通)確認:ダウン確認10秒後およびアップ確認2秒後に到達性状況を変化させる
- IOU4のEthernet IPアドレス(172.16.10.0および172.16.20.0)へのスタティックルート
- IOU4のループバックIPアドレス(4.4.4.4)へのスタティックルート設定
- track11到達性有:IOU2(192.168.10.2)経由
- track11到達性無:IOU3(192.168.20.2)経由
- AD値:254(255は機能せずであった)
IOU4
IOU1とIPアドレス違いだけなので、説明略。
hostname IOU4
track 11 ip sla 1 reachability
delay down 10 up 2
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface Ethernet0/0
ip address 172.16.10.1 255.255.255.0
!
interface Ethernet0/1
ip address 172.16.20.1 255.255.255.0
ip route 1.1.1.1 255.255.255.255 172.16.20.2 track 11
ip route 1.1.1.1 255.255.255.255 172.16.10.2 254
ip route 192.168.10.0 255.255.255.0 172.16.10.2
ip route 192.168.20.0 255.255.255.0 172.16.20.2
!
ip sla 1
icmp-echo 192.168.20.1
frequency 30
ip sla schedule 1 life forever start-time now
IOU2
ほぼ自明なので、説明略。
hostname IOU2
interface Ethernet0/0
ip address 192.168.10.2 255.255.255.0
!
interface Ethernet0/1
ip address 172.16.10.2 255.255.255.0
ip route 1.1.1.1 255.255.255.255 192.168.10.1
ip route 4.4.4.4 255.255.255.255 172.16.10.1
IOU3
ほぼ自明なので、説明略。
hostname IOU3
interface Ethernet0/0
ip address 192.168.20.2 255.255.255.0
!
interface Ethernet0/1
ip address 172.16.20.2 255.255.255.0
ip route 1.1.1.1 255.255.255.255 192.168.20.1
ip route 4.4.4.4 255.255.255.255 172.16.20.1
検証
ここでは、IOU1からIOU4へのping、traceroute、各種状況を確認する。また、IOU1のみの結果を表示。
メインルート利用時(すべてのルートが確立)
IOU1#
*Apr 7 03:59:23.350: %TRACK-6-STATE: 11 ip sla 1 reachability Down -> Up
sla1の到達性が確認されている(Up)。次に、ルーティングテーブルの確認。
IOU1#show ip route
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
S 4.4.4.4 [1/0] via 192.168.10.2
172.16.0.0/24 is subnetted, 2 subnets
S 172.16.10.0 [1/0] via 192.168.10.2
S 172.16.20.0 [1/0] via 192.168.20.2
192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.10.0/24 is directly connected, Ethernet0/0
L 192.168.10.1/32 is directly connected, Ethernet0/0
192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.20.0/24 is directly connected, Ethernet0/1
L 192.168.20.1/32 is directly connected, Ethernet0/1
設定どおりのテーブルとなっている。次に、IOU4のループバックIPアドレス(4.4.4.4)への疎通確認および経路確認。
IOU1#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/5 ms
IOU1#traceroute 4.4.4.4
Type escape sequence to abort.
Tracing the route to 4.4.4.4
VRF info: (vrf in name/id, vrf out name/id)
1 192.168.10.2 6 msec 5 msec 5 msec
2 172.16.10.1 3 msec 6 msec 5 msec
IOU2(192.168.10.2)経由となっている。
slaおよびtrackの状態
IOU1#show ip sla statistics
IPSLAs Latest Operation Statistics
IPSLA operation id: 1
Latest RTT: 1 milliseconds
Latest operation start time: 04:02:16 UTC Sun Apr 7 2024
Latest operation return code: OK
Number of successes: 7
Number of failures: 1
Operation time to live: Forever
IOU1#show ip sla summary
IPSLAs Latest Operation Summary
Codes: * active, ^ inactive, ~ pending
ID Type Destination Stats Return Last
(ms) Code Run
-----------------------------------------------------------------------
*1 icmp-echo 172.16.10.1 RTT=1 OK 21 seconds ag
o
IOU1#show track
Track 11
IP SLA 1 reachability
Reachability is Up
2 changes, last change 00:04:27
Delay up 2 secs, down 10 secs
Latest operation return code: OK
Latest RTT (millisecs) 1
Tracked by:
Static IP Routing 0
あまりコメントできず、、。正常時はこんなものであろう。
バックアップルート利用時(IOU2のI/Fダウン)
まずは、メインルートにあるIOU2のI/Fをダウンさせる。
IOU2(config)#interface ethernet 0/0
IOU2(config-if)#
IOU2(config-if)#shut
すると、IOU1にsla1到達性Downのメッセージが表示される。
IOU1#
*Apr 7 04:05:06.576: %TRACK-6-STATE: 11 ip sla 1 reachability Up -> Down
このときに、IOU4ループバックIPアドレス(4.4.4.4)への疎通を確認。
IOU1#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/5/6 ms
IOU1#traceroute 4.4.4.4
Type escape sequence to abort.
Tracing the route to 4.4.4.4
VRF info: (vrf in name/id, vrf out name/id)
1 192.168.20.2 5 msec 5 msec 6 msec
2 172.16.20.1 5 msec 5 msec 5 msec
疎通あり、ルートはIOU3(192.168.20.2)経由(バックアップルート)となっている。ルーティングテーブルも確認。
IOU1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
S 4.4.4.4 [254/0] via 192.168.20.2
172.16.0.0/24 is subnetted, 2 subnets
S 172.16.10.0 [1/0] via 192.168.10.2
S 172.16.20.0 [1/0] via 192.168.20.2
192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.10.0/24 is directly connected, Ethernet0/0
L 192.168.10.1/32 is directly connected, Ethernet0/0
192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.20.0/24 is directly connected, Ethernet0/1
L 192.168.20.1/32 is directly connected, Ethernet0/1
tracerouteの結果を表すべく、”4.4.4.4”へのルートが”192.168.20.2”となっていることが見える。
slaおよびtrackの状態
IOU1#show ip sla statistics
IPSLAs Latest Operation Statistics
IPSLA operation id: 1
Latest RTT: NoConnection/Busy/Timeout
Latest operation start time: 04:05:46 UTC Sun Apr 7 2024
Latest operation return code: Timeout
Number of successes: 11
Number of failures: 4
Operation time to live: Forever
IOU1#show ip sla summary
IPSLAs Latest Operation Summary
Codes: * active, ^ inactive, ~ pending
ID Type Destination Stats Return Last
(ms) Code Run
-----------------------------------------------------------------------
*1 icmp-echo 172.16.10.1 - Timeout 29 seconds ag
o
IOU1#show track
Track 11
IP SLA 1 reachability
Reachability is Down
3 changes, last change 00:01:26
Delay up 2 secs, down 10 secs
Latest operation return code: Timeout
Tracked by:
Static IP Routing 0
track11において、sla1の到達性がDownとなっている表示が見える。
IOU2のI/FをUp、メインルートへ
”no shut”によりメインルート復活。
IOU2(config-if)#
IOU2(config-if)#no shut
IOU1にて到達性UP。
IOU1#
*Apr 7 04:09:18.724: %TRACK-6-STATE: 11 ip sla 1 reachability Down -> Up
ルーティングテーブルも元に戻る。
IOU1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
S 4.4.4.4 [1/0] via 192.168.10.2
172.16.0.0/24 is subnetted, 2 subnets
S 172.16.10.0 [1/0] via 192.168.10.2
S 172.16.20.0 [1/0] via 192.168.20.2
192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.10.0/24 is directly connected, Ethernet0/0
L 192.168.10.1/32 is directly connected, Ethernet0/0
pingおよびtracerouteも同様。
IOU1#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/5/6 ms
IOU1#traceroute 4.4.4.4
Type escape sequence to abort.
Tracing the route to 4.4.4.4
VRF info: (vrf in name/id, vrf out name/id)
1 192.168.10.2 5 msec 5 msec 6 msec
2 172.16.10.1 5 msec 5 msec 5 msec
slaおよびtrackの状態
IOU1#show ip sla statistics
IPSLAs Latest Operation Statistics
IPSLA operation id: 1
Latest RTT: 1 milliseconds
Latest operation start time: 04:09:46 UTC Sun Apr 7 2024
Latest operation return code: OK
Number of successes: 13
Number of failures: 10
Operation time to live: Forever
IOU1#show ip sla summary
IPSLAs Latest Operation Summary
Codes: * active, ^ inactive, ~ pending
ID Type Destination Stats Return Last
(ms) Code Run
-----------------------------------------------------------------------
*1 icmp-echo 172.16.10.1 RTT=1 OK 16 seconds ag
o
IOU1#show track
Track 11
IP SLA 1 reachability
Reachability is Up
4 changes, last change 00:00:48
Delay up 2 secs, down 10 secs
Latest operation return code: OK
Latest RTT (millisecs) 1
Tracked by:
Static IP Routing 0
元に戻る。
おまけ
IOU1からIOU4ループバックIPアドレス(4.4.4.4)へのpingを実行する際、Source IPアドレスを1.1.1.1としたときのルートについて。
- メインルートON時:往路はメインルート、復路はバックアップルート
- メインルートOFF(バックアップルート)時:往復路ともバックアップルート
たまたまであるが、ルーティング設定によっては、負荷分散できることにも気がつく。
EOF