OSPF router-idやneighbor確認




検証内容
・router-idの確認など




下記の状態からスタート。
DR選出を確認するため、inteface で ip ospf network broadcast を設定してます。

R1
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface Serial1/0
 ip address 192.168.0.1 255.255.255.252
 ip ospf network broadcast
!
router ospf 1
 network 1.1.1.1 0.0.0.0 area 0
 network 192.168.0.0 0.0.0.3 area 0

R2
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Serial1/0
 ip address 192.168.0.2 255.255.255.252
 ip ospf network broadcast
!
router ospf 1
 network 2.2.2.2 0.0.0.0 area 0
 network 192.168.0.0 0.0.0.3 area 0
sh ip ospf neighbor を見ると、R1 がDR選出されていることがわかります。

R1#sh ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.2       1   FULL/DR         00:00:34    192.168.0.2     Serial1/0

sh ip ospf で自分のrouter-idが確認できます。
R2 の loopback アドレスのほうが強いので、R2がDRに選出されました。

R1#sh ip ospf
 Routing Process "ospf 1" with ID 1.1.1.1
 Start time: 00:02:34.440, Time elapsed: 00:05:34.416
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 Supports area transit capability
 Router is not originating router-LSAs with maximum metric
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs

ここで R1 の router-id を手動で変更してみます。

R1(config-router)#router-id 99.99.99.99
Reload or use "clear ip ospf process" command, for this to take effect
R1(config-router)#
R1#clear ip ospf
*Jul 11 23:30:37.583: %SYS-5-CONFIG_I: Configured from console by console pro
R1#clear ip ospf process
Reset ALL OSPF processes? [no]: y
R1#
*Jul 11 23:30:42.919: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.0.2 on Serial1/0 fr
om FULL to DOWN, Neighbor Down: Interface down or detached
R1#sh ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.2       1   2WAY/DROTHER    00:00:37    192.168.0.2     Serial1/0
R1#
*Jul 11 23:31:24.707: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.0.2 on Serial1/0 fr
om LOADING to FULL, Loading Done
clear ip ospf process をしないと効果ないよとのことなので、clear しました。

R1#sh ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.2       1   FULL/DR         00:00:38    192.168.0.2     Serial1/0
R1#
R1#
R1#sh ip ospf
 Routing Process "ospf 1" with ID 99.99.99.99
 Start time: 00:02:34.440, Time elapsed: 00:12:10.836
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
ですが、まだ R2 が DR のまま。router-id は99.99.99.99 に変わってますね。
いったんDRになったルータに問題が生じるまではDRが変わることはないらしい。
NWが不安定にならないようにとのことっす。
ということで、R2に問題を生じさせてみましょう。 R2にて clear ip ospf process してみました。

R2#clear ip ospf ?
  <1-65535>       Process ID number
  counters        OSPF counters
  process         Reset OSPF process
  redistribution  Clear OSPF route redistribution
  traffic         Traffic related statistics

R2#clear ip ospf process
Reset ALL OSPF processes? [no]: y
R2#
*Jul 11 23:39:55.115: %OSPF-5-ADJCHG: Process 1, Nbr 99.99.99.99 on Serial1/0 fr
om FULL to DOWN, Neighbor Down: Interface down or detached
*Jul 11 23:39:55.523: %OSPF-5-ADJCHG: Process 1, Nbr 99.99.99.99 on Serial1/0 fr
om LOADING to FULL, Loading Done

やっとR1 がDRとなりました。

R1#sh ip ospf inter
Serial1/0 is up, line protocol is up
  Internet Address 192.168.0.1/30, Area 0
  Process ID 1, Router ID 99.99.99.99, Network Type BROADCAST, Cost: 64
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 99.99.99.99, Interface address 192.168.0.1
  Backup Designated router (ID) 192.168.0.2, Interface address 192.168.0.2