OSPF Configuration Part 2 : Conifguring R1 & R2


R1 Configuration
Well after you have made sure you have connectivity, let’s configure OSPF on our interfaces on R1 and see the effects.

vyatta@r1:~$ configure
vyatta@r1# set protocols ospf area 0.0.0.0
vyatta@r1# set protocols ospf area 0.0.0.0 network 127.1.1.0/24
vyatta@r1# set protocols ospf area 0.0.0.0 network 10.10.10.0/24
vyatta@r1# set protocols ospf parameters router-id 127.1.1.1
vyatta@r1# set protocols ospf log-adjacency-changes


After configuring the R1 interfaces with OSPF lets take a look at its routing table:

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:12:21
C>* 10.10.10.0/24 is directly connected, eth0
C>* 127.1.1.0/24 is directly connected, lo


As you see an extra OSPF route has been calculated and added to the routing table on R1 but the fact is that the OSPF route has an administrative cost of 110 while we already have the same route with a cost of 1 which is the directly connected interface and according to the routing table the directly connected route is selected over the OSPF route because of the lower cost it carries with itself. On the other hand we still have not exchanged any other routes with other routers, well this is a fact and the reason is that we haven't yet configured any other router with OSPF yet, now let’s take a look at R1 OSPF database.


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 757 0x80000002 0x95f2 2


According to the db or R1 the loopback ip address has been chosen as the id and that’s what we configured before, the advertising router is also the loopback address, the age of the route link state entry is 757 second old, the sequence number is at 0x80000002and every change to the database increments the sequence number and the finally the checksum and the total number of active links on the router which is 2 and the reason is that we only defined ospf for 2 existing interfaces on the router. we still don’t have any network LSA’s and the reason is that R1 is the only OSPF router in the network.

We don’t have any network LSA’s yet so let’s take a look at the router LSA database in detail

vyatta@r1:~$ show ip ospf database router
OSPF Router with ID (127.1.1.1)
Router Link States (Area 0.0.0.0)
LS age: 802
Options: 0x2 : *|-|-|-|-|-|E|*
LS Flags: 0x1
Flags: 0x0
LS Type: router-LSA
Link State ID: 127.1.1.1
Advertising Router: 127.1.1.1
LS Seq Number: 80000002
Checksum: 0x95f2
Length: 48
Number of Links: 2
Link connected to: Stub Network
(Link ID) Net: 10.10.10.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metric: 10

since we yet don’t have any neighbors defined the network would be considered as a stub network
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


Lets take a look at the interfaces we configured for the OSPF protocol

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 DR, Priority 1
Designated Router (ID) 127.1.1.1, Interface Address 10.10.10.1
No backup designated router on this network
Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 6.701s
Neighbor Count is 0, Adjacent neighbor count is 0


The internet address is the interface ip address, so don’t get confused with that one. since the interface is connected to a ethernet network the network type is considered to be a broadcast type. The interface holds a cost of 10;the state is in DR (designated router) mode, no backup DR yet has been defined.


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


hello packets every 10 sec, the amount of time to wait so that the router could declare an adjacency is [dead 40s], the amount of time to retransmit the advertisement is 5s, hello due : the amount seconds left to send another hello packet (since we haven’t configured any other routers with the OSPF protocol apparently we have no neighbors and no adjacencies thus the hello due is inactive)


R2 Configuration
Lets configure R2 interfaces with the OSPF protocol and see the effect it has on R1 routing table and as well as the database

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:02:37
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:02:22
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:02:22
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:04:41
C>* 10.10.10.0/24 is directly connected, eth0
O 20.20.20.0/24 [110/10] is directly connected, eth1, 00:04: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:04:16
C>* 127.2.2.0/24 is directly connected, lo


Routes have been exchanged between R1 and R2 and have been calculated and placed in the routing table.

vyatta@r2:~$ show ip ospf database
OSPF Router with ID (127.2.2.2)
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 292 0x80000006 0x0a5a 2
127.2.2.2 127.2.2.2 276 0x80000004 0x9a6b 3
Net Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum
10.10.10.2 127.2.2.2 292 0x80000001 0xbeed


R2 has added its own router LSA to the database and a new network LSA has been calculated.



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 DR, Priority 1
Designated Router (ID) 127.2.2.2, Interface Address 10.10.10.2
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 9.375s
Neighbor Count is 1, Adjacent neighbor count is 1
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 DR, Priority 1
Designated Router (ID) 127.2.2.2, Interface Address 20.20.20.2
No backup designated router on this network
Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Hello due in 0.295s
Neighbor Count is 0, Adjacent neighbor count is 0
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


Router 2 has been configured with OSPF this time DR & BDR re-election states that the router-id of R2 has a higher IP address value and the same priority so it would be chosen as the DR and the previous router which would be R1would change its state to BDR (backup designated router)
We yet don’t have any BDR on eth0 since it’s the only interface on VMnet3which OSPF has been configured on it. Number of neighbors on eth0 have incremented to 1which is R1.

Just to give you a better view of what's going on lets take a look at R1 OSPF interfaces

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.2.2.2, Interface Address 10.10.10.2
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 5.407s
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.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




CONTINUE TO PART3 -CONFIGURING OSPF ON R3 and R4