OSPF LAB

                         

                               Single Area OSPFv2 Configuration

First we have to use the global command  router ospf <process-id> command. After entering this command the router will go into OSPF configuration mode .
                                                            Router(config)#router ospf <process-id>

Next we have to use the network <ip address><wildcard mask> area <area-id> command. This command will enable OSPFv2 on the interfaces which are matched by the ip address and wildcard mask parameter in the above command. There can be more than one network command depending on the requirement.

                                                                Router(config-router)#network <ip address><wildcard mask>

Example


 

R1

R1(config)#router ospf 1
R1(config-router)#network 10.1.12.0 0.0.0.255 area 0

The network command parameter is 10.1.12.0 subnet and the wildcard mask is 0.0.0.255. This will enable the ospf on all the interfaces which will fall in this network range.In this case it is interface s1/0 (ip address 10.1.12.1 255.255.255.0).

R2

R2(config)#router ospf 1
R2(config-router)#network 10.1.12.0 0.0.0.255 area 0
R2(config-router)#network 192.168.23.0 0.0.0.255 area 0

The 1st network command parameter is 10.1.12.0 subnet and the wildcard mask is 0.0.0.255. This will enable the ospf on all the interfaces which will fall in this network range.In this case it is interface s1/0 whose ip address is 10.1.12.2 255.255.255.0.

The 2nd network command parameter is 192.168.23.0 subnet and the wildcard mask is 0.0.0.255. This will enable the ospf on all the interfaces which will fall in this network range.In this case it is interface f0/0 whose ip address is 192.168.23.2 255.255.255.0.

*Mar 1 00:17:04.771: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.12.1 on Serial1/0 from LOADING to FULL, Loading Done

R3

R3(config)#router ospf 1
R3(config-router)#network 192.168.23.0 0.0.0.255 area 0
R3(config-router)#network 172.16.43.0 0.0.0.255 area 0

The 1st network command parameter is 172.16.43.0 subnet and the wildcard mask is 0.0.0.255. This will enable the ospf on all the interfaces which will fall in this network range.In this case it is interface s1/0 whose ip address is 172.16.43.3 255.255.255.0.

The 2nd network command parameter is 192.168.23.0 subnet and the wildcard mask is 0.0.0.255. This will enable the ospf on all the interfaces which will fall in this network range.In this case it is interface f0/0 whose ip address is 192.168.23.3 255.255.255.0.

*Mar 1 00:17:04.771: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.12.1 on Serial1/0 from LOADING to FULL, Loading Done

R4

R4(config)#router ospf 1
R4(config-router)#network 172.16.43.0 0.0.0.255 area 0

The network command parameter is 172.16.43.0 subnet and the wildcard mask is 0.0.0.255. This will enable the ospf on all the interfaces which will fall in this network range.In this case it is interface s1/0 (ip address 10.1.12.1 255.255.255.0).

*Mar 1 00:20:05.867: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.3 on Serial1/0 from LOADING to FULL, Loading Done

Verification

R1

R1#ping 172.16.43.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.43.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/60/76 ms

R1#ping 172.16.43.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.43.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 84/97/112 ms

R1#ping 192.168.23.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/28/40 ms

R1#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/65/92 ms

R1#sh ip ospf neighbor

Neighbor ID    Pri     State         Dead Time   Address    Interface
2.2.2.2                   0        FULL/ –      00:00:30       10.1.12.2       Serial1/0

R1#show ip ospf database

OSPF Router with ID (1.1.1.1) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1809 0x80000002 0x003133 2
2.2.2.2 2.2.2.2 1774 0x80000003 0x0059E5 3
3.3.3.3 3.3.3.3 1774 0x80000003 0x00D2B4 3
4.4.4.4 4.4.4.4 1810 0x80000002 0x00ABF7 2

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
192.168.23.3 3.3.3.3 1775 0x80000001 0x004254

R1#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

1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback1
172.16.0.0/24 is subnetted, 1 subnets
O 172.16.43.0 [110/138] via 10.1.12.2, 00:29:27, Serial1/0
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.12.0 is directly connected, Serial1/0
O 192.168.23.0/24 [110/74] via 10.1.12.2, 00:29:37, Serial1/0

R2

R2#ping 172.16.43.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.43.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/32/44 ms

R2#ping 172.16.43.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.43.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/64/80 ms

R2#ping 10.1.12.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/32/44 ms

R2#ping 192.168.23.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/8 ms

R2#ping 10.1.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/71/92 ms

R2#show ip ospf neighbor

Neighbor ID       Pri      State            Dead Time      Address        Interface
3.3.3.3                      1          FULL/DR      00:00:37         192.168.23.3     FastEthernet0/0
1.1.1.1                        0          FULL/ –         00:00:34         10.1.12.1              Serial1/0

R2#show ip ospf database

OSPF Router with ID (2.2.2.2) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 1956 0x80000002 0x003133 2
2.2.2.2 2.2.2.2 1919 0x80000003 0x0059E5 3
3.3.3.3 3.3.3.3 1920 0x80000003 0x00D2B4 3
4.4.4.4 4.4.4.4 1955 0x80000002 0x00ABF7 2

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
192.168.23.3 3.3.3.3 1920 0x80000001 0x004254

R2#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

2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback1
172.16.0.0/24 is subnetted, 1 subnets
O 172.16.43.0 [110/74] via 192.168.23.3, 00:32:02, FastEthernet0/0
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.12.0 is directly connected, Serial1/0
C 192.168.23.0/24 is directly connected, FastEthernet0/0

R3

R3#ping 10.1.12.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/68/92 ms

R3#ping 10.1.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/35/52 ms

R3#ping 172.16.43.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.43.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/62/64 ms

R3#ping 172.16.43.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.43.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms

R3#ping 192.168.23.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms

R3#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

R3#show ip ospf neighbor

Neighbor ID     Pri       State              Dead Time     Address         Interface
2.2.2.2                   1             FULL/BDR    00:00:36         192.168.23.2    FastEthernet0/0
4.4.4.4                   0            FULL/ –          00:00:34          172.16.43.4       Serial1/0

R3#show ip ospf database

OSPF Router with ID (3.3.3.3) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 20 0x80000003 0x002F34 2
2.2.2.2 2.2.2.2 54 0x80000004 0x0057E6 3
3.3.3.3 3.3.3.3 31 0x80000004 0x00D0B5 3
4.4.4.4 4.4.4.4 17 0x80000003 0x00A9F8 2

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
192.168.23.3 3.3.3.3 31 0x80000002 0x004055

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

3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.43.0 is directly connected, Serial1/0
10.0.0.0/24 is subnetted, 1 subnets
O 10.1.12.0 [110/74] via 192.168.23.2, 00:33:18, FastEthernet0/0
C 192.168.23.0/24 is directly connected, FastEthernet0/0

R4

R4#ping 172.16.43.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.43.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/32/32 ms

R4#ping 172.16.43.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.43.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/64/76 ms

R4#ping 10.1.12.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/92/100 ms

R4#ping 10.1.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/61/80 ms

R4#ping 192.168.23.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/64/76 ms

R4#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/33/44 ms

 

R4#show ip ospf neighbor

Neighbor ID      Pri       State        Dead Time        Address       Interface
3.3.3.3                     0           FULL/ –    00:00:36              172.16.43.3     Serial1/0

R4#show ip ospf database

OSPF Router with ID (4.4.4.4) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 103 0x80000003 0x002F34 2
2.2.2.2 2.2.2.2 137 0x80000004 0x0057E6 3
3.3.3.3 3.3.3.3 114 0x80000004 0x00D0B5 3
4.4.4.4 4.4.4.4 98 0x80000003 0x00A9F8 2

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
192.168.23.3 3.3.3.3 114 0x80000002 0x004055

R4#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

4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.43.0 is directly connected, Serial1/0
10.0.0.0/24 is subnetted, 1 subnets
O 10.1.12.0 [110/138] via 172.16.43.3, 00:34:34, Serial1/0
O 192.168.23.0/24 [110/74] via 172.16.43.3, 00:35:16, Serial1/0
R4#