OSPF Configuration : How To Configure OSPF ?

advanced ospf config

In this article we will make an example for “advanced OSPF configuration”. We talked about OSPF basics and made an OSPF configuration for beginners on our course. Now it is time to go deep and combine virtual link, LSA types and etc. in one example ! Let’s see how we can configure OSPF.

ospf configuration

1) Configure OSPF for the topology abnove. Redistribute the static routes on R1 as type E1 to inject the external routes into OSPF domain.

2) OSPF adjacency mustn’t established if there is no OSPF router.

3) Routers  in Area 0 must be configured with MD5 , Routers in Area 23 must be configured with  clear-text authentication ( Keys : cisco )

4) Routers in Area 45 should not receive the external routes out of OSPF domain, these routers must reach the external network via default route which is not static.

5) Routers in Area 23 mustn’t receive Type 3-4-5 LSAs. These routers must reach the external network via default route which hasa a cost of 100.

6) All routers must ping together.

Let’s take a look to configuring OSPF now. We assume that all basic configurations are made for example ;

R7(config)# router ospf 1
R7(config-router)#router –id 7.7.7.7
R7(config-router)#network 10.67.1.0  0.0.0.255 area 67
R7(config-router)#network 10.78.1.0  0.0.0.255 area 78
R1(config)# ip route 172.31.0.0  255.255.255.0 null 0
R1(config)# ip route 172.31.1.0  255.255.255.0 null 0

                      …
R1(config)#router ospf 1
R1(config-router)#router- id 1.1.1.1
R1(config-router)#network 10.100.1.0  0.0.0255 area 0

R7# sh ip route
c 10.78.1.0 is directly  connected

.
.

Router 7 has all routes on the routing table but router 8 can’t have them because of it has not a connection with Area 0.

R1(config)#router ospf 1
R1(config-router)#redistribute static subnets metric-type 1 metric 50           //  E1 type route which has a metric of 50 //
R1(config-router)#passive-interface default
R1(config-router)#no passive-interface f 0/0
R2(config)#router ospf 1
R2(config-router)#passive-interface default
R2(config-router)#no passive-interface f 0/0
R2(config-router)#no passive-interface s 0/0
The commands above must be implemented on other routers too. Passive interface commands are used because Step - 2 of the question requires that "OSPF adjacency mustn't established if there is no OSPF router.

R1(config)# int f 0/0
R1(config-if)#ip ospf auth message-digest
R1(config-if)#ip ospf message-digest-key 1 md5 cisco
R2(config)# int f 0/0
R2(config-if)#ip ospf auth message-digest
R2(config-if)#ip ospf message-digest-key 1 md5 cisco

MD 5 configuration is implemented like this which is wanted at Step 3 of the question. As you see md5 keys are “cisco”.

R4()# .. same commands
R6()#.. same commands

We can check the OSPF adjacency with “debug ip ospf adj” command.

R2(config)#int s 0/0
R2(config-if)#ip ospf authentication 
R2(config-if)#ip ospf authentication-key cisco
R3(config)#int s 0/0
R3(config-if)#ip ospf authentication 
R3(config-if)#ip ospf authentication-key cisco

Clear text authentication configuration is implemented like this which is wanted at Step 3 of the question. As you see, keys are “cisco”.
To not to receive routes coming from ASBR (stubby area):

R4(config)#router ospf 1
R4(config-router)#area 45 stub
R5(config)#router ospf 1
R5(config-router)#area 45 stub

If stub configurations are made just for Router 4 , OSPF adj. is down, because we should configure Router 5 too…

R5#sh ip route
O*IA 0.0.0.0/0 via 10.45.1.4

(O*IA comes to routing table instead of E1 router)

External routes continue to exist on Routing 4’s routing table because of it is ABR

Totally stub area:

R2(config)#router ospf 1
R2(config-router)#area 23 stub no-summary
R3(config)#router ospf 1
R3(config-router)#area 23 stub
R3(config-router)#area 23 default cost 100

Virtual link between R6 and R7  :

R6(config)#router ospf 1
R6(config-router)#area 67 virtual link 7.7.7.7

R7(config)#router ospf 1
R7(config-router)#area 67 virtual link 7.7.7.7

Router 8 thinks that router 7 is directly connected to Area 0 with this virtual link commands.

If you can understand this example you can easily do any OSPF configuration too !

2 thoughts on “OSPF Configuration : How To Configure OSPF ?

Leave a Reply

Your email address will not be published. Required fields are marked *