Thursday, May 20, 2010

OSPF LAB

OSPF: Open Shortest Path First (OSPF) is a dynamic routing protocol for use in Internet Protocol (IP) networks. Specifically, it is a link-state routing protocol and falls into the group of interior gateway protocols, operating within a single autonomous system (AS). It is defined as OSPF Version 2 in RFC 2328 (1998). Source:http://en.wikipedia.org/wiki/Open_Shortest_Path_First




  This lab starts with a basic OSPF configurations and verification.








R1:

interface Loopback45
 ip address 45.45.45.1 255.255.255.0
 !
!
interface Loopback46
 ip address 45.45.46.1 255.255.255.0
 !
!
interface Loopback47
 ip address 45.45.47.1 255.255.255.0
 !
!
interface FastEthernet0/0
 ip address 20.0.0.1 255.224.0.0
 duplex half
 !
!
!
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 network 20.0.0.0 0.31.255.255 area 0
 network 45.45.45.0 0.0.0.255 area 0
 network 45.45.46.0 0.0.0.255 area 0
 network 45.45.47.0 0.0.0.255 area 0

!
______________________________________________________________________________________________


R2:
interface FastEthernet0/0
 ip address 20.0.0.2 255.224.0.0
 duplex half
 !
!
interface Serial1/0
 ip address 1.1.1.1 255.255.255.252
 serial restart-delay 0
 clock rate 64000
 !

router ospf 1
 router-id 2.2.2.1
 log-adjacency-changes
 network 1.1.1.0 0.0.0.3 area 0
 network 20.0.0.0 0.31.255.255 area 0


___________________________________________________________________________________

R3:

interface Loopback20
 ip address 20.20.20.1 255.255.255.0
 !
!
interface Loopback21
 ip address 20.20.21.1 255.255.255.0
 !
!
interface Loopback22
 ip address 20.20.22.1 255.255.255.0
 !
!
interface FastEthernet0/0
 ip address 15.15.15.1 255.255.255.0
 duplex half
 !
!
interface Serial1/0
 ip address 1.1.1.2 255.255.255.252
 serial restart-delay 0
 !
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
 !
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
 !
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
 !
!
!
router ospf 2
 router-id 3.3.3.1
 log-adjacency-changes
 network 1.1.1.0 0.0.0.3 area 0
 network 15.15.15.0 0.0.0.255 area 1
 network 20.20.20.0 0.0.0.255 area 1
 network 20.20.21.0 0.0.0.255 area 1
 network 20.20.22.0 0.0.0.255 area 1
___________________________________________________________________________________

R4:

interface Loopback1
 ip address 192.168.2.1 255.255.255.0
 !
!
interface Loopback2
 ip address 192.168.1.1 255.255.255.0
 !
!
interface Loopback3
 ip address 192.168.3.1 255.255.255.0
 !
!
interface FastEthernet0/0
 ip address 15.15.15.2 255.255.255.0
 duplex half
 !
!
!
router ospf 2
 router-id 4.4.4.1
 log-adjacency-changes
 redistribute rip metric 25 metric-type 1 subnets
 network 15.15.15.0 0.0.0.255 area 1
!
router rip
 version 2
 network 192.168.1.0
 network 192.168.2.0
 network 192.168.3.0
 no auto-summary
!
____________________________________________________________________________________

The next step is to verify neighborship between the routers

R1:
R1#SH IP OSpf NEighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.1           1   FULL/BDR        00:00:33    20.0.0.2        FastEthernet0/0


____________________________________________________________________________________

R2:

R2#SH IP OSpf NEighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.1           0   FULL/  -        00:00:34    1.1.1.2         Serial1/0
1.1.1.1           1   FULL/DR         00:00:37    20.0.0.1        FastEthernet0/0
___________________________________________________________________________________


R3:

R3#SH IP OSpf NEighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.1           0   FULL/  -        00:00:37    1.1.1.1         Serial1/0
4.4.4.1           1   FULL/BDR        00:00:30    15.15.15.2      FastEthernet0/0
___________________________________________________________________________________

R4:

R4#SH IP OSpf NEighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.1           1   FULL/DR         00:00:34    15.15.15.1      FastEthernet0/0
___________________________________________________________________________________

Note: Pay attention to the state of the neighbor:


  1. R1 identifies R2 as the BDR for the broadcast network: 

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.1           1   FULL/BDR        00:00:33    20.0.0.2        FastEthernet0/0

  1. R2 identifies R1 as the DR for the broadcast network:
  2. R2 identifies R3 as FULL/-, this happens on Point-to-Point networks where only one router is connected at the other end of the link.


Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.1           0   FULL/  -        00:00:34    1.1.1.2         Serial1/0
1.1.1.1           1   FULL/DR         00:00:37    20.0.0.1        FastEthernet0/0

___________________________________________________________________________________

Let's take a brief look at LSA's and LSA types:

LSA type 1 (Router): Type 1 LSA's are sent by all routers in an area describing their directly connected networks. These LSA's do not leave the area.

LSA type 2 (Network): Type 2 LSA's are sent by the DR in a non-broadcast multiaccess network describing all connected routers on the segment. These LSA's do not leave the area

LSA type 3 (Summary): Type 3 LSA's are sent by the ABR to describe a route to neighbors outside of the area

LSA type 4 (Summary): Type 4 LSA's are sent by the ABR describing the IP address of the ASBR.

LSA type 5 (External): Type 5 LSA's are sent by the ASBR describing routes that are being redistributed into the area.

LSA type 7 Not so Stubby area(NSSA): Are sourced from a router in a NSSA
___________________________________________________________________________________


 Let's take a look at the OSPF database

R1:

R1#sh 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         1534        0x80000006 0x0077B4 4
2.2.2.1         2.2.2.1         1488        0x80000006 0x0058EF 3
3.3.3.1         3.3.3.1         1284        0x80000003 0x00E898 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
20.0.0.1        1.1.1.1         1534        0x80000002 0x006CC7

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
15.15.15.0      3.3.3.1         1284        0x80000002 0x0025DE
20.20.20.1      3.3.3.1         1284        0x80000002 0x00668D
20.20.21.1      3.3.3.1         1284        0x80000002 0x005B97
20.20.22.1      3.3.3.1         1284        0x80000002 0x0050A1

                Summary ASB Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
4.4.4.1         3.3.3.1         775         0x80000002 0x009A88

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
192.168.1.0     4.4.4.1         715         0x80000002 0x007132 0
192.168.2.0     4.4.4.1         975         0x80000002 0x00663C 0
192.168.3.0     4.4.4.1         975         0x80000002 0x005B46 0


___________________________________________________________________________________

R2:


R2#SH IP OSpf Database

            OSPF Router with ID (2.2.2.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         133         0x80000007 0x0075B5 4
2.2.2.1         2.2.2.1         116         0x80000007 0x0056F0 3
3.3.3.1         3.3.3.1         1921        0x80000003 0x00E898 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
20.0.0.1        1.1.1.1         133         0x80000003 0x006AC8

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
15.15.15.0      3.3.3.1         1921        0x80000002 0x0025DE
20.20.20.1      3.3.3.1         1921        0x80000002 0x00668D
20.20.21.1      3.3.3.1         1921        0x80000002 0x005B97
20.20.22.1      3.3.3.1         1921        0x80000002 0x0050A1

                Summary ASB Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
4.4.4.1         3.3.3.1         1412        0x80000002 0x009A88

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
192.168.1.0     4.4.4.1         1352        0x80000002 0x007132 0
192.168.2.0     4.4.4.1         1611        0x80000002 0x00663C 0
192.168.3.0     4.4.4.1         1611        0x80000002 0x005B46 0


___________________________________________________________________________________

R3:

R3#SH IP OSpf DAtabase

            OSPF Router with ID (3.3.3.1) (Process ID 2)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         271         0x80000007 0x0075B5 4
2.2.2.1         2.2.2.1         254         0x80000007 0x0056F0 3
3.3.3.1         3.3.3.1         31          0x80000004 0x00E699 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
20.0.0.1        1.1.1.1         271         0x80000003 0x006AC8

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
15.15.15.0      3.3.3.1         31          0x80000003 0x0023DF
20.20.20.1      3.3.3.1         31          0x80000003 0x00648E
20.20.21.1      3.3.3.1         31          0x80000003 0x005998
20.20.22.1      3.3.3.1         31          0x80000003 0x004EA2

                Summary ASB Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
4.4.4.1         3.3.3.1         1548        0x80000002 0x009A88

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
3.3.3.1         3.3.3.1         1797        0x80000006 0x008945 4
4.4.4.1         4.4.4.1         1746        0x80000004 0x00981E 1

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
15.15.15.1      3.3.3.1         1797        0x80000002 0x0018D1

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
1.1.1.0         3.3.3.1         33          0x80000003 0x00836D
20.0.0.0        3.3.3.1         33          0x80000003 0x0042B8
45.45.45.1      3.3.3.1         33          0x80000003 0x0069FC
45.45.46.1      3.3.3.1         33          0x80000003 0x005E07
45.45.47.1      3.3.3.1         33          0x80000003 0x005311

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
192.168.1.0     4.4.4.1         1488        0x80000002 0x007132 0
192.168.2.0     4.4.4.1         1748        0x80000002 0x00663C 0
192.168.3.0     4.4.4.1         1748        0x80000002 0x005B46 0
___________________________________________________________________________________

R4:

R4#SH IP ospf database

            OSPF Router with ID (4.4.4.1) (Process ID 2)

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
3.3.3.1         3.3.3.1         1952        0x80000006 0x008945 4
4.4.4.1         4.4.4.1         1900        0x80000004 0x00981E 1

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
15.15.15.1      3.3.3.1         1952        0x80000002 0x0018D1

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
1.1.1.0         3.3.3.1         188         0x80000003 0x00836D
20.0.0.0        3.3.3.1         188         0x80000003 0x0042B8
45.45.45.1      3.3.3.1         188         0x80000003 0x0069FC
45.45.46.1      3.3.3.1         188         0x80000003 0x005E07
45.45.47.1      3.3.3.1         188         0x80000003 0x005311

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
192.168.1.0     4.4.4.1         1641        0x80000002 0x007132 0
192.168.2.0     4.4.4.1         1902        0x80000002 0x00663C 0
192.168.3.0     4.4.4.1         1902        0x80000002 0x005B46 0
___________________________________________________________________________________

Let's verify the contents of the routing table across the network

R1:
R1#SH IP ROUTE
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, + - replicated route

Gateway of last resort is not set

      1.0.0.0/30 is subnetted, 1 subnets
O        1.1.1.0 [110/65] via 20.0.0.2, 01:27:32, FastEthernet0/0
      15.0.0.0/24 is subnetted, 1 subnets
O IA     15.15.15.0 [110/66] via 20.0.0.2, 01:23:14, FastEthernet0/0
      20.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O IA     20.20.20.1/32 [110/66] via 20.0.0.2, 01:25:49, FastEthernet0/0
O IA     20.20.21.1/32 [110/66] via 20.0.0.2, 01:25:49, FastEthernet0/0
O IA     20.20.22.1/32 [110/66] via 20.0.0.2, 01:25:39, FastEthernet0/0
O E1  192.168.1.0/24 [110/91] via 20.0.0.2, 01:17:27, FastEthernet0/0
O E1  192.168.2.0/24 [110/91] via 20.0.0.2, 01:18:12, FastEthernet0/0
O E1  192.168.3.0/24 [110/91] via 20.0.0.2, 01:18:12, FastEthernet0/0
R1#

__________________________________________________________________________

R2:

Gateway of last resort is not set

      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.1.1.0/30 is directly connected, Serial1/0
L        1.1.1.1/32 is directly connected, Serial1/0
      15.0.0.0/24 is subnetted, 1 subnets
O IA     15.15.15.0 [110/65] via 1.1.1.2, 01:14:33, Serial1/0
      20.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C        20.0.0.0/11 is directly connected, FastEthernet0/0
L        20.0.0.2/32 is directly connected, FastEthernet0/0
O IA     20.20.20.1/32 [110/65] via 1.1.1.2, 01:17:08, Serial1/0
O IA     20.20.21.1/32 [110/65] via 1.1.1.2, 01:17:08, Serial1/0
O IA     20.20.22.1/32 [110/65] via 1.1.1.2, 01:16:58, Serial1/0
      45.0.0.0/32 is subnetted, 3 subnets
O        45.45.45.1 [110/2] via 20.0.0.1, 01:19:01, FastEthernet0/0
O        45.45.46.1 [110/2] via 20.0.0.1, 01:19:03, FastEthernet0/0
O        45.45.47.1 [110/2] via 20.0.0.1, 01:19:03, FastEthernet0/0
O E1  192.168.1.0/24 [110/90] via 1.1.1.2, 01:08:48, Serial1/0
O E1  192.168.2.0/24 [110/90] via 1.1.1.2, 01:09:34, Serial1/0
O E1  192.168.3.0/24 [110/90] via 1.1.1.2, 01:09:34, Serial1/0
R2#
__________________________________________________________________________________


R3:

Gateway of last resort is not set

      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.1.1.0/30 is directly connected, Serial1/0
L        1.1.1.2/32 is directly connected, Serial1/0
      15.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        15.15.15.0/24 is directly connected, FastEthernet0/0
L        15.15.15.1/32 is directly connected, FastEthernet0/0
      20.0.0.0/8 is variably subnetted, 7 subnets, 3 masks
O        20.0.0.0/11 [110/65] via 1.1.1.1, 01:18:08, Serial1/0
C        20.20.20.0/24 is directly connected, Loopback20
L        20.20.20.1/32 is directly connected, Loopback20
C        20.20.21.0/24 is directly connected, Loopback21
L        20.20.21.1/32 is directly connected, Loopback21
C        20.20.22.0/24 is directly connected, Loopback22
L        20.20.22.1/32 is directly connected, Loopback22
      45.0.0.0/32 is subnetted, 3 subnets
O        45.45.45.1 [110/66] via 1.1.1.1, 01:18:10, Serial1/0
O        45.45.46.1 [110/66] via 1.1.1.1, 01:18:10, Serial1/0
O        45.45.47.1 [110/66] via 1.1.1.1, 01:18:10, Serial1/0
O E1  192.168.1.0/24 [110/26] via 15.15.15.2, 01:09:37, FastEthernet0/0
O E1  192.168.2.0/24 [110/26] via 15.15.15.2, 01:10:27, FastEthernet0/0
O E1  192.168.3.0/24 [110/26] via 15.15.15.2, 01:10:28, FastEthernet0/0
R3#
___________________________________________________________________________________

R4:

Gateway of last resort is not set

      1.0.0.0/30 is subnetted, 1 subnets
O IA     1.1.1.0 [110/65] via 15.15.15.1, 01:13:50, FastEthernet0/0
      15.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        15.15.15.0/24 is directly connected, FastEthernet0/0
L        15.15.15.2/32 is directly connected, FastEthernet0/0
      20.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O IA     20.0.0.0/11 [110/66] via 15.15.15.1, 01:13:50, FastEthernet0/0
O        20.20.20.1/32 [110/2] via 15.15.15.1, 01:13:50, FastEthernet0/0
O        20.20.21.1/32 [110/2] via 15.15.15.1, 01:13:50, FastEthernet0/0
O        20.20.22.1/32 [110/2] via 15.15.15.1, 01:13:50, FastEthernet0/0
      45.0.0.0/32 is subnetted, 3 subnets
O IA     45.45.45.1 [110/67] via 15.15.15.1, 01:13:50, FastEthernet0/0
O IA     45.45.46.1 [110/67] via 15.15.15.1, 01:13:50, FastEthernet0/0
O IA     45.45.47.1 [110/67] via 15.15.15.1, 01:13:51, FastEthernet0/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Loopback2
L        192.168.1.1/32 is directly connected, Loopback2
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, Loopback1
L        192.168.2.1/32 is directly connected, Loopback1
      192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.3.0/24 is directly connected, Loopback3
L        192.168.3.1/32 is directly connected, Loopback3
R4#
 _________________________________________________________________________________

Note: I will verify end to end connectivity, if all is well i should be able to ping from R1 to R4 and vice versa.

R1:
R1#PING 192.168.3.1 r 20
Type escape sequence to abort.
Sending 20, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (20/20), round-trip min/avg/max = 44/64/108 ms
R1#
__________________________________________________________________________________

R4:
R4(config)#do ping 45.45.47.1 r 20

Type escape sequence to abort.
Sending 20, 100-byte ICMP Echos to 45.45.47.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (20/20), round-trip min/avg/max = 36/70/112 ms
R4(config)#

Note: Everything looks good, this lab config was simple and straight forward. The difficult part is knowing where to look when there are anomalies on the network. Troubleshooting is a MUST have skill. Later in this lab there will be a lot of issues that must be resolved. Once we have a good baseline understanding of the network, the troubleshooting steps will fall into place, hopefully :-)

No comments:

Post a Comment