Above we have R1 and R2 in area 0, the backbone area.
Between R1 and R3, we will use
area 1 and between R2/R4 we will use area 2. R3 and R4 have a loopback interface with an
IP address that we will advertise in their area.
Configuration
Let’s start with all network commands to get OSPF up and running. The network command
defines to which area each interface will [Link], we will configure R1 and R2 for the
backbone area:
R1(config)#router ospf 1
R1(config-router)#network [Link] [Link] area 0
R2(config)#router ospf 1
R2(config-router)#network [Link] [Link] area 0
Let’s configure R1 and R3 for area 1:
R1(config)#router ospf 1
R1(config-router)#network [Link] [Link] area 1
R3(config)#router ospf 1
R3(config-router)#network [Link] [Link] area 1
R3(config-router)#network [Link] [Link] area 1
And last but not least, R2 and R4 for area 2:
R2(config)#router ospf 1
R2(config-router)#network [Link] [Link] area 2
R4(config)#router ospf 1
R4(config-router)#network [Link] [Link] area 2
R4(config-router)#network [Link] [Link] area 2
Those are all the network commands we need.
Verification
Let’s verify our work. First, let’s make sure we have OSPF neighbors:
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address
Interface
[Link] 1 FULL/DR [Link] [Link]
GigabitEthernet0/1
[Link] 1 FULL/BDR [Link] [Link]
GigabitEthernet0/2
R1 has formed a neighbor adjacency with R2 and R3. Let’s check R2:
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address
Interface
[Link] 1 FULL/BDR [Link] [Link]
GigabitEthernet0/1
[Link] 1 FULL/BDR [Link] [Link]
GigabitEthernet0/2
R2 has formed neighbor adjacencies with R1 and R4. The show
ip ospf neighbor command, however, doesn’t tell me anything about the areas that are
used. If you want to see this, you could add the detail parameter like this:
R2#show ip ospf neighbor detail
Neighbor [Link], interface address [Link]
In the area 0 via interface GigabitEthernet0/1
Neighbor priority is 1, State is FULL, 6 state changes
DR is [Link] BDR is [Link]
Options is 0x12 in Hello (E-bit, L-bit)
Options is 0x52 in DBD (E-bit, L-bit, O-bit)
LLS Options is 0x1 (LR)
Dead timer due in [Link]
Neighbor is up for [Link]
Index 1/1/1, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
Neighbor [Link], interface address [Link]
In the area 2 via interface GigabitEthernet0/2
Neighbor priority is 1, State is FULL, 6 state changes
DR is [Link] BDR is [Link]
Options is 0x12 in Hello (E-bit, L-bit)
Options is 0x52 in DBD (E-bit, L-bit, O-bit)
LLS Options is 0x1 (LR)
Dead timer due in [Link]
Neighbor is up for [Link]
Index 1/1/2, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
Above you can see that interface GigabitEthernet0/1 is in area 0 and interface
GigabitEthernet0/2 is in area 2. Another good command to find area information is show ip
protocols:
R2#show ip protocols
*** IP Routing is NSF aware ***
Routing Protocol is "application"
Sending updates every 0 seconds
Invalid after 0 seconds, hold down 0, flushed after 0
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Maximum path: 32
Routing for Networks:
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 4)
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID [Link]
It is an area border router
Number of areas in this router is 2. 2 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
[Link] [Link] area 0
[Link] [Link] area 2
Routing Information Sources:
Gateway Distance Last Update
[Link] 110 [Link]
[Link] 110 [Link]
Distance: (default is 110)
Above you can see which networks belong to which area:
Network [Link] in area 0.
Network [Link] in area 2.
Let’s check our routing tables. Let’s start with R1:
R1#show ip route ospf
Codes: L - local, 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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
[Link]/32 is subnetted, 1 subnets
O [Link] [110/2] via [Link], [Link], GigabitEthernet0/2
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/3] via [Link], [Link], GigabitEthernet0/1
O IA [Link]/24 [110/2] via [Link], [Link],
GigabitEthernet0/1
Above we see three OSPF entries. The first one is for [Link]/32, the loopback interface of
R3. It shows up with an O since this is an intra-area route. R1 has also learned about
[Link]/32 and [Link]/24. These two entries show up as O IA since they are inter-
area routes.
R2 has a similar output:
R2#show ip route ospf
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/3] via [Link], [Link], GigabitEthernet0/1
[Link]/32 is subnetted, 1 subnets
O [Link] [110/2] via [Link], [Link], GigabitEthernet0/2
O IA [Link]/24 [110/2] via [Link], [Link],
GigabitEthernet0/1
Above we see that R2 has learned about [Link]/32 and [Link]/24 which area inter-
area routes. [Link]/32 is an intra-area route.
Let’s check R3:
R3#show ip route ospf
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/4] via [Link], [Link], GigabitEthernet0/1
O IA [Link]/24 [110/2] via [Link], [Link],
GigabitEthernet0/1
O IA [Link]/24 [110/3] via [Link], [Link],
GigabitEthernet0/1
Everything that R3 has learned is from another area, that’s why we only see inter-area
routes here. The same thing applies to R4:
R4#show ip route ospf
[Link]/32 is subnetted, 1 subnets
O IA [Link] [110/4] via [Link], [Link], GigabitEthernet0/1
O IA [Link]/24 [110/2] via [Link], [Link],
GigabitEthernet0/1
O IA [Link]/24 [110/3] via [Link], [Link],
GigabitEthernet0/1
Just to be sure, let’s try a quick ping between R3 and R4 to prove that our multi-area OSPF
configuration is working:
R3#ping [Link] source [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
Packet sent with a source address of [Link]
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/11/13 ms
Our ping is successful. That will be all for now.
2nd Lab
1. Configuring the OSPF Process
To begin OSPF configuration we need to configure the router OSPF process. We do
that with the following commands:
Example:
R1(config)# router ospf {process ID}
R1(config-router)#
Config:
R1(config)# router ospf 1
R1(config-router)#
Unlike other routing protocols, the process ID is unique to the local router, so it does not
matter if other routers are configured with the same process ID. I have asked you to
configure them all with the same process ID to prove that point. You could also
configure them with different process IDs, doing so will have no effect.
2. Configuring Router ID
OSPF uses router ids to identify routers. By default, the router-id is set to the highest
configured loopback, or the highest configured physical interface if there is no loopback.
It can also be configured using the router-id command inside the OSPF process. It is
best practice to configure a loopback, then use the router-id command with the
loopback address. In this lab, the loopback interface is already configured so you simply
set the router-id to the loopback configured on the routers.
R1(config)# router ospf 1
R1(config-router)# router-id [Link]
3. Advertising Directly Connected Networks
There are a couple of ways to advertise networks connected to the router. You can use
the network command inside the OSPF process and specify the network address and
wildcard, for example, network [Link] [Link] area 0 would advertise the
[Link]/24 network into OSPF.
Alternatively, you can simply use network [Link] [Link] area 0 to advertise
all networks attached to the router. In this lab, I ask you to use the first example method,
as it is best practice and more commonly used. (Note: you will not advertise the
loopback this way in this lab, although you could)
R1(config)# router ospf 1
R1(config-router)# network [Link] [Link] area 0 (network between R1 & R2)
R1(config-router)# network [Link] [Link] area 0 (network between R1 & R3)
R1(config-router)# network [Link] [Link] area 0 (network between R1 & R4)
4. Advertising the Loopbacks through the Interface
Another way to advertise networks is on a per-interface basis. If you go to interface
configuration mode, you can use the command ip ospf {process id} area {area} to
configure the interface for OSPF. For example, ip ospf 1 area 0 configures the interface
for OSPF process 1 in area 0. I have asked you to configure the loopbacks on all
routers using this method.
Note: R2’s loopback should be in area 1, R3’s loopback should be in area 2, R3’s
loopback should be in area 3.
R1(config)# interface lo0
R1(config-if)# ip ospf 1 area 0
You will need to complete the OSPF configuration on R2, R3, and R4.
5. Verify Router Connectivity
With step 4 completed, the basic OSPF configuration is complete. We can now ping
between the routers to verify connectivity. I ask you to ping loopbacks, but you can also
ping interface IP addresses if you wish. Below you can see some successful pings.
6. Pinging between PCs
You can also hop into the command prompt on some of the PCs and ping between
them to verify remote network connectivity. Your first pings may drop as the packets
traverse the networks, but all pings should be successful after that.
Bonus: Identify ABRs, internals, backbone, and ASBRs
R1 is considered to back an internal/backbone router. It is an internal router
because all of its interfaces are only in one area, which is area 0. Because the
router is in the backbone area, it is a backbone router as well.
R2, R3, and R4 are all area border routers (ABR) because they all interfaces in
more than one area. They can also be considered backbone routers because
they all have at least one interface connected to the backbone area.
Because this topology only uses OSPF and is not connected to a different routing
domain or another autonomous system, there is no autonomous system
border router (ASBR).