カテゴリ:

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