IP SLAの基本的な使い方
- カテゴリ:
- Cisco
CCIEの勉強を初めると馴染みのない技術がたくさん出てきます。その中の一つであるSLA(Implement IP Service Level Agreement SLA)は解説も少なく、理解に時間がかかります。ここでは基本的なSLAの設定を確認していきます。
R1 R2 R3があり、EIGRPを利用してR1からはR2を経由してR3に到達できます。下記はR1よりR3のLo0アドレスに対してpingを実行している例です。
R1#show ip route eigrp 17.0.0.0/24 is subnetted, 3 subnets D 17.17.2.0 [90/156160] via 12.12.12.2, 00:04:43, FastEthernet0/0 D 17.17.3.0 [90/2300416] via 12.12.12.2, 00:04:43, FastEthernet0/0 23.0.0.0/24 is subnetted, 1 subnets D 23.23.23.0 [90/2172416] via 12.12.12.2, 00:04:43, FastEthernet0/0 R1#ping 17.17.3.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 17.17.3.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 12/77/316 ms |
SLAを設定するにあたり、R3ではどのようにするとpingが到達したことを確認できるのでしょうか。debug ip icmpを有効にするという方法があります。
R3#debug ip icmp ICMP packet debugging is on |
上記コマンドを実行後、再びR1でpingを実行したときにR3で表示される内容です。
R3# Feb 2 07:36:27.987: ICMP: echo reply sent, src 17.17.3.3, dst 12.12.12.1 Feb 2 07:36:28.071: ICMP: echo reply sent, src 17.17.3.3, dst 12.12.12.1 Feb 2 07:36:28.091: ICMP: echo reply sent, src 17.17.3.3, dst 12.12.12.1 Feb 2 07:36:28.099: ICMP: echo reply sent, src 17.17.3.3, dst 12.12.12.1 Feb 2 07:36:28.115: ICMP: echo reply sent, src 17.17.3.3, dst 12.12.12.1 |
上記内容から、Lo0がR1のF0/0に対してecho replyを送っていることが分かります。
ではここからSLAを使ってR1よりR3に対してpingを実行する設定を始めます。ip slaに続いて任意のエントリ番号を指定します。ここでは1を使います。
R1(config)#ip sla ? <1-2147483647> Entry Number 〜略〜 R1(config)#ip sla 1 |
SLAには多くの設定がありますが、ここではpingを実行するためにicmp-echoを利用します。
R1(config-ip-sla)#? IP SLAs entry configuration commands: 〜略〜 icmp-echo ICMP Echo Operation 〜略〜 |
続いて、宛先(17.17.3.3)を指定します。送信元アドレスなども指定できますが、ここでは利用せずにごく単純な設定にしました。
R1(config-ip-sla)#icmp-echo ? Hostname or A.B.C.D Destination IP address or hostname, broadcast disallowed R1(config-ip-sla)#icmp-echo 17.17.3.3 ? source-interface Source Interface (ingress icmp packet interface) source-ip Source Address <cr> R1(config-ip-sla)#icmp-echo 17.17.3.3 |
ここまでの設定を確認するためにshow ip sla configurationコマンドを利用します。ここまでは設定のみであり、まだ実行はされません。
R1#show ip sla configuration 1 IP SLAs, Infrastructure Engine-II. 〜略〜 Type of operation to perform: icmp-echo Target address/Source address: 17.17.3.3/0.0.0.0 Operation timeout (milliseconds): 5000 Type Of Service parameters: 0x0 |
実行を開始するにはip sla scheduleコマンドを利用します。lifeをfoeverとすると実行し続けます。またstart-timeをnowとすることですぐに開始されます。
R1(config)#ip sla schedule 1 ? ageout How long to keep this Entry when inactive life Length of time to execute in seconds recurring Probe to be scheduled automatically every day start-time When to start this entry <cr> R1(config)#ip sla schedule 1 life ? <0-2147483647> Life seconds (default 3600) forever continue running forever R1(config)#ip sla schedule 1 life forever ? ageout How long to keep this Entry when inactive recurring Probe to be scheduled automatically every day start-time When to start this entry <cr> R1(config)#ip sla schedule 1 life forever start-time ? after Start after a certain amount of time from now hh:mm Start time (hh:mm) hh:mm:ss Start time (hh:mm:ss) now Start now pending Start pending R1(config)#ip sla schedule 1 life forever start-time now |
実行後、R3で確認してみると60秒ごとにpingが実行されていることが分かります。
R3# Feb 2 08:19:55.143: ICMP: echo reply sent, src 17.17.3.3, dst 12.12.12.1 Feb 2 08:20:55.035: ICMP: echo reply sent, src 17.17.3.3, dst 12.12.12.1 Feb 2 08:21:55.051: ICMP: echo reply sent, src 17.17.3.3, dst 12.12.12.1 |
現在の実行状況を確認するにはshow ip sla statisticsコマンドを利用します。
R1#show ip sla statistics 1 details Round Trip Time (RTT) for Index 1 Latest RTT: 8 milliseconds Latest operation start time: 19:39:50.070 JST Wed Feb 2 2011 Latest operation return code: OK Over thresholds occurred: FALSE Number of successes: 20 Number of failures: 0 Operation time to live: Forever Operational state of entry: Active Last time this entry was reset: Never |
このslaをtrackコマンドなどと組み合わせることで、ネットワークに到達できる時にのみHSRPを実行するなどということが出来るようになります。
コメント