3.9 OSPF (Open Shortest Path First Version 2) Part 1: Configuration and Router-ID

Happy New year Mate! We are moving on my most favorite routing protocol—- OSPF. I can still remember during the technical interview, I was asked what is my most favorite routing protocol and why? Since the only routing protocol which was fresh in my mind during that time is OSPF, I answered OSPF because blah blah blah. A follow-up question came along—> how OSPF works? To make the long story short, OSPF saved my ass. And that is my story about my most favorite routing protocol.

Too much for introduction, below will be the trivial information that you need to know about OSPF.

1.) link-state protocol( we will discuss this later)

2.) Administrative distance of 110- just a recap administrative distance is the reference of the router which protocol router should follow in the event that there are multiple protocols running on it.

3.) Metric–> cost, in the event that there are multiple paths going to a specific host, cost  of the ospf operated router will serve as the reference of the router. The lower the cost, the more the router will follow that path.

4.)Dynamic routing protocol- all of the other routing protocols that we will be discussing are dynamic routing protocol. Dynamic routing protocols are protocols that will adapt for  any network changes. Lets’s say link 1 fails, you don’t have to manually reconfigure the device just to troubleshoot the network failure.

***********************************************************************

SYNTAX AND CONFIGURATION:

You wonder why we proceed already with the configuration without knowing the concept or how ospf works? –> because it will be better if we will see the terminologies involved and how it will affect the network.Also, we will just do the basic configuration, addendum will follow to explain their functions.

–> I preferred to it this way for easy explanation and to avoid redundancy.

SYNTAX:

en
conf t
router ospf {Process #}
network { directly connected network address} {wildcard mask}(mandatory) {area#}
exit

Lemme explain the syntax first

1.) Process # – it wont hurt much the network whether devices have different routing process, it’s just part of the syntax.

2.) Directly connected network address – when you do ” show ip route” on a specific router, we will include all network address listed.

3.) Wildcard mask- It is exact opposite of subnet mask. It gives the same concept to be more specific of the network. The reason why there are two concepts like subnet mask and wildcard mask though they function almost the same is because using wildcard mask will gives faster decoding because of logical functions used e.g. NAND, AND.

4.) Area #–> we will deal further with area # but one thing to remember is that interfaces that face each other should have the same area#

Network topology below( same topology as static configuration):

0101a.PNG

initial configuration:

@ BPO_MAIN_BLDG_1

enable
conf t
line console 0
password cisco
logging sync
exec-timeout 20 30
login
exit
line vty 0 15
password cisco
logging sync
exec-timeout 20 30
login
exit
hostname BPO_MAIN_BLDG_1
enable secret class
service password-encryption
no ip domain-lookup
banner motd “AUTHORIZED ACCESS ONLY”
do wr

@BPO_MAIN_BLDG_2

enable
conf t
line console 0
password cisco
logging sync
exec-timeout 20 30
login
exit
line vty 0 15
password cisco
logging sync
exec-timeout 20 30
login
exit
hostname BPO_MAIN_BLDG_2
enable secret class
service password-encryption
no ip domain-lookup
banner motd “AUTHORIZED ACCESS ONLY”
do wr
@BPO_MAIN

enable
conf t
line console 0
password cisco
logging sync
exec-timeout 20 30
login
exit
line vty 0 15
password cisco
logging sync
exec-timeout 20 30
login
exit
hostname BPO_MAIN
enable secret class
service password-encryption
no ip domain-lookup
banner motd “AUTHORIZED ACCESS ONLY”
do wr

@BPO_BRANCH
enable
conf t
line console 0
password cisco
logging sync
exec-timeout 20 30
login
exit
line vty 0 15
password cisco
logging sync
exec-timeout 20 30
login
exit
hostname BPO_BRANCH
enable secret class
service password-encryption
no ip domain-lookup
banner motd “AUTHORIZED ACCESS ONLY”
do wr
@BPO_BRANCH_ANNEX_1
enable
conf t
line console 0
password cisco
logging sync
exec-timeout 20 30
login
exit
line vty 0 15
password cisco
logging sync
exec-timeout 20 30
login
exit
hostname BPO_BRANCH_ANNEX_1
enable secret class
service password-encryption
no ip domain-lookup
banner motd “AUTHORIZED ACCESS ONLY”
do wr
@BPO_BRANCH_ANNEX-2
enable
conf t
line console 0
password cisco
logging sync
exec-timeout 20 30
login
exit
line vty 0 15
password cisco
logging sync
exec-timeout 20 30
login
exit
hostname BPO_BRANCH_ANNEX-2
enable secret class
service password-encryption
no ip domain-lookup
banner motd “AUTHORIZED ACCESS ONLY”
do wr
***************************
@ main bldg 1

en
conf t
int se 3/0
ip add 200.0.0.1 255.255.255.252
no shut
exit
int se 2/0
ip address 200.0.0.17 255.255.255.252
no shut
exit

@main bldg 2
en
conf t
int se 2/0
ip add 200.0.0.18 255.255.255.252
shut
no shut
exit
int se 3/0
ip add 200.0.0.5 255.255.255.252
shut
no shut
exit

@ BPO_MAIN

en
conf t
int se 6/0
ip add 200.0.0.2 255.255.255.252
no shut
exit
int se 7/0
ip add 200.0.0.6 255.255.255.252
no shut
exit
int se 2/0
ip add 200.0.0.25 255.255.255.252
no shut
exit
int se 3/0
ip add 200.0.0.29 255.255.255.252
no shut
exit
int fa 0/0
no shut
exit

@ BPO_BRANCH

en
conf t
int se 2/0
ip add 200.0.0.26 255.255.255.252
no shut
exit
int se 3/0
ip add 200.0.0.30 255.255.255.252
no shut
exit
int se 6/0
ip add 200.0.0.9 255.255.255.252
no shut
exit
int se 7/0
ip add 200.0.0.13 255.255.255.252
no shut
exit
int fa 0/0
no shut
exit
@bpo annex 1

en
conf t
int se 2/0
ip add 200.0.0.10 255.255.255.252
no shut
exit
int se 3/0
ip add 200.0.0.21 255.255.255.252
no shut
exit
int gigabitEthernet7/0
no shut
exit

@bpo annex 2

en
conf t
int se 2/0
ip add 200.0.0.14 255.255.255.252
no shut
exit
int se 3/0
ip add 200.0.0.22 255.255.255.252
no shut
exit
int gigabitEthernet 8/0
no shut
exit

Additional configuration:

we will configure the speed of the link

First let us check  the link of serial 6/0 of router 3, it is part of link 1 which must have 4096 kbps of speed.

0101b.PNG

R1 is already configured with the ff syntax:

conf t
int se 3/0
bandwidth 4096
exit
conf t
int se 2/0
bandwidth 3072
exit

0101c

R3 configuration:

conf t
int se 6/0
bandwidth 4096
exit
int se 7/0
bandwidth 2048
exit
int se 2/0
bandwidth 4096
exit
int se 3/0
bandwidth 6144
exit

0101d.PNG

There you go, we achieved the 4096 link speed requirement.

the continuation of  config:

@R1
conf t
int se 3/0
bandwidth 4096
exit
conf t
int se 2/0
bandwidth 3072
exit

@R2
conf t
int se 2/0
bandwidth 3072
exit
int se 3/0
bandwidth 2048
exit

@ R3
conf t
int se 6/0
bandwidth 4096
exit
int se 7/0
bandwidth 2048
exit
int se 2/0
bandwidth 4096
exit
int se 3/0
bandwidth 6144
exit

@ R4
conf t
int se 2/0
bandwidth 4096
exit
int se 3/0
bandwidth 6144
exit
int se 6/0
bandwidth 1024
exit
int se 7/0
bandwidth 4096
exit

@ R5
conf t
int se 2/0
bandwidth 1024
exit
int se 3/0
bandwidth 3072
exit

@R6
conf t
int se 2/0
bandwidth 4096
exit
int se 3/0
bandwidth 3072
exit

 

*************************OSPF CONFIG***********************************

set process# as 100

area as area 0

 

0101e.PNG

verify:

0101f.PNGNo OSPF yet on routing table because neighbor relationship is not yet established on other routers

0101g.PNG

0101h

Aha! no ospf was establishe but, there is a highlighted notification sent

let’s try to verify once again after that notification appeared

0101i

There you go, OSPF was established, and we will analyze the highlighted network, we observed that the cost is 110 , which is the default cost, and the metric is 56. Also it was learned by the router by the help of 200.0.0.17

0101j.PNG

0101k.PNG

0101l.PNG

0101m.PNG

Actually, it takes me more than 6 seconds to see this routing table.

Also,let us check R3 once again:

0101n.PNG

0101o.PNG

0101p.PNG

Let’try the last router

0101p.PNG

0101q.PNG

Let us try to check once again the routing table of R1

0101r.PNG

************OSPF CONFIGURATION*********************
@R1
conf t
router ospf 100
network 200.0.0.0 0.0.0.3 area 0
network 200.0.0.16 0.0.0.3 area 0
exit

do sh ip route

@R2
conf t
router ospf 100
network 200.0.0.4 0.0.0.3 area 0
network 200.0.0.16 0.0.0.3 area 0
exit
do sh ip route

@R3

conf t
router ospf 100
network 200.0.0.0 0.0.0.3 area 0
network 200.0.0.4 0.0.0.3 area 0
network 200.0.0.24 0.0.0.3 area 0
network 200.0.0.28 0.0.0.3 area 0
exit
do sh ip route

@R4

conf t
router ospf 100
network 200.0.0.8 0.0.0.3 area 0
network 200.0.0.12 0.0.0.3 area 0
network 200.0.0.24 0.0.0.3 area 0
network 200.0.0.28 0.0.0.3 area 0
exit
do sh ip route

@ R5
conf t
router ospf 100
network 200.0.0.8 0.0.0.3 area 0
network 200.0.0.20 0.0.0.3 area 0
exit
do sh ip route

@R6
conf t
router ospf 100
network 200.0.0.12 0.0.0.3 area 0
network 200.0.0.20 0.0.0.3 area 0
exit
do sh ip route

let’s try ping from

R1 to R6

R5 to R2

0101s.PNG

0101t.PNG

And there you go, we got successful ping from right side to left side and vice versa. I haven’t include the inital ping image awhile ago to show the differences. Logically, this is just the configuration of OSPF. And now, we will check one important concept in OSPF—> router-id.

Verify:

sh ip protocols

0101u.PNG

Routing information sources listed and highlighted above are the router-id that I am telling you.

Did we configure those highlighted IP address above during the ospf configuration?

no!

How did router chose those IP address?

We will check it on the next part of the OSPF series.

************************END OF BLOG************************************

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s