OSPF
OSPF stands for Open Shortest Path First.
OSPF is a link state routing protocol. The word ‘Open’ means it is an open source routing protocol, all routers from different brand has ability to operate OSPF.
Shortest Path First means for itself, it always try to find the best path. OSPF determine their best path by calculate the cost from available links with formula: 10^8 / bandwith [bps]. Or the administrator can setup explicitly the cost with this command: router(config-if)# ip ospf cost number. The lowest cost is the best path chosen by OSPF. For example, if there is two links available on router running OSPF, first link’s cost is 1, second link’s cost is 10, then the best path is the first link.
Each router in OSPF area has its own view to all the network topology. They multicast hello packet, known as hello mechanism. With 224.0.0.5 sent by OSPF network to DR (Designated Router) and BDR (Backup Designated Router) and 224.0.0.6 sent by DR and BDR to OSPF network. Resulting fast convergence times for each router in that area.Click ospf.jpg to see image
scenario:
Router-1:
E0/1 192.168.1.1/24
S0/1 172.16.15.5/30 DCE
Lo1 1.1.1.1/24
Router-2:
S0/1 10.15.21.9/30 DCE
Lo2 2.2.2.2/24
Router-3:
S0/1 100.100.1.9/30 DCE
Lo3 3.3.3.3/24
Router-4:
S0/1 128.128.1.5/30 DCE
Lo4 4.4.4.4/24
Router-5:
Lo5 5.5.5.5/24
Router-1 is connected to access-point 192.168.1.11/24 inside the LAN there is one PC availabe with IP address 192.168.1.12/24.
Setup this topology with OSPF single area!
console:
Router-1:
router> enable
router# conf t
router(config)# hostname Router-1
Router-1(config)# enable password pass
Router-1(config)# service password-encryption
Router-1(config)# enable secret passwd
Router-1(config)# banner motd #
—!!! Router-1 Restricted Shell !!!—#
Router-1(config)# line vty 0 4
Router-1(config-line)# password telnet
Router-1(config-line)# login
Router-1(config-line)# exit
Router-1(config)# int e0/1
Router-1(config-if)# ip address 192.168.1.1 255.255.255.0
Router-1(config-if)# no shut
Router-1(config-if)# exit
Router-1(config)# int s0/1
Router-1(config-if)# ip address 172.16.15.5 255.255.255.252
Router-1(config-if)# clock rate 64000
Router-1(config-if)# no shut
Router-1(config-if)# exit
Router-1(config)# int loopback 1
Router-1(config-if)# ip address 1.1.1.1 255.255.255.0
Router-1(config-if)# no shut
Router-1(config-if)# exit
Router-1(config)# router ospf 5
Router-1(config-router)# network 172.16.15.4 0.0.0.3 area 0
Router-1(config-router)# network 192.168.1.0 0.0.0.255 area 0
Router-1(config-router)# network 1.1.1.0 0.0.0.255 area 0
Router-1(config-router)# ^Z
Router-1#
Router-2:
router> enable
router# conf t
router(config)# hostname Router-2
Router-2(config)# enable password pass
Router-2(config)# service password-encryption
Router-2(config)# enable secret passwd
Router-2(config)# banner motd #
—!!! Router-2 Restricted Shell !!!—#
Router-2(config)# line vty 0 4
Router-2(config-line)# password telnet
Router-2(config-line)# login
Router-2(config-line)# exit
Router-2(config)# int s0/0
Router-2(config-if)# ip address 172.16.15.6 255.255.255.252
Router-2(config-if)# no shut
Router-2(config-if)# exit
Router-2(config)# int s0/1
Router-2(config-if)# ip address 10.15.21.9 255.255.255.252
Router-2(config-if)# clock rate 64000
Router-2(config-if)# no shut
Router-2(config-if)# exit
Router-2(config)# int loopback 2
Router-2(config-if)# ip address 2.2.2.2 255.255.255.0
Router-2(config-if)# no shut
Router-2(config-if)# exit
Router-2(config)# router ospf 5
Router-2(config-router)# network 172.16.15.4 0.0.0.3 area 0
Router-2(config-router)# network 10.15.21.8 0.0.0.3 area 0
Router-2(config-router)# network 2.2.2.0 0.0.0.255 area 0
Router-2(config-router)# ^Z
Router-2#
Router-3:
router> enable
router# conf t
router(config)# hostname Router-3
Router-3(config)# enable password pass
Router-3(config)# service password-encryption
Router-3(config)# enable secret passwd
Router-3(config)# banner motd #
—!!! Router-3 Restricted Shell !!!—#
Router-3(config)# line vty 0 4
Router-3(config-line)# password telnet
Router-3(config-line)# login
Router-3(config-line)# exit
Router-3(config)# int s0/0
Router-3(config-if)# ip address 10.15.21.10 255.255.255.252
Router-3(config-if)# no shut
Router-3(config-if)# exit
Router-3(config)# int s0/1
Router-3(config-if)# ip address 100.100.1.9 255.255.255.252
Router-3(config-if)# clock rate 64000
Router-3(config-if)# no shut
Router-3(config-if)# exit
Router-3(config)# int loopback 3
Router-3(config-if)# ip address 3.3.3.3 255.255.255.0
Router-3(config-if)# no shut
Router-3(config-if)# exit
Router-3(config)# router ospf 5
Router-3(config-router)# network 10.15.21.8 0.0.0.3 area 0
Router-3(config-router)# network 100.100.1.8 0.0.0.252 area 0
Router-3(config-router)# network 3.3.3.0 0.0.0.255 area 0
Router-3(config-router)# ^Z
Router-3#
Router-4:
router> enable
router# conf t
router(config)# hostname Router-4
Router-4(config)# enable password pass
Router-4(config)# service password-encryption
Router-4(config)# enable secret passwd
Router-4(config)# banner motd #
—!!! Router-4 Restricted Shell !!!—#
Router-4(config)# line vty 0 4
Router-4(config-line)# password telnet
Router-4(config-line)# login
Router-4(config-line)# exit
Router-4(config)# int s0/0
Router-4(config-if)# ip address 100.100.1.10 255.255.255.252
Router-4(config-if)# no shut
Router-4(config-if)# exit
Router-4(config)# int s0/1
Router-4(config-if)# ip address 128.128.1.5 255.255.255.252
Router-4(config-if)# no shut
Router-4(config-if)# exit
Router-4(config)# int loopback 4
Router-4(config-if)# ip address 4.4.4.4 255.255.255.0
Router-4(config-if)# no shut
Router-4(config-if)# exit
Router-4(config)# router ospf 5
Router-4(config-router)# network 100.100.1.8 0.0.0.3 area 0
Router-4(config-router)# network 128.128.1.4 0.0.0.3 area 0
Router-4(config-router)# network 4.4.4.0 0.0.0.255 area 0
Router-4(config-router)# ^Z
Router-4#
Router-5:
router> enable
router# conf t
router(config)# hostname Router-5
Router-5(config)# enable password pass
Router-5(config)# service password-encryption
Router-5(config)# enable secret passwd
Router-5(config)# banner motd #
—!!! Router-5 Restricted Shell !!!—#
Router-5(config)# line vty 0 4
Router-5(config-line)# password telnet
Router-5(config-line)# login
Router-5(config-line)# exit
Router-5(config)# int s0/0
Router-5(config-if)# ip address 128.128.1.6 255.255.255.252
Router-5(config-if)# no shut
Router-5(config-if)# exit
Router-5(config)# int loopback 5
Router-5(config-if)# ip loopback 5.5.5.5 255.255.255.0
Router-5(config-if)# no shut
Router-5(config-if)# exit
Router-5(config)# router ospf 5
Router-5(config-router)# network 128.128.1.4 0.0.0.3 area 0
Router-5(config-router)# network 5.5.5.0 0.0.0.255 area 0
Router-5(config-router)# ^Z
Router-5#

