Tuesday, January 6, 2009

Understanding OSPF....

After going through ospf, and to properly understand some concepts, I hit the intanet looking for pre-done dynamips labs:-) to save on time. during my cyber walk, I came across the article
Configuring Basic OSPF (Dynamips). It was excellent and had a very well detailed instruction on things.

However one of the requirements for the lab was:

That the ISP router always be the DR, one of the Remote sites always be a BDR and one remote site never participates in the election process. (Please go to evilrouters.net) for the diagram and full article - but it looks something like below all routers connected through switches.

Remote1===\
======ISP
Remote2===/

I redid the whole lab with emphasis on meeting the designated router (DR)/backup designated router (BDR) requirements
Configurations:

ISP#sh ip int br | exclude un
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.10.10.1 YES manual up up
Loopback0 188.46.37.254 YES manual up up

------
Remote1#sh ip int br | ex una
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.10.10.3 YES manual up up
Loopback0 192.168.1.1 YES manual up up
Loopback1 192.168.1.161 YES manual up up
-------
Remote2#sh ip int br | ex una
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.10.10.2 YES manual up up
Loopback0 192.168.1.65 YES manual up up
Loopback1 192.168.1.129 YES manual up up

After bringing up the interfaces, I tested connectivity as evilrouter dude had done it - well almost:-):

ISP#tclsh
ISP(tcl)#for
ISP(tcl)#forea
ISP(tcl)#foreach address {
+>10.10.10.2
+>10.10.10.3
+>} {ping $address}

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 32/58/96 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 16/45/88 ms
ISP(tcl)#

Now we get OSPF going, just as he had done it, I'll just show the neighbors here:

ISP#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
192.168.1.129 1 FULL/BDR 00:00:34 10.10.10.2 FastEthernet0/0
192.168.1.161 1 FULL/DROTHER 00:00:38 10.10.10.3 FastEthernet0/0
------
Remote1#sh ip ospf ne

Neighbor ID Pri State Dead Time Address Interface
188.46.37.254 1 FULL/DR 00:00:31 10.10.10.1 FastEthernet0/0
192.168.1.129 1 FULL/BDR 00:00:39 10.10.10.2 FastEthernet0/0
-----
Remote2#sh ip ospf ne

Neighbor ID Pri State Dead Time Address Interface
188.46.37.254 1 FULL/DR 00:00:39 10.10.10.1 FastEthernet0/0
192.168.1.161 1 FULL/DROTHER 00:00:31 10.10.10.3 FastEthernet0/0

-we have proper basic ospf

Since Im interested in the DR/BDR, I'll skip the details here since the original
post
at evilrouters.net still has them.

lets go over the requirements again in proper detail for clarity:
1: ISP - 10.10.10.1 will always be the DR
2: Remote1 - 10.10.10.3 will always be the BDR
3: remote2 - never participates in an election.
Remote2 is easy:

Remote2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Remote2(config)#interface fastethernet 0/0
Remote2(config-if)#ip ospf priority 0
Remote2(config-if)#


ISP is also easy:

ISP(config)#interface fastethernet 0/0
ISP(config-if)#ip ospf priority ?
<0-255> Priority
ISP(config-if)#ip ospf priority 255

The neighbors currently look like this:

ISP#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
ISP#sh ip ospf ne

Neighbor ID Pri State Dead Time Address Interface
10.10.10.2 0 FULL/DROTHER 00:00:32 10.10.10.2 FastEthernet0/0
10.10.10.3 1 FULL/DR 00:00:35 10.10.10.3 FastEthernet0/0
-------
Remote1#sh ip ospf ne

Neighbor ID Pri State Dead Time Address Interface
10.10.10.1 255 FULL/BDR 00:00:36 10.10.10.1 FastEthernet0/0
10.10.10.2 0 FULL/DROTHER 00:00:38 10.10.10.2 FastEthernet0/0
-------
Remote2#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
10.10.10.1 255 FULL/BDR 00:00:33 10.10.10.1 FastEthernet0/0
10.10.10.3 1 FULL/DR 00:00:38 10.10.10.3 FastEthernet0/0


so according to the above output:

10.10.10.2 - is fine, it won't participate in the election process.

Note:
Immediately something is wrong with the BDR/DR election . Since I reset the Remote2 OSPF process first, it got to be DR first and the ISP router had to be the BDR. That I'm sure starts to make my point but, just to ensure we go through all the evil router guy's/guyette's??:-) steps: I'll go ahead and change the priority of the RemoteRouter to 254 and clear the ISP router's ospf process first - !so it gets to be DR, followed by the others and the output is as follows:

ISP#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
10.10.10.2 0 FULL/DROTHER 00:00:30 10.10.10.2 FastEthernet0/0
10.10.10.3 254 FULL/BDR 00:00:34 10.10.10.3 FastEthernet0/0
-------
Remote1#sh ip ospf ne

Neighbor ID Pri State Dead Time Address Interface
10.10.10.1 255 FULL/DR 00:00:32 10.10.10.1 FastEthernet0/0
10.10.10.2 0 FULL/DROTHER 00:00:34 10.10.10.2 FastEthernet0/0
-------
Remote2#sh ip ospf ne

Neighbor ID Pri State Dead Time Address Interface
10.10.10.1 255 FULL/DR 00:00:30 10.10.10.1 FastEthernet0/0
10.10.10.3 254 FULL/BDR 00:00:36 10.10.10.3 FastEthernet0/0

However, If I now reset the ISP router's ospf interface, or if the link to the ISP were to go off:

Remote1#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
10.10.10.2 0 FULL/DROTHER 00:00:38 10.10.10.2 FastEthernet0/0

Remote2#
*Mar 1 01:06:44.087: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.10.1 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expiredsh ip ospf ne

Neighbor ID Pri State Dead Time Address Interface
10.10.10.3 254 FULL/DR 00:00:39 10.10.10.3 FastEthernet0/0

So now we have a situation where the former BDR was upgraded to DR. The reason I think your requirement for the ISP to always be a BDR cant be met with
this configuration is so long as there's a BDR that gets upgraded to a DR and no pre-emption happens, then your ISP will always be either a DR or BDR even
under normal circumstances. The priority only kicks in if the processes are reset at the same time.

Here's the output after bringing up the ISP router.


ISP(config-if)#
*Mar 1 01:12:17.647: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 01:12:18.647: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
*Mar 1 01:12:25.631: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.10.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
*Mar 1 01:12:25.719: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.10.3 on FastEthernet0/0 from LOADING to FULL, Loading Done
ISP(config-if)#do sh ip ospf ne

Neighbor ID Pri State Dead Time Address Interface
10.10.10.2 0 FULL/DROTHER 00:00:37 10.10.10.2 FastEthernet0/0
10.10.10.3 254 FULL/DR 00:00:34 10.10.10.3 FastEthernet0/0

ISP#sh ip ospf interface f0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 10.10.10.1/29, Area 0
Process ID 1, Router ID 10.10.10.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State BDR, Priority 255
Designated Router (ID) 10.10.10.3, Interface address 10.10.10.3
Backup Designated router (ID) 10.10.10.1, Interface address 10.10.10.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:05
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 4 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 10.10.10.2
Adjacent with neighbor 10.10.10.3 (Designated Router) !<<<------ note the DR!
Suppress hello for 0 neighbor(s)

So the question is, how do you ensure that a router is always a BDR? Is that even possible? How to go about it?

Lastly, many thanks to whoever runs http://evilrouters.net for this article

1 comment: