0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Cisco】IP SLA + Object Tracking設定

Last updated at Posted at 2022-12-08

■IP SLAとは

プローブと呼ばれる測定用のパケットをターゲットに送信し、その応答を元にネットワークのパフォーマンスを監視/測定する機能

■設定

L3SW間でroutedで接続(IFに直接アドレスを付与)してIP-SLAで監視する際の設定メモ。
確認した機種はWS-C4500X-16、versionは03.08.05a.E。

IF設定
router01(config)# int TenGigabitEthernet1/2
router01(config-if)#
router01(config-if)# description XXXXXXX
router01(config-if)# no switchport
router01(config-if)# ip vrf forwarding VRF_NAME
router01(config-if)# ip address 192.168.10.1 255.255.255.252
router01(config-if)# no shutdown
router01(config-if)# exit
router01(config)#
IP-SLA設定
router01(config)# ip sla 1000   ##1000はオペレーション番号
router01(config-ip-sla)# icmp-echo 192.168.10.2 source-ip 192.168.10.1   ##ICMPを使った監視。RTTを測定(ping打った時のtime=xx.xx ms のこと)できる。他の監視項目として"tcp-connect"や"http"がある。
router01(config-ip-sla-echo)# vrf VRF_NAME   ##必要に応じてVRFの適用。
router01(config-ip-sla-echo)# frequency 10   ##10秒ごとに確認パケットを送り、reachabilityの有無を判断。デフォルト60秒。
router01(config-ip-sla-echo)# threshold 2000   ##RTTの閾値(2000ms).RTTがしきい値を超えると戻り値を"Over threshold"にする。
router01(config-ip-sla-echo)# timeout 2000   ##応答パケットを待つ時間(2000ms).RTTが応答を待つ時間を超えるとタイムアウトしたと判断し、戻り値を"Timeout"にする。
router01(config-ip-sla-echo)# ip sla schedule 1000 life forever start-time now   ##IPSLAオペレーション番号について、今すぐに開始して永続的に継続する。
IPSLA確認
router01# show ip sla statistics
Load for five secs: 25%/4%; one minute: 25%; five minutes: 24%
Time source is NTP, 13:40:39.397 JST Mon Nov 28 2022

IPSLAs Latest Operation Statistics

IPSLA operation id: 1000
        Latest RTT: 3 milliseconds
Latest operation start time: 13:40:35 JST Mon Nov 28 2022
Latest operation return code: OK
Number of successes: 266
Number of failures: 0
Operation time to live: Forever
IPSLA(reachability)確認
router01#show ip sla summary
Load for five secs: 21%/2%; one minute: 24%; five minutes: 24%
Time source is NTP, 13:41:33.300 JST Mon Nov 28 2022

IPSLAs Latest Operation Summary
Codes: * active, ^ inactive, ~ pending

ID           Type        Destination       Stats       Return      Last
                                           (ms)        Code        Run
-----------------------------------------------------------------------
*1000        icmp-echo   192.168.10.2      RTT=1       OK          7 seconds ago

しきい値(2000ms)未満の応答時間(RTT)の場合はReturn CodeがOK、超過している場合はOver thresholdとなっている。応答がなくなってから2000ms経つとTimeOutとなる。

■Object Tracking

オブジェクトトラッキング(ルータが認識できる様々な状態を監視する機能)にIP SLAの監視/測定結果を利用することで、到達性のなくなったパスを無効化してパスの切り替えができる。

※完全にリンクダウンする場合はフローティングスタティックのみの設定でも経路は切り替わるが、
リンクアップしているのに疎通できないいわゆる"サイレント障害"の場合だと、ルーティングは残ったまま疎通ができない状態となりパスが切り替わらない。

Tracking設定
router01(config)# track 100 ip sla 1000 reachability   ##トラッキング番号と、それに紐づくIPSLAのオペレーション番号の指定。IP SLAの戻り値からのトラッキング状態の判定方法を指定(state/reachability)。reachabilityであればOver thresholdでも到達性はOKとしてUPとみなす。
router01(config-track)# delay down 30 up 1   ##rechability モードのオプション設定。監視しているルートを削除(down)するまでの時間を秒数(30)で指定。IP SLAがOKになってから1秒後に監視している経路を再インストール(up)する。デフォルト0秒。
router01(config)#
router01(config)# ip route vrf VRF_NAME 10.1.0.0 255.255.0.0 192.168.10.2 track 100   ##トラッキング番号を指定した静的経路。トラッキングがdownするとルート情報は消える。
router01(config)# ip route vrf VRF_NAME 10.1.0.0 255.255.0.0 172.21.0.3 50   ##切り替えパス。AD値を50にしている。
tracking確認
router01#show track
Load for five secs: 25%/3%; one minute: 25%; five minutes: 24%
Time source is NTP, 13:40:53.312 JST Mon Nov 28 2022

Track 100
  IP SLA 1000 reachability
  Reachability is Up
    24 changes, last change 1y49w
  Delay up 30 secs, down 1 secs
  Latest operation return code: OK
  Latest RTT (millisecs) 1
  Tracked by:
    Static IP Routing 0

IPSLAの監視がTimeoutになると、Reachability is Down,return codeがTimeoutになる。
※return codeがOver threshold(RTTの閾値を超えただけ)だとUpのまま。

■障害時の確認

TenGigabitEthernet1/2の物理線を抜いてみる。

log
Oct 27 13:40:45.616 JST: %TRACK-6-STATE: 100 ip sla 1000 reachability Up -> Down

track100のreachabilityがDownしたことがわかる。

IPSLA(reachability)確認
router01#show ip sla summary
Load for five secs: 32%/4%; one minute: 31%; five minutes: 31%
Time source is NTP, 13:41:50.692 JST Thu Oct 27 2022

IPSLAs Latest Operation Summary
Codes: * active, ^ inactive, ~ pending

ID           Type        Destination       Stats       Return      Last
                                           (ms)        Code        Run
-----------------------------------------------------------------------
*1000        icmp-echo   192.168.10.2      -           Timeout     11 seconds ag
                                                                   o

Return CodeがTimeoutとなっている。

以下コマンドで経路が切り替わっていることを確認。track100を指定した静的経路が消え、AD値に50を指定した経路が有効になっている。

show ip route vrf VRF_NAME 

■ EEM

上記までの処理に加え、EEM(Embedded Event Manager)機能を使うことで、特定のイベント発生をトリガーにして設定したアクションを実行できる。
track 100 が落ちた時に TenGigabitEthernet1/2 を再起動する例↓

router(config)# event manager applet Eth1/2_Reboot
router(config-applet)# event track 10 state down         ###"syslog pattern"や"snmp"などもトリガー対象にできる
router(config-applet)# action 1.0 syslog 5 msg "EEM_start!"
router(config-applet)# action 2.0 cli command "enable"
router(config-applet)# action 3.0 cli command "conf t"
router(config-applet)# action 4.0 cli command "int TenGigabitEthernet1/2"
router(config-applet)# action 5.0 cli command "shutdown"
router(config-applet)# action 6.0 cli command "no shutdown"
router(config-applet)# action 7.0 cli command "end"

トリガーを"none"にして
event manager run EEM名で設定したアクションを手動実行することもできます。

show event manager policy registered`.

でEEMの情報を確認できる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?