アーカイブ

2011年02月

カテゴリ:

pingコマンドでネットワークの疎通を確認しますが、sourceを利用して送信元のインターフェイスやIPアドレスを指定することが出来ます。

R1#ping 192.168.1.1 ?
〜略〜
  source    specify source address or name
〜略〜

現在R1とR2は12.12.12.0/24で直接接続されています。

R1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.1      YES manual up                    up      
FastEthernet0/1            1.1.1.1         YES manual up                    up      
Loopback0                  17.17.1.1       YES NVRAM  up                    up      

R2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.2      YES manual up                    up      
Loopback0                  17.17.2.2       YES NVRAM  up                    up

まずR2のF0/0へpingを実行します。この時点ではルーティングの設定はまだありません。

R1#ping 12.12.12.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.12.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/8/12 ms

ここでEIGRPを設定します。

R1(config)#router eigrp 100
R1(config-router)#no auto-summary
R1(config-router)#network 17.17.1.1 0.0.0.0
R1(config-router)#network 12.12.12.1 0.0.0.0

R2(config)#router eigrp 100
R2(config-router)#no auto-summary
R2(config-router)#network 17.17.2.2 0.0.0.0
R2(config-router)#network 12.12.12.2 0.0.0.0

R1がR2とネイバーを確立したことを確認します。

R1#show ip eigrp neighbors
IP-EIGRP neighbors for process 100
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   12.12.12.2              Fa0/0             12 00:00:12    8   300  0  4

この時点でのルーティングテーブルを確認します。

R1#show ip route eigrp
     17.0.0.0/24 is subnetted, 2 subnets
D       17.17.2.0 [90/156160] via 12.12.12.2, 00:02:07, FastEthernet0/0

R2#show ip route eigrp
     17.0.0.0/24 is subnetted, 2 subnets
D       17.17.1.0 [90/156160] via 12.12.12.1, 00:02:16, FastEthernet0/0

R1からpingコマンドを実行する前に、R2でdebugを設定します。

R2#debug ip icmp
ICMP packet debugging is on

ここでpingをR2のLo0に対して実行します。

R1#ping 17.17.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 17.17.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/8/16 ms

この時、R2では下記のようなログが表示されます。dstが12.12.12.1であることから、pingはF0/0をソースとして実行されたことが分かります。

R2#
Feb 23 06:07:08.119: ICMP: echo reply sent, src 17.17.2.2, dst 12.12.12.1
Feb 23 06:07:08.135: ICMP: echo reply sent, src 17.17.2.2, dst 12.12.12.1

次にsourceを利用して実行します。ここではLo0(17.17.1.1)を指定しました。

R1#ping 17.17.2.2 source loopback 0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 17.17.2.2, timeout is 2 seconds:
Packet sent with a source address of 17.17.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/7/8 ms

R2のログは下記のようになります。確かに17.17.1.1を利用していることが分かります。

Feb 23 06:09:42.091: ICMP: echo reply sent, src 17.17.2.2, dst 17.17.1.1
Feb 23 06:09:42.111: ICMP: echo reply sent, src 17.17.2.2, dst 17.17.1.1

では次にF0/1(1.1.1.1)を利用して実行しますが、失敗します。

R1#ping 17.17.2.2 source fastEthernet 0/1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 17.17.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
.....
Success rate is 0 percent (0/5)

何故でしょうか。R2では下記のようなログが表示されていることから、パケットが届いており、replyを1.1.1.1に対して送っていることが分かります。

Feb 23 06:15:32.807: ICMP: echo reply sent, src 17.17.2.2, dst 1.1.1.1
Feb 23 06:15:34.811: ICMP: echo reply sent, src 17.17.2.2, dst 1.1.1.1

pingが成功しない理由は、R2のルーティングテーブルに1.1.1.1が載っていないからです。

R2#show ip route 1.1.1.1
% Network not in table

ここでR1のEIGRPでF0/1を有効にします。

R1(config)#router eigrp 100
R1(config-router)#network 1.1.1.1 0.0.0.0

これによりR2のルーティングテーブルに1.1.1.1が載りました。

R2#show ip route 1.1.1.1
Routing entry for 1.1.1.0/24
  Known via "eigrp 100", distance 90, metric 30720, type internal
〜略〜

先程のpingが無事実行出来ます。

R1#ping 17.17.2.2 source fastEthernet 0/1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 17.17.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/8/12 ms

このように、pingが通らない時にはping sourceとdebug ip icmpを利用することで問題点を見つけやすくなります。

カテゴリ:

CCIEの勉強を始めた当初、どつぼに嵌まったのがRIPでのpassive-interfaceの利用方法でした。INEのワークブックを利用していたのですが、RIPの設定で片方のルータにはpassive-interfaceの設定があるにもかかわらず、もう片方にはその設定がないのです。初めは誤植かと思い、INEの掲示板を見ましたが間違ってはいないようでした。そしてしばらくしてやっと理解できたのです…。

ではまずpassive-interfaceコマンドが必要な例です。R2はF0/0でR1に接続され、S1/2でR3に接続されています。そしてR1とのみRIPを利用するとします。

R2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            172.16.12.2     YES manual up                    up
Serial1/2                  172.16.23.2     YES manual up                    up

R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 172.16.12.2

まずここでのポイントはnetworkコマンドです。RIPではOSPFなどと違い、IPアドレスを指定しても意味がありません。自動的にネットワークアドレスに変換されてしまいます。

R2#show running-config | section rip
router rip
version 2
network 172.16.0.0
no auto-summary

上記のコマンドにより、F0/0だけを有効にしたつもりが結果的にS1/2もRIPを流すという設定になってしまうことが分かります。

R2#show ip protocols
Routing Protocol is "rip"
〜略〜
    Interface             Send  Recv  Triggered RIP  Key-chain
    FastEthernet0/0       2     2
    Serial1/2             2     2
〜略〜
  Routing for Networks:
    172.16.0.0
〜略〜

debugコマンドを実行することで両方のインターフェイスからRIPが流れることが確認できます。

R2#debug ip rip
RIP protocol debugging is on

Feb 16 07:34:44.627: RIP: sending v2 update to 224.0.0.9 via Serial1/2 (172.16.23.2)
Feb 16 07:34:44.631: RIP: build update entries
Feb 16 07:34:44.631:    172.16.12.0/24 via 0.0.0.0, metric 1, tag 0
Feb 16 07:34:48.311: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.12.2)
Feb 16 07:34:48.315: RIP: build update entries
Feb 16 07:34:48.315:    172.16.23.0/24 via 0.0.0.0, metric 1, tag 0

ここでpassive-interfaceの設定を加えます。するとF0/0のみからRIPが流れるようになります。

R2(config)#router rip
R2(config-router)#passive-interface serial 1/2

Feb 16 07:36:10.367: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.12.2)
Feb 16 07:36:10.371: RIP: build update entries
Feb 16 07:36:10.371:    172.16.23.0/24 via 0.0.0.0, metric 1, tag 0
Feb 16 07:36:39.751: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.12.2)
Feb 16 07:36:39.755: RIP: build update entries
Feb 16 07:36:39.755:    172.16.23.0/24 via 0.0.0.0, metric 1, tag 0

次にpassive-interfaceが不要な例です。S1/2のIPアドレスを変更しました。

R2#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            172.16.12.2     YES manual up                    up
Serial1/2                  192.168.23.2    YES manual up                    up

先程と全く同じRIPの設定を行います。

R2(config)#no router rip
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 172.16.12.2

debugを確認するとRIPが流れているのはF0/0だけであることが分かります。

Feb 16 07:45:29.639: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.12.2)
Feb 16 07:45:29.643: RIP: build update entries - suppressing null update
Feb 16 07:45:58.779: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.12.2)
Feb 16 07:45:58.783: RIP: build update entries - suppressing null update

R2#show ip protocols
Routing Protocol is "rip"
〜略〜
    Interface             Send  Recv  Triggered RIP  Key-chain
    FastEthernet0/0       2     2
〜略〜
  Routing for Networks:
    172.16.0.0
〜略〜

なぜpassive-interfaceがなくても、S1/2は対象にならないのでしょうか。それはS1/2に設定されているIPアドレスが異なるネットワーク(192.168.23.0)だからです。当たり前と言えばあまりに当たり前の単純なことですが、passive-interfaceを入れないと意図しないインターフェイスからパケットが流れてしまうという考えに固執している間は中々気づけませんでした。独学の辛いところです。

passive-interfaceを多くのインターフェイスに設定する必要がある場合は、先ずpassive-interface defaultとして全てを無効にし、その後no passive-interfaceで利用するインターフェイスを有効にすると便利です。

R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#passive-interface default
R2(config-router)#no passive-interface fastEthernet 0/0

French Laundryを予約する方法

カテゴリ:

Frenchアメリカで最高のレストランとか、最も予約が取れないレストランと称されるThe French Laundry。幸いなことに無事、予約が取れて訪れることが出来ました。

まず予約方法ですが、正当法としては直接電話するとOpenTableを利用するの二つがあります。

初めは当然のことながらOpenTableで予約を試みましたが、まったく空きが出ません。ここまで空席がないのは初体験で、システムエラーかとも思いましたが、日を変えて何度も試ても結局無駄手間でした。

次は結果的に成功した、直接電話する方法。予約は2ヶ月前の10:00-17:30(太平洋標準時)の間、受け付けています。開始直後の10時に、国際電話をしてみましたが話し中で全くつながりません…。しばらくして現地の夕方にかけ直したらつながりました。

ということで、直接電話がもっとも確実と思われます。ただこの二つ以外の予約方法も色々と研究されているようです。

Restaurant Review: The French Laundry, Yountville

さて無事に予約の日になり、レストランに到着しました。あちこちに書いてあるように、非常に地味で小さな建物です。もとは洗濯屋さんだったとか。

メニューは通常のコースか、ベジタリアンのコースのみ。全部で9皿で、一部分は選択できます。全て繊細な味付けと盛り付け。全米一を実感しました。皿数が多いため、3時間ほどかかります。

そしてここは料理だけでなく、ワインリストもすごい。フランスの三つ星などに行けば当然ながらワインは充実していますが、フランス産が中心です(当たり前ですが)。そしてアメリカの高級レストランではフランス産もアメリカ産も充実している店が多いのですが、ここのリストは半端ではない。

カリフォルニア産で入手困難らしい、Screaming Eagle, Harlan Estate, Dalla Valleなどがあり、フランス産もPetrus, Romane-Conti, 5大シャトーなどの有名どころがヴィンテージ違いでゴロゴロあります。なかなか手に入らないワインを飲みに行くという考えで行く人も多いのかもしれません。ちなみに隣に座っていたアメリカ人6人組(多分夫婦3組)はこれでもかというくらいに赤ワインを開けていました。人事ながら、いくらになったのか気になります…。

このレストランはサンフランシスコ市内からだと車で1時間以上はかかるので、ナパに泊まってタクシーなどで行くことをお勧めします。

アメリカの本屋さんの料理コーナーでは、シェフ Thomas Kellerさんの本が大人気のようでした。

The Essential Thomas Keller: The French Laundry Cookbook / Ad Hoc at Home

カテゴリ:

IOSで利用するコマンドの多くは省略した形で利用できます。例えば"show running-config"は"sh run"に、"configure terminal"は"conf t"で代用できます。この省略形に馴れることで入力の手間を大幅に減らすことが出来ます。

もう一つ便利な方法にdoコマンドがあります。通常、設定以後はshowコマンドで設定を確認しますが、特権モードに戻るのが手間です。しかしdoコマンドを使えば、設定中のモードでそのままshowコマンドなどを実行できます。例えば"do sh run"の様に実行します。

下記はripの設定を認証を含め設定しています。まず全く省略せず、doコマンドを使わない例です。

R1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.12.1    YES manual up                    up      
FastEthernet0/1            unassigned      YES unset  administratively down down   
Serial1/0                  unassigned      YES unset  administratively down down   
Serial1/1                  unassigned      YES unset  administratively down down   
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
Loopback0                  192.168.1.1     YES manual up                    up      
R1#configure terminal
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.12.1
R1(config-router)#network 192.168.1.1
R1(config-router)#^Z
R1#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 16 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    FastEthernet0/0       2     2                    RIP            
    Loopback0             2     2                                    
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    192.168.1.0
    192.168.12.0
  Routing Information Sources:
  1  Gateway         Distance      Last Update
    192.168.12.2         120      00:00:15
  Distance: (default is 120)

R1#configure terminal
R1(config)#key chain RIP
R1(config-keychain)#key 1
R1(config-keychain-key)#key-string CISCO
R1(config-keychain-key)#^Z
R1#show key chain RIP
Key-chain RIP:
    key 1 -- text "CISCO"
        accept lifetime (always valid) - (always valid) [valid now]
        send lifetime (always valid) - (always valid) [valid now]

R1#configure terminal
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip rip authentication key-chain RIP
R1(config-if)#ip rip authentication mode md5
R1(config-if)#^Z
R1#debug ip rip
RIP protocol debugging is on

Feb  4 05:57:23.275: RIP: received packet with MD5 authentication
Feb  4 05:57:23.275: RIP: received v2 update from 192.168.12.2 on FastEthernet0/0
Feb  4 05:57:23.279:      192.168.2.0/24 via 0.0.0.0 in 1 hops
〜略〜

R1#show ip rou rip
R    192.168.2.0/24 [120/1] via 192.168.12.2, 00:00:08, FastEthernet0/0

次に省略形とdoコマンドを併用する例です。大幅に簡略化され、高速に実行出来ることが理解できると思います。

R1#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
〜略〜
R1#conf t
R1(config)#router rip
R1(config-router)#no au
R1(config-router)#ver 2
R1(config-router)#net 192.168.12.1
R1(config-router)#net 192.168.1.1
R1(config-router)#do sh ip pro
Routing Protocol is "rip"
〜略〜
R1(config-router)#key ch RIP
R1(config-keychain)#ke 1
R1(config-keychain-key)#key-s CISCO
R1(config-keychain-key)#do sh ke ch RIP
Key-chain RIP:
〜略〜
R1(config-if)#ip rip aut ke RIP
R1(config-if)#ip rip aut m m
R1(config-if)#do deb ip rip
R1(config-if)#do sh ip rou rip
R    192.168.2.0/24 [120/1] via 192.168.12.2, 00:00:13, FastEthernet0/0

カテゴリ:

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を実行するなどということが出来るようになります。

このページのトップヘ

見出し画像
×