OSPF Configuration Part 3 : Conifguring R3 & R4


R3 Configuration
Let’s configure R3 interfaces with the OSPF protocol and see the effect it has on R1 and R2 routing tables and as well as the link state database

vyatta@r3:~$ show ip ospf interface
eth0 is up
ifindex 2, MTU 1500 bytes, BW 0 Kbit <UP,BROADCAST,RUNNING,MULTICAST>
Internet Address 10.10.10.3/24, Broadcast 10.10.10.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 127.3.3.3, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 127.3.3.3, Interface Address 10.10.10.3
Backup Designated Router (ID) 127.1.1.1, Interface Address 10.10.10.1
Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 0.165s
Neighbor Count is 2, Adjacent neighbor count is 2
eth1 is up
ifindex 3, MTU 1500 bytes, BW 0 Kbit <UP,BROADCAST,RUNNING,MULTICAST>
Internet Address 20.20.20.3/24, Broadcast 20.20.20.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 127.3.3.3, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 127.3.3.3, Interface Address 20.20.20.3
Backup Designated Router (ID) 127.2.2.2, Interface Address 20.20.20.2
Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 0.474s
Neighbor Count is 1, Adjacent neighbor count is 1
lo is up
ifindex 1, MTU 16436 bytes, BW 0 Kbit <UP,LOOPBACK,RUNNING>
Internet Address 127.3.3.3/24, Broadcast 127.3.3.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 127.3.3.3, Network Type LOOPBACK, Cost: 10
Transmit Delay is 1 sec, State Loopback, Priority 1
No designated router on this network
No backup designated router on this network
Multicast group memberships: <None>
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in inactive
Neighbor Count is 0, Adjacent neighbor count is 0


Latest changes : because a change of network we have DR & BDR re-election taking place, and since all routers have same priorities the router with the highest IP which would be R3 is chosen as DR and the next candidate for BDR remains R1 and Neighbor Count on eth0 is 2 which would be R2 and R1 and oneth1 is 1 which would only be R2 (the number of OSPF neighbor routers),Adjacent neighbor count is 2(the number of DR&BDR neighbors).


vyatta@r1:~$ show ip ospf interface
eth0 is up
ifindex 2, MTU 1500 bytes, BW 0 Kbit <UP,BROADCAST,RUNNING,MULTICAST>
Internet Address 10.10.10.1/24, Broadcast 10.10.10.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 127.1.1.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State Backup, Priority 1
Designated Router (ID) 127.3.3.3, Interface Address 10.10.10.3
Backup Designated Router (ID) 127.1.1.1, Interface Address 10.10.10.1
Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 6.046s
Neighbor Count is 2, Adjacent neighbor count is 2
lo is up
ifindex 1, MTU 16436 bytes, BW 0 Kbit <UP,LOOPBACK,RUNNING>
Internet Address 127.1.1.1/24, Broadcast 127.1.1.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 127.1.1.1, Network Type LOOPBACK, Cost: 10
Transmit Delay is 1 sec, State Loopback, Priority 1
No designated router on this network
No backup designated router on this network
Multicast group memberships: <None>
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in inactive
Neighbor Count is 0, Adjacent neighbor count is 0

vyatta@r2:~$ show ip ospf interface
eth0 is up
ifindex 2, MTU 1500 bytes, BW 0 Kbit <UP,BROADCAST,RUNNING,MULTICAST>
Internet Address 10.10.10.2/24, Broadcast 10.10.10.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 127.2.2.2, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DROther, Priority 1
Designated Router (ID) 127.3.3.3, Interface Address 10.10.10.3
Backup Designated Router (ID) 127.1.1.1, Interface Address 10.10.10.1
Multicast group memberships: OSPFAllRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 6.995s
Neighbor Count is 2, Adjacent neighbor count is 2
eth1 is up
ifindex 3, MTU 1500 bytes, BW 0 Kbit <UP,BROADCAST,RUNNING,MULTICAST>
Internet Address 20.20.20.2/24, Broadcast 20.20.20.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 127.2.2.2, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State Backup, Priority 1
Designated Router (ID) 127.3.3.3, Interface Address 20.20.20.3
Backup Designated Router (ID) 127.2.2.2, Interface Address 20.20.20.2
Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 7.583s
Neighbor Count is 1, Adjacent neighbor count is 1
lo is up
ifindex 1, MTU 16436 bytes, BW 0 Kbit <UP,LOOPBACK,RUNNING>
Internet Address 127.2.2.2/24, Broadcast 127.2.2.255, Area 0.0.0.0
MTU mismatch detection:enabled
Router ID 127.2.2.2, Network Type LOOPBACK, Cost: 10
Transmit Delay is 1 sec, State Loopback, Priority 1
No designated router on this network
No backup designated router on this network
Multicast group memberships: <None>
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in inactive
Neighbor Count is 0, Adjacent neighbor count is 0

vyatta@r1:~$ show ip ospf database
OSPF Router with ID (127.1.1.1)
Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum Link count
127.1.1.1 127.1.1.1 310 0x80000009 0x0e52 2
127.2.2.2 127.2.2.2 306 0x8000000a 0xa816 3
127.3.3.3 127.3.3.3 301 0x80000006 0xd5e1 3
Net Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum
10.10.10.3 127.3.3.3 306 0x80000002 0xb763
20.20.20.3 127.3.3.3 306 0x80000001 0x780c



And finally our ospf database in general after configuring the ospf interfaces on R3, as you see we have 3 routers which have advertised their router-id these link state advertisements are router LSA’s namely type 1link state advertisements these advertisements describe the active links on each router and they are advertised by all of the ospf routers in the network, the other type of LSA entries are the network link state advertisements which in our case we only have 2 of them these advertisements are flooded across the network by DR’s (designated routers – in our case R3is the DR) and explain their links and attached neighbors.

R4 Configuration
Let’s configure R4 ethernet interfaces with the OSPF protocol and view its overall effect on our network

vyatta@r1:~$ show ip ospf database
OSPF Router with ID (127.1.1.1)
Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum Link count
127.1.1.1 127.1.1.1 258 0x8000000a 0x0c53 2
127.2.2.2 127.2.2.2 908 0x80000012 0x981e 3
127.3.3.3 127.3.3.3 907 0x8000000b 0xcbe6 3
127.4.4.4 127.4.4.4 903 0x8000000e 0x07f9 2
Net Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum
10.10.10.3 127.3.3.3 251 0x80000003 0xb564
20.20.20.3 127.3.3.3 907 0x80000006 0xbb34


R4ID has been added to the ospf database on R1 so advertisements are complete, R3 remained the DR, R1 has been chosen as the BDR in the10.10.10.0/24 network and R4 has been chosen as the BDR in the 20.20.20.0/24network, R2 is chosen to be the DROther whereas its nor a DR nor a BDR.


Let’s take a look at each router and the ospf neighbors they have encountered:

vyatta@r1:~$ show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL
127.2.2.2 1 Full/DROther 31.973s 10.10.10.2 eth0:10.10.10.1 0 0 0
127.3.3.3 1 Full/DR 31.756s 10.10.10.3 eth0:10.10.10.1 0 0 0


vyatta@r2:~$ show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL
127.1.1.1 1 Full/Backup 36.849s 10.10.10.1 eth0:10.10.10.2 0 0 0
127.3.3.3 1 Full/DR 34.139s 10.10.10.3 eth0:10.10.10.2 0 0 0
127.3.3.3 1 Full/DR 39.288s 20.20.20.3 eth1:20.20.20.2 0 0 0
127.4.4.4 1 Full/Backup 34.575s 20.20.20.4 eth1:20.20.20.2 0 0 0

vyatta@r3:~$ show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL
127.1.1.1 1 Full/Backup 33.286s 10.10.10.1 eth0:10.10.10.3 0 0 0
127.2.2.2 1 Full/DROther 30.804s 10.10.10.2 eth0:10.10.10.3 0 0 0
127.2.2.2 1 Full/DROther 34.260s 20.20.20.2 eth1:20.20.20.3 0 0 0
127.4.4.4 1 Full/Backup 31.012s 20.20.20.4 eth1:20.20.20.3 0 0 0


vyatta@r4:~$ show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL
127.2.2.2 1 Full/DROther 37.823s 20.20.20.2 eth0:20.20.20.4 0 0 0
127.3.3.3 1 Full/DR 39.270s 20.20.20.3 eth0:20.20.20.4 0 0 0


Let’s take a look at each routers routing table and the routes they have calculated:

vyatta@r2:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

O 10.10.10.0/24 [110/10] is directly connected, eth0, 00:40:12
C>* 10.10.10.0/24 is directly connected, eth0
O 20.20.20.0/24 [110/10] is directly connected, eth1, 00:40:05
C>* 20.20.20.0/24 is directly connected, eth1
O>* 127.1.1.1/32 [110/20] via 10.10.10.1, eth0, 00:39:57
C>* 127.2.2.0/24 is directly connected, lo
O>* 127.3.3.3/32 [110/20] via 10.10.10.3, eth0, 00:39:57
* via 20.20.20.3, eth1, 00:39:57
O>* 127.4.4.4/32 [110/20] via 20.20.20.4, eth1, 00:20:52


vyatta@r4:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

O>* 10.10.10.0/24 [110/20] via 20.20.20.2, eth0, 00:21:05
* via 20.20.20.3, eth0, 00:21:05
O 20.20.20.0/24 [110/10] is directly connected, eth0, 00:21:05
C>* 20.20.20.0/24 is directly connected, eth0
O>* 127.1.1.1/32 [110/30] via 20.20.20.2, eth0, 00:21:05
* via 20.20.20.3, eth0, 00:21:05
O>* 127.2.2.2/32 [110/20] via 20.20.20.2, eth0, 00:21:05
O>* 127.3.3.3/32 [110/20] via 20.20.20.3, eth0, 00:21:05
C>* 127.4.4.0/24 is directly connected, lo


vyatta@r3:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

O 10.10.10.0/24 [110/10] is directly connected, eth0, 00:41:09
C>* 10.10.10.0/24 is directly connected, eth0
O 20.20.20.0/24 [110/10] is directly connected, eth1, 00:40:48
C>* 20.20.20.0/24 is directly connected, eth1
O>* 127.1.1.1/32 [110/20] via 10.10.10.1, eth0, 00:40:53
O>* 127.2.2.2/32 [110/20] via 10.10.10.2, eth0, 00:40:48
* via 20.20.20.2, eth1, 00:40:48
C>* 127.3.3.0/24 is directly connected, lo
O>* 127.4.4.4/32 [110/20] via 20.20.20.4, eth1, 00:21:43

vyatta@r1:~$ show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

O 10.10.10.0/24 [110/10] is directly connected, eth0, 00:41:28
C>* 10.10.10.0/24 is directly connected, eth0
O>* 20.20.20.0/24 [110/20] via 10.10.10.2, eth0, 00:41:28
* via 10.10.10.3, eth0, 00:41:28
C>* 127.1.1.0/24 is directly connected, lo
O>* 127.2.2.2/32 [110/20] via 10.10.10.2, eth0, 00:41:28
O>* 127.3.3.3/32 [110/20] via 10.10.10.3, eth0, 00:41:28
O>* 127.4.4.4/32 [110/30] via 10.10.10.2, eth0, 00:22:22
* via 10.10.10.3, eth0, 00:22:22


Router LSA Database:

vyatta@r2:~$ show ip ospf database router
OSPF Router with ID (127.2.2.2)
Router Link States (Area 0.0.0.0)
LS age: 508
Options: 0x2 : *|-|-|-|-|-|E|*
LS Flags: 0x6
Flags: 0x0
LS Type: router-LSA
Link State ID: 127.1.1.1
Advertising Router: 127.1.1.1
LS Seq Number: 8000000a

Checksum has been incremented since our first configuration and has reached8000000a
Checksum: 0x0c53
Length: 48
Number of Links: 2

Eth0 is considered to be a transit network
Link connected to: a Transit Network
(Link ID) Designated Router address: 10.10.10.3
(Link Data) Router Interface address: 10.10.10.1

Number of TOS metrics: 0
TOS 0 Metric: 10

All loopback interfaces remain stub networks
Link connected to: Stub Network
(Link ID) Net: 127.1.1.1
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metric: 10


LS age: 1154
Options: 0x2 : *|-|-|-|-|-|E|*
LS Flags: 0x1
Flags: 0x0
LS Type: router-LSA
Link State ID: 127.2.2.2
Advertising Router: 127.2.2.2
LS Seq Number: 80000012
Checksum: 0x981e
Length: 60
Number of Links: 3

Number of active links connected to R2 and their detail; remember the fact of router LSA’s is so that they get to introduce themselves on the network
Link connected to: Stub Network
(Link ID) Net: 127.2.2.2
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metric: 10

Link connected to: a Transit Network
(Link ID) Designated Router address: 10.10.10.3
(Link Data) Router Interface address: 10.10.10.2
Number of TOS metrics: 0
TOS 0 Metric: 10

Link connected to: a Transit Network
(Link ID) Designated Router address: 20.20.20.3
(Link Data) Router Interface address: 20.20.20.2
Number of TOS metrics: 0
TOS 0 Metric: 10

LS age: 1155
Options: 0x2 : *|-|-|-|-|-|E|*
LS Flags: 0x6
Flags: 0x0
LS Type: router-LSA
Link State ID: 127.3.3.3
Advertising Router: 127.3.3.3
LS Seq Number: 8000000b
Checksum: 0xcbe6
Length: 60
Number of Links: 3

Link connected to: Stub Network
(Link ID) Net: 127.3.3.3
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metric: 10

Link connected to: a Transit Network
(Link ID) Designated Router address: 10.10.10.3
(Link Data) Router Interface address: 10.10.10.3
Number of TOS metrics: 0
TOS 0 Metric: 10

Link connected to: a Transit Network
(Link ID) Designated Router address: 20.20.20.3
(Link Data) Router Interface address: 20.20.20.3
Number of TOS metrics: 0
TOS 0 Metric: 10

LS age: 1150
Options: 0x2 : *|-|-|-|-|-|E|*
LS Flags: 0x6
Flags: 0x0
LS Type: router-LSA
Link State ID: 127.4.4.4
Advertising Router: 127.4.4.4
LS Seq Number: 8000000e
Checksum: 0x07f9
Length: 48
Number of Links: 2

Link connected to: Stub Network
(Link ID) Net: 127.4.4.4
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metric: 10

Link connected to: a Transit Network
(Link ID) Designated Router address: 20.20.20.3
(Link Data) Router Interface address: 20.20.20.4
Number of TOS metrics: 0
TOS 0 Metric: 10


Network LSA Database:

if you reckon network LSA were flooded by DR’s and introduced their links and neighbors.

vyatta@r2:~$ show ip ospf database network
OSPF Router with ID (127.2.2.2)
Net Link States (Area 0.0.0.0)

LS age: 529
Options: 0x2 : *|-|-|-|-|-|E|*
LS Flags: 0x6
LS Type: network-LSA
Link State ID: 10.10.10.3 (address of Designated Router)
Advertising Router: 127.3.3.3
LS Seq Number: 80000003
Checksum: 0xb564
Length: 36
Network Mask: /24
Attached Router: 127.1.1.1
Attached Router: 127.2.2.2
Attached Router: 127.3.3.3

LS age: 1184
Options: 0x2 : *|-|-|-|-|-|E|*
LS Flags: 0x6
LS Type: network-LSA
Link State ID: 20.20.20.3 (address of Designated Router)
Advertising Router: 127.3.3.3
LS Seq Number: 80000006
Checksum: 0xbb34
Length: 36
Network Mask: /24
Attached Router: 127.2.2.2
Attached Router: 127.3.3.3
Attached Router: 127.4.4.4




OSPF Protocol Configuration Detail:
We’ll discuss this preferably on R2:

vyatta@r2:~$ show ip ospf
OSPF Routing Process, Router ID: 127.2.2.2
Supports only single TOS (TOS0) routes
This implementation conforms to RFC2328
RFC1583Compatibility flag is disabled

when RFC1583Compatibility flag is enabled in case of choosing between similar routes between AS LSA's and External LSA's cost would be considered and while it is disabled path would be the preferred factor to calculate optimized routes. this RFC could be enabled via the "set protocols ospf parameters rfc1583-compatibility" command
OpaqueCapability flag is disabled
Initial SPF scheduling delay 200 millisec(s)
Minimum hold time between consecutive SPFs 1000 millisec(s)
Hold time multiplier is currently 1
SPF algorithm last executed 22m46s ago
SPF timer is inactive
Refresh timer 10 secs
Number of external LSA 0. Checksum Sum 0x00000000

we only have one routing protocol defined in our network so we shouldn't have any external lsa’s either
Number of opaque AS LSA 0. Checksum Sum 0x00000000
Number of areas attached to this router: 1
Adjacency changes are logged

Area ID: 0.0.0.0 (Backbone)

area 0 or 0.0.0.0 marked as backbone
Number of interfaces in this area: Total: 3, Active: 3
Total number of interfaces active on R2 which belong to the area 0.0.0.0 these are lo, eth0 and eth1
Number of fully adjacent neighbors in this area: 4
number of neighbors discovered by the hello packets
Area has no authentication
we would set clear-text and also md5 authentication for ospf later in part 4
SPF algorithm executed 24 times
Number of LSA 6

Number of Link State Advertisements in the OSPF Database, the following is a detail of each type of LSA
Number of router LSA 4. Checksum Sum 0x00017850
Number of network LSA 2. Checksum Sum 0x00017098
Number of summary LSA 0. Checksum Sum 0x00000000


It’s Obvious that we don’t have ASBR’s since all of our routers are in the same area, relatively none NOT SO STUBBY AREAS NSSA’s and OPAQUE areas and links.
Number of ASBR summary LSA 0. Checksum Sum 0x00000000
Number of NSSA LSA 0. Checksum Sum 0x00000000
Number of opaque link LSA 0. Checksum Sum 0x00000000
Number of opaque area LSA 0. Checksum Sum 0x00000000



CONTINUE TO PART 4 - OSPF AUTHENTICATION