OSPF on Cisco routers - example 1- one area network

(broadcast network)

 

 ospf-1-1.png

 

  • Configure interfaces

R1

 (config)#interface fa0/0

 (config-if)ip address 172.16.1.1 255.255.255.0

  (config-if) no shutdown

(config)#interface fa0/1

(config-if)ip address 192.168.1.1 255.255.255.0

(config-if) no shutdown

(config)#hostname R1

#wr

 

R2

(config)#interface fa0/0

(config-if)ip address 172.16.1.2 255.255.255.0

 (config-if) no shutdown

 (config)#interface fa0/1

 (config-if)ip address 192.168.2.1 255.255.255.0

 (config-if) no shutdown

(config)#hostname R2

#wr

 

R3

 (config)#interface fa0/0

 (config-if)ip address 172.16.1.3 255.255.255.0

 (config-if) no shutdown

 (config)#interface fa0/1

 (config-if)ip address 192.168.3.1 255.255.255.0

  (config-if) no shutdown

 (config)#hostname R3

#wr

  • configure ospf on routers

R1

 - enable ospf on router

(config)#router ospf 1

ospf proces can have different ID on any routers

 - set router-id(optional)

(config-router)#router-id 1.1.1.1

if you do not set router-id OSPF will choose the highest ip of any "up" loopback interfaces and if you do not have loopback interfaces configured it will choose the highest ip of "up" non-loopback interfaces.

It is best practise to configure router-id for clear configuration.

  - enable ospf for particular network

(config-router)#network 192.168.1.0 0.0.0.255 area 0

(config-router)#network 172.16.1.0 0.0.0.255 area 0

(config-router)#exit

network statement is critical - it says router which networks to advertise and on which interfaces set up neighbourships

R2

 (config)#router ospf 2

 (config-router)#router-id 2.2.2.2

 (config-router)#network 172.16.1.0 0.0.0.255 area 0

(config-router)#network 192.168.2.0 0.0.0.255 area 0

(config-router)#exit

 R3

  (config)#router ospf 3

 (config-router)#router-id 3.3.3.3

 (config-router)#network 172.16.1.0 0.0.0.255 area 0

(config-router)#network 192.168.3.0 0.0.0.255 area 0

(config-router)#exit

  •  check if neighbours are up

R3#show ip ospf neighbour

 ospf-1-2a.png

 ospf-1-2b.png

ospf-1-2c.png

from output above we can identify which router is designated router and which one is backup designated router for this ethernet segment

 1.1.1.1 is DR

 3.3.3.3 is BDR

to confirm type command on R1 and/or  on R2,R3

R1#sh ip ospf interface fastEthernet 0/0

ospf-1-3a.png

R2#sh ip ospf interface fastEthernet 0/0

ospf-1-3b.png

R3#sh ip ospf interface fastEthernet 0/0

ospf-1-3c.png

  •  check routing table and connectivity between networks

R3#show ip route

 ospf-1-4.png

  •  check OSPF databases (LSA)

ospf-1-5.png

 

LSA1 - router

one per router,listing router-ID and all interface IP address(in our case router-id).

LSA2 - network

one per transit network,created by DR. It represents subnet and the router interfaces connected to subnet.

 

dzbanek 2012-11-05

This site uses cookies. Some of the cookies we use are essential for parts of the site to operate and have already been set. You may delete and block all cookies from this site, but parts of the site will not work.