RIP passive-interface と neighbor について




検証内容
・passive-interface でアドバタイズされないことを確認
・neighbor コマンドでユニキャストでアドバタイズされることを確認



下記の状態からスタート

R1
interface Loopback0
 ip address 10.1.1.1 255.255.255.255
!
interface Serial1/0
 ip address 10.0.1.1 255.255.255.0
!
router ospf 1
 network 10.1.1.1 0.0.0.0 area 0
 network 10.0.1.1 0.0.0.0 area 0

R2
interface Loopback0
 ip address 20.2.2.2 255.255.255.255
!
interface Serial1/0
 ip address 10.0.1.2 255.255.255.0
!
interface Serial1/1
 ip address 10.0.2.2 255.255.255.0
!
router ospf 1
 network 20.2.2.2 0.0.0.0 area 0
 network 10.0.1.2 0.0.0.0 area 0

router rip
version 2
net 10.0.0.0
no auto-summary

R3
interface Loopback0
 ip address 30.3.3.3 255.255.255.255
!
interface Serial1/1
 ip address 10.0.2.3 255.255.255.0

router rip
version 2
net 10.0.0.0
net 30.0.0.0
no auto-summary

再配送は必要なさそうなのでとりあえずしません。
まず基本がわかってないのですが、、R2 で network 10.0.0.0 とやると
s1/0,s1/1 でRIPが有効となってしまいますが、network 10.0.2.0 となると
s1/1 だけで有効とならないのか?という疑問から検証してみる。

いきなり答えですが、network 10.0.2.0 とやっても sh ip protocols は
下記のようになりどちらのインターフェースでも有効となります。
RIPはサブネット使えないんですたっけ。

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 9 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
    Serial1/0             2     2
    Serial1/1             2     2
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.0.2.3             120      00:00:15
  Distance: (default is 120)
ということで s1/0 で RIPを有効としないためには、

router rip
passive-interface s1/0

としてやります。

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 9 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
    Serial1/1             2     2
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.0.2.3             120      00:00:15
  Distance: (default is 120)

なかんじで、s1/1 のみで有効になりました。

次にRIPアドバタイズをユニキャストで行いたい人のための設定。

まずは上記の状態で debug ip rip を取得してみます。


*Jul 29 06:29:03.871: RIP: build update entries
*Jul 29 06:29:03.871:   10.0.1.0/24 via 0.0.0.0, metric 1, tag 0
*Jul 29 06:29:27.887: RIP: received v2 update from 10.0.2.3 on Serial1/1
*Jul 29 06:29:27.887:      30.3.3.3/32 via 0.0.0.0 in 1 hops
*Jul 29 06:29:32.459: RIP: sending v2 update to 224.0.0.9 via Serial1/1 (10.0.2.2)
*Jul 29 06:29:32.463: RIP: build update entries
*Jul 29 06:29:32.463:   10.0.1.0/24 via 0.0.0.0, metric 1, tag 0
*Jul 29 06:29:55.311: RIP: received v2 update from 10.0.2.3 on Serial1/1
*Jul 29 06:29:55.315:      30.3.3.3/32 via 0.0.0.0 in 1 hops
*Jul 29 06:29:59.327: RIP: sending v2 update to 224.0.0.9 via Serial1/1 (10.0.2.2)
*Jul 29 06:29:59.331: RIP: build update entries

RIP のアドバタイズ用マルチキャストアドレス(224.0.0.9) が使われていますね。
ここで neighbor 10.0.2.3 を入れるとどうなるか。


*Jul 29 06:33:35.915: RIP: received v2 update from 10.0.2.3 on Serial1/1
*Jul 29 06:33:35.919:      30.3.3.3/32 via 0.0.0.0 in 1 hops
*Jul 29 06:33:35.923: RIP: received v2 update from 10.0.2.3 on Serial1/1
*Jul 29 06:33:35.927:      30.3.3.3/32 via 0.0.0.0 in 1 hops
*Jul 29 06:33:45.955: RIP: sending v2 update to  224.0.0.9  via Serial1/1 (10.0.2.2)
*Jul 29 06:33:45.959: RIP: build update entries
*Jul 29 06:33:45.959:   10.0.1.0/24 via 0.0.0.0, metric 1, tag 0
*Jul 29 06:33:45.963: RIP: sending v2 update to 10.0.2.3 via Serial1/1 (10.0.2.2)
*Jul 29 06:33:45.967: RIP: build update entries
*Jul 29 06:33:45.967:   10.0.1.0/24 via 0.0.0.0, metric 1, tag 0
*Jul 29 06:34:01.911: RIP: received v2 update from 10.0.2.3 on Serial1/1
*Jul 29 06:34:01.915:      30.3.3.3/32 via 0.0.0.0 in 1 hops
*Jul 29 06:34:01.915: RIP: received v2 update from 10.0.2.3 on Serial1/1
*Jul 29 06:34:01.919:      30.3.3.3/32 via 0.0.0.0 in 1 hops
*Jul 29 06:34:15.459: RIP: sending v2 update to  224.0.0.9  via Serial1/1 (10.0.2.2)
*Jul 29 06:34:15.463: RIP: build update entries
*Jul 29 06:34:15.463:   10.0.1.0/24 via 0.0.0.0, metric 1, tag 0
*Jul 29 06:34:15.467: RIP: sending v2 update to 10.0.2.3 via Serial1/1 (10.0.2.2
)

ユニキャストでもアドバタイズされましたが、マルチキャストも残っています。。
これは passive-inteface となっていないインターフェースからはマルチキャストを送る実装に
なっているためと思います。

で、passive interface s1/1 もやります。


*Jul 29 06:39:18.635: RIP: build update entries
*Jul 29 06:39:18.635:   10.0.1.0/24 via 0.0.0.0, metric 1, tag 0
*Jul 29 06:39:38.147: RIP: received v2 update from 10.0.2.3 on Serial1/1
*Jul 29 06:39:38.151:      30.3.3.3/32 via 0.0.0.0 in 1 hops
*Jul 29 06:39:47.195: RIP: sending v2 update to 10.0.2.3 via Serial1/1 (10.0.2.2)
*Jul 29 06:39:47.199: RIP: build update entries
*Jul 29 06:39:47.199:   10.0.1.0/24 via 0.0.0.0, metric 1, tag 0
*Jul 29 06:40:05.839: RIP: received v2 update from 10.0.2.3 on Serial1/1
*Jul 29 06:40:05.843:      30.3.3.3/32 via 0.0.0.0 in 1 hops
*Jul 29 06:40:15.255: RIP: sending v2 update to 10.0.2.3 via Serial1/1 (10.0.2.2)
*Jul 29 06:40:15.259: RIP: build update entries
*Jul 29 06:40:15.259:   10.0.1.0/24 via 0.0.0.0, metric 1, tag 0
*Jul 29 06:40:32.827: RIP: received v2 update from 10.0.2.3 on Serial1/1
*Jul 29 06:40:32.831:      30.3.3.3/32 via 0.0.0.0 in 1 hops
*Jul 29 06:40:41.795: RIP: sending v2 update to 10.0.2.3 via Serial1/1 (10.0.2.2)

これでユニキャストだけでアドバタイズされるようになりました。めでたし。
ちなみに passive-interface default ってやると全インターフェースでマルチキャストが
アドバタイズされなくなりますよっと。

更新日:2012/7/29