Wednesday, March 21, 2012

OSPF - Router ID

In OSPF you can not have devices with duplicate router ID's. In the hello message there is a field that indicated the router ID, two devices with the same router ID with now form a neighborship. However, it does not mean that two devices with the same router ID cannot form a neighborship with another device. When you have two devices with the same ID it confuses the other device because of the way the topology database flooding works.

We will use diagram 1 for this write up.

On R3, you can see it's happy and has a neighborship with its peers. Routes looks good as well.

R3#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1          10   FULL/DR         00:00:39    192.168.10.1    FastEthernet0/0
2.2.2.2           1   FULL/DROTHER    00:00:30    192.168.10.2    FastEthernet0/0
R3#
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     100.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O       100.100.100.1/32 [110/2] via 192.168.10.1, 00:00:04, FastEthernet0/0
C       100.100.103.0/24 is directly connected, Loopback103
O       100.100.102.1/32 [110/2] via 192.168.10.2, 00:00:04, FastEthernet0/0
C    192.168.10.0/24 is directly connected, FastEthernet0/0
R1#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/DROTHER    00:00:33    192.168.10.2    FastEthernet0/0
3.3.3.3           1   FULL/BDR        00:00:32    192.168.10.3    FastEthernet0/0
R1#

Now we are going to change the router id on R2 to be 1.1.1.1 like R1 and see what happens. We are also going to turn on debugging R1#debug ip ospf adj


R1 Start complaining about a duplicate router ID.
R1#
*Mar  1 00:36:42.675: OSPF: Rcv LS UPD from 2.2.2.2 on FastEthernet0/0 length 76 LSA count 1
*Mar  1 00:36:42.731: %OSPF-4-DUP_RTRID_NBR: OSPF detected duplicate router-id 1.1.1.1 from 192.168.10.2 on interface FastEthernet0/0
Even though the routers have duplicate ID's R3 still forms a neighborship.

R3#show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1          10   FULL/DR         00:00:39    192.168.10.1    FastEthernet0/0
1.1.1.1           1   FULL/DROTHER    00:00:38    192.168.10.2    FastEthernet0/0
R3#
The routing table is only displaying routes from R1 and not R2. This could happen in reverse, it depends which neighbor comes up first. Eventually that route will disappear, its not a good situation.

R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O       100.100.100.1/32 [110/2] via 192.168.10.1, 00:00:07, FastEthernet0/0
C       100.100.103.0/24 is directly connected, Loopback103
C    192.168.10.0/24 is directly connected, FastEthernet0/0
Checking the OSPF database for router ID 1.1.1.1. This further confirms that you need to have unique router id's because of how the OSPF database flooding works.

R3#show ip ospf database router 1.1.1.1
            OSPF Router with ID (3.3.3.3) (Process ID 1)
                Router Link States (Area 0)
  Adv Router is not-reachable
  LS age: 5
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000056
  Checksum: 0x8429
  Length: 48
  Number of Links: 2
    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 100.100.100.1
     (Link Data) Network Mask: 255.255.255.255
      Number of TOS metrics: 0
       TOS 0 Metrics: 1
    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.10.1
     (Link Data) Router Interface address: 192.168.10.2
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

No comments:

Post a Comment