Home To Know Networking OSPF (Open Shortest Path First) Part- 3

OSPF (Open Shortest Path First) Part- 3

225
0
SHARE
OSPF (Open Shortest Path First) Part- 3

OSPF (Open Shortest Path First) Topology

OSPF (Open Shortest Path First) Topology
OSPF (Open Shortest Path First) Topology

R1 (config) #int fa0/0
R1 (config-if) #ip add 192.168.101.1 255.255.255.0
R1 (config-if) #no shut
R1 (config) #int s0/0
R1 (config-if) #ip add 192.168.1.1 255.255.255.0
R1 (config-if) #no shut


R2 (config) #int fa0/0
R2 (config-if) #ip add 192.168.102.1 255.255.255.0
R2 (config-if) #no shut
R2 (config) #int s0/0
R2 (config-if) #ip add 192.168.1.2 255.255.255.0
R2 (config-if) #no shut
R2 (config) #int s0/1
R2 (config-if) #ip add 192.168.2.1 255.255.255.0
R2 (config-if) #no shut


R3 (config) #int f0/0
R3 (config-if) #ip add 192.168.103.1 255.255.255.0
R3 (config-if) #no shut
R3 (config) #int s0/0
R3 (config-if) #ip add 192.168.2.2 255.255.255.0
R3 (config-if) #no shut
R3 (config) #int s0/1
R3 (config-if) #ip add 192.168.3.1 255.255.255.0
R3 (config-if) #no shut
R3 (config) #int s0/2
R3 (config-if) #ip add 192.168.6.1 255.255.255.0
R3 (config-if) #no shut
R3 (config) #int s0/3
R3 (config-if) #ip add 101.1.1.100 255.255.255.0
R3 (config-if) #no shut


R4 (config) #int fa0/0
R4 (config-if) #ip add 192.168.104.1 255.255.255.0
R4 (config-if) #no shut
R4 (config) #int s0/0
R4 (config-if) #ip add 192.168.3.2 255.255.255.0
R4 (config-if) #no shut
R4 (config) #int s0/1
R4 (config-if) #ip add 192.168.4.1 255.255.255.0
R4 (config-if) #no shut


R5 (config) #int f0/0
R5 (config-if) #ip add 192.168.105.1 255.255.255.0
R5 (config-if) #no shut
R5 (config) #int s0/0
R5 (config-if) #ip add 192.168.4.2 255.255.255.0
R5 (config-if) #no shut
R5 (config) #int s0/1
R5 (config-if) #ip add 192.168.5.1 255.255.255.0
R5 (config-if) #no shut


R6 (config) #int f0/0
R6 (config-if) #ip add 192.168.106.1 255.255.255.0
R6 (config-if) #no shut
R6 (config) #int s0/0
R6 (config-if) #ip add 192.168.5.2 255.255.255.0
R6 (config-if) #no shut
R6 (config) #int loo 1
R6 (config-if) #ip add 172.60.1.1 255.255.255.0
R6 (config) #int loo 2
R6 (config-if) #ip add 172.60.2.1 255.255.255.0
R6 (config) #int loo 3
R6 (config-if) #ip add 172.60.3.1 255.255.255.0
R6 (config) #int loo 4
R6 (config-if) #ip add 172.60.4.1 255.255.255.0
R6 (config) #int loo 5
R6 (config-if) #ip add 172.60.5.1 255.255.255.0


R7 (config) #int fa0/0
R7 (config-if) #ip add 192.168.107.1 255.255.255.0
R7 (config-if) #no shut
R7 (config) #int s0/0
R7 (config-if) #ip add 192.168.6.2 255.255.255.0
R7 (config-if) #no shut
R7 (config) #int loo 1
R7 (config-if) #ip add 172.70.1.1 255.255.255.0
R7 (config) #int loo 2
R7 (config-if) #ip add 172.70.2.1 255.255.255.0
R7 (config) #int loo 3
R7 (config-if) #ip add 172.70.3.1 255.255.255.0
R7 (config) #int loo 4
R7 (config-if) #ip add 172.70.4.1 255.255.255.0
R7 (config) #int loo 5
R7 (config-if) #ip add 172.70.5.1 255.255.255.0
R7#ping 192.168.6.1
R7#ping 192.168.6.1
Successful


ISP (config) #int fa0/0
ISP (config-if) #ip add 102.1.1.1 255.255.255.0
ISP (config-if) #no shut
ISP (config) #int s0/0
ISP (config-if) #ip add 101.1.1.1 255.255.255.0
ISP (config-if) #no shut

OSPF Configuration

R1 (config) #int fa0/0
R1 (config-if) #ip os 100 area 1
R1 (config) #int s0/0
R1 (config-if) #ip os 100 area 1


R2 (config) #int fa0/0
R2 (config-if) #ip os 100 area 1
R2 (config) #int s0/0
R2 (config-if) #ip os 100 area 1
R2 (config) #int s0/1
R2 (config-if) #ip os 100 area 0


R3 (config) #int fa0/0
R3 (config-if) #ip os 100 area 0
R3 (config) #int s0/0
R3 (config-if) #ip os 100 area 0
R3 (config) #int s0/1
R3 (config-if) #ip os 100 area 0
R3 (config-if) #router ei 100
R3 (config-router) #no auto-summary
R3 (config-router) #network 192.168.6.0


R4 (config) #int fa0/0
R4 (config-if) #ip os 100 area 2
R4 (config) #int s0/0
R4 (config-if) #ip os 100 area 0
R4 (config) #int s0/1
R4 (config-if) #ip os 100 area 2


R5 (config) #int s0/0
R5 (config-if) #ip os 100 area 2
R5 (config-if) #router ei 200
R5 (config-router) #no auto-summary
R5 (config-router) #network 192.168.105.0
R5 (config-router) #network 192.168.5.0


R6 (config-if) #router ei 200
R6 (config-router) #no auto-summary
R6 (config-router) #network 0.0.0.0


R7 (config-if) #router ei 200
R7 (config-router) #no auto-summary
R7 (config-router) #network 0.0.0.0


R3#sh ip route

Now we want to communicate OSPF domain with ei 100 domain.

For that we will perform here redistribution

R3 (config) #router os 100
R3 (config-router) #redistribute ei 100 subnets metric-type 1
R3 (config-router) #router ei 100
R3 (config-router) #redistribute os 100 metric 1 1 1 1 1

We performed here two way of redistribution.

Here we can see two types of routes

First is intra area (which belongs to its area)

OIA means Inter area
E – External Area

Now our task is configure area 1 is as stub.

R1 (config) #router os 100
R1 (config-router) #area 1 stub


R2 (config) #router os 100
R2 (config-router) #area 1 stub

Requirements for stub area

  1. Virtual links are not allowed.
  2. Area 0 can’t be stub.
  3. All the routers must be agree that we are a part of stub area. If you are configuring R1, that area 1 is stub so it is your duty you have to configure R2 that area 1 is stub, if you will not configure, neighborship will not established.

R1#sh ip route os
R1#ping 172.70.1.1 source fa0/0
Successful


R2 #sh ip route

It contains entire ospf routes.

Now we will see totally stub, it filters the external routes and inter area routes, and places them as a default route.

R2 (config) #router os 100
R2 (config) #area 1 stub no-summary


R1#sh ip route os

We can see small routing table here

R5#sh ip route os
R5 (config) #router os 100
R5 (config-router) #area 2 stub


R4 (config) #router os 100
R4 (config-router) #area 2 stub no-summary


R5#sh ip route os
R5#ping 192.168.101.1 source s0/0
successful

Now we will perform redistribution on R5

R5 (config) #router os 100
R5 (config-router) #redistribute ei 200 subnets metric-type 1
R5 (config) #router ei 200
R5 (config-router) #redistribute os 100 metric 1 1 1 1 1


R3#sh ip route

Here we cannot see 172.60.0.0 routes

Now we will configure NSSA

First we need to remove this command here

R4 (config) #router os 100
R4 (config-router) #no area 2 stub


R5 (config) #router os 100
R5 (config-router) #no area 2 stub

If we will remove stub command totally stub command will removed automatically.

R4 (config) #router os 100
R4 (config-router) #area 2 nssa


R5 (config) #router os 100
R5 (config-router) #area 2 nssa


R3#sh ip route

Here we can see

O E 1 – 172.60.1.0 to 5
R7#sh ip route ei

Here we can see this route 172.60.1.0 to 5

R4#sh ip route os

It contain 70 series here 172.70.0.0

R5#sh ip route os

It doesn’t contain the route of 172.70.0.0

R5#ping 172.70.1.1
not successful

Now we will configure Totally NSSA on R4

R4 (config) #router os 100
R4 (config-router) #area 2 nssa no-summary default-information-originate


R5#ping 172.70.1.1
successful


R6#ping 172.70.1.1
successful
R6#ping 172.70.1.1 source fa0/0
successful

Now we will remove stub and totally stub from area 1

R1 (config) #router os 100
R1 (config-router) #no area 1 stub


R2 (config) #router os 100
R2 (config-router) #no area 1 stub

Now here we will provide the internet access on all routers. R3 is directly connected with the ISP router.

R3#ping 101.1.1.1 successful
R3#ping 102.1.1.1 not successful

Now we will create default route on R3 towards ISP

R3 (config) #Ip route 0.0.0.0 0.0.0.0 101.1.1.1
R3#ping 102.1.1.1 successful
R3#ping 101.1.1.1 successful

Here R3 is able to communicate with the ISP

R3#ping 102.1.1.1 source fa0/0
not successful.
R3 (config) #int s0/0
R3 (config-if) #ip nat inside
R3 (config-if-nat) #int s0/1
R3 (config-if) #ip nat inside
R3 (config-if-nat) #int s0/2
R3 (config-if) #ip nat inside
R3 (config-if-nat) #int s0/3
R3 (config-if) #ip nat outside
R3 (config-if-nat) #int f0/0
R3 (config-if) #ip nat inside
R3 (config) #access-list 10 permit any
R3 (config-access) #ip nat inside source list 10 int s0/3 overload
R3#ping 102.1.1.1 source fa0/0 successful
R3#sh ip nat translation

Now we will provide the internet access to all areas.

R2#sh ip route

It hasn’t any default route so it can’t communicate with the internet.

R3 (config) #router os 100
R3 (config-router) #default-information originate always


R2 #sh ip route

Here we can see a default route O*E2 0.0.0.0/0

R1#piing 102.1.1.1 source fa0/0 successful

R6#ping 102.1.1.1 source loo1 successful

R7#ping 102.1.1.1 source loo1 not successful
R7#sh ip route

It doesn’t contain default route

R3 (config) #ip summary-address ei 100 0.0.0.0 0.0.0.0
R3#sh ip route
D* 0.0.0.0 / 0

Now we can see here default route.

R7#ping 102.1.1.1 source loo 1
successful

There are three ways to generate default route in EIGRP:

  1. Redistribution
  2. Summarization
  3. IP default network

Now here we will check LSAs.

R1#sh ip ospf database

Router LSA

Router LSA contains router ID of a router. It is sent within an area.

Router ID

  1. Highest Loop Back
  2. Highest Up Physical int IP
  3. Router ID

Here we can see two router ID

192.168.101.1
192.168.102.1

Network LSA

It contains DR router ID and it is sent by DR. DR & BDR are elected only in Broadcast and non-broadcast multi-access network. We have point to point link, so DR and BDR is not available. We will make forcefully it broadcast segment via command.

R1 (config) #int s0/0
R1 (config-if) #ip os network broadcast
R2 (config) #int s0/0
R2 (config-if) #ip os network broadcast
R1#sh ip os neighbor
R1#debug ip os adj
R1#clear ip os process
Yes
R1#un all

We can see first is Down state. Attempt state only happens in frame-realy. To check init we need to go on R2.

R2#debug ip os adj
R2#clear ip process
Yes
R2#un all

Here we can see init.

Network LSA

Contain DR ID. For DR:

  1. Highest router Priority
  2. Highest router ID

Router 2 is DR here.

Summary LSA

When a route of one area goes to another area they go as summary SLA. It is sent by ABR. Here R2 is ABR.

AS LSA

It contains ASBR router ID & it is sent by ABR. R3 is ASBR here.

External LSA

It contains External routes. It is sent by ASBR.
172.70 series sending R3
172.60 series sending R4

Group Membership LSA

It is not supported by cisco.

NSSA

It allows an ASBR to send external area through stub area to backbone area using LSA 7.

R5#sh ip os database
R4#sh ip os database


R3#sh ip os database

Leave a Reply