Open Shortest Path First (OSPF)
Open Shortest Path First (OSPF) is also a routing protocol which works under the Link State Routing (LSR) Algorithm. The major advantage of Open Shortest Path First (OSPF) is that it can detect the changes in topology such as Link Failures or Data Load on Link with the help of which it calculates the other shortest path with the help of algorithm named Dijkstra Algorithm.
Open Shortest Path First (OSPF) is categorized in two parts
- Single Area OSPF (Open Shortest Path First)
- Multi Area OSPF (Open Shortest Path First)
Single Area OSPF
In Single Area OSPF all the network lies under the same area.
Multi Area OSPF
In Multi Area OSPF there are more than one areas containing some networks in them.
Configurations of Single Area OSPF
DEVICE | INTERFACE | IP ADDRESS | SUBNETMASK |
---|---|---|---|
TestRouter1 | gigabitEthernet 0/0 | 192.168.1.1 | 255.255.255.0 |
gigabitEthernet 0/1 | 192.168.2.1 | 255.255.255.0 | |
serial 0/0/0 | 172.16.1.1 | 255.255.255.252 | |
serial 0/0/1 | 172.16.1.5 | 255.255.255.252 | |
TestRouter2 | gigabitEthernet 0/0 | 192.168.3.1 | 255.255.255.0 |
gigabitEthernet 0/1 | 192.168.4.1 | 255.255.255.0 | |
serial 0/0/0 | 172.16.1.6 | 255.255.255.252 | |
serial 0/0/1 | 172.16.1.9 | 255.255.255.252 | |
TestRouter3 | gigabitEthernet 0/0 | 192.168.5.1 | 255.255.255.0 |
gigabitEthernet 0/1 | 192.168.6.1 | 255.255.255.0 | |
serial 0/0/0 | 172.16.1.10 | 255.255.255.252 | |
serial 0/0/1 | 172.16.1.13 | 255.255.255.252 | |
TestRouter4 | gigabitEthernet 0/0 | 192.168.7.1 | 255.255.255.0 |
gigabitEthernet 0/1 | 192.168.8.1 | 255.255.255.0 | |
serial 0/0/0 | 172.16.1.2 | 255.255.255.252 | |
serial 0/0/1 | 172.16.1.14 | 255.255.255.252 | |
PC0 | Fa0 | 192.168.1.2 | 255.255.255.0 |
PC1 | Fa0 | 192.168.2.2 | 255.255.255.0 |
PC2 | Fa0 | 192.168.3.2 | 255.255.255.0 |
PC3 | Fa0 | 192.168.4.2 | 255.255.255.0 |
PC4 | Fa0 | 192.168.5.2 | 255.255.255.0 |
PC5 | Fa0 | 192.168.6.2 | 255.255.255.0 |
PC6 | Fa0 | 192.168.7.2 | 255.255.255.0 |
PC7 | Fa0 | 192.168.8.2 | 255.255.255.0 |
Test Router 1
Router>enable
Router#configure terminal
Router(config)#hostname TestRouter1
TestRouter1(config)#enable password cisco (Plain Text Password)
TestRouter1(config)#enable secret class (Enycrypted Password)
TestRouter1(config)#username TestRouter secret csico
TestRouter1(config)#ip domain-name cisco.com
TestRouter1(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter1(config)#line console 0
TestRouter1(config-line)#password cisco
TestRouter1(config-line)#login
TestRouter1(config-line)#exit
TestRouter1(config)#line vty 0 4
TestRouter1(config-line)#transport input ssh
TestRouter1(config-line)#login local
TestRouter1(config-line)#exit
TestRouter1(config)#interface gigabitEthernet 0/0
TestRouter1(config-if)#ip address 192.168.1.1 255.255.255.0
TestRouter1(config-if)#no shutdown
TestRouter1(config-if)#exit
TestRouter1(config)#interface gigabitEthernet 0/1
TestRouter1(config-if)#ip address 192.168.2.1 255.255.255.0
TestRouter1(config-if)#no shutdown
TestRouter1(config-if)#exit
TestRouter1(config)#interface serial 0/0/0
TestRouter1(config-if)#ip address 172.16.1.1 255.255.255.252
TestRouter1(config-if)#no shutdown
TestRouter1(config-if)#exit
TestRouter1(config)#interface serial 0/0/1
TestRouter1(config-if)#ip address 172.16.1.5 255.255.255.252
TestRouter1(config-if)#no shutdown
TestRouter1(config-if)#exit
TestRouter1(config)#router ospf 1
TestRouter1(config-router)#router-id 1.1.1.1
TestRouter1(config-router)#network 192.168.1.0 0.0.0.255 area 0
TestRouter1(config-router)#network 192.168.2.0 0.0.0.255 area 0
TestRouter1(config-router)#network 172.16.1.0 0.0.0.3 area 0
TestRouter1(config-router)#network 172.16.1.4 0.0.0.3 area 0
TestRouter1(config-router)#log-adjacency-changes
TestRouter1(config-router)#default-information originate
TestRouter1(config-router)#exit
TestRouter1(config)#exit
TestRouter1#copy running-config startup-config
Router#configure terminal
Router(config)#hostname TestRouter1
TestRouter1(config)#enable password cisco (Plain Text Password)
TestRouter1(config)#enable secret class (Enycrypted Password)
TestRouter1(config)#username TestRouter secret csico
TestRouter1(config)#ip domain-name cisco.com
TestRouter1(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter1(config)#line console 0
TestRouter1(config-line)#password cisco
TestRouter1(config-line)#login
TestRouter1(config-line)#exit
TestRouter1(config)#line vty 0 4
TestRouter1(config-line)#transport input ssh
TestRouter1(config-line)#login local
TestRouter1(config-line)#exit
TestRouter1(config)#interface gigabitEthernet 0/0
TestRouter1(config-if)#ip address 192.168.1.1 255.255.255.0
TestRouter1(config-if)#no shutdown
TestRouter1(config-if)#exit
TestRouter1(config)#interface gigabitEthernet 0/1
TestRouter1(config-if)#ip address 192.168.2.1 255.255.255.0
TestRouter1(config-if)#no shutdown
TestRouter1(config-if)#exit
TestRouter1(config)#interface serial 0/0/0
TestRouter1(config-if)#ip address 172.16.1.1 255.255.255.252
TestRouter1(config-if)#no shutdown
TestRouter1(config-if)#exit
TestRouter1(config-if)#ip address 172.16.1.5 255.255.255.252
TestRouter1(config-if)#no shutdown
TestRouter1(config-if)#exit
TestRouter1(config-router)#network 192.168.1.0 0.0.0.255 area 0
TestRouter1(config-router)#network 192.168.2.0 0.0.0.255 area 0
TestRouter1(config-router)#network 172.16.1.0 0.0.0.3 area 0
TestRouter1(config-router)#exit
TestRouter1(config)#exit
TestRouter1#copy running-config startup-config
Test Router 2
Router>enable
Router#configure terminal
Router(config)#hostname TestRouter2
TestRouter2(config)#enable password cisco (Plain Text Password)
TestRouter2(config)#enable secret class (Enycrypted Password)
TestRouter2(config)#username TestRouter secret csico
TestRouter2(config)#ip domain-name cisco.com
TestRouter2(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter2(config)#line console 0
TestRouter2(config-line)#password cisco
TestRouter2(config-line)#login
TestRouter2(config-line)#exit
TestRouter2(config)#line vty 0 4
TestRouter2(config-line)#transport input ssh
TestRouter2(config-line)#login local
TestRouter2(config-line)#exit
TestRouter2(config)#interface gigabitEthernet 0/0
TestRouter2(config-if)#ip address 192.168.3.1 255.255.255.0
TestRouter2(config-if)#no shutdown
TestRouter2(config-if)#exit
TestRouter2(config)#interface gigabitEthernet 0/1
TestRouter2(config-if)#ip address 192.168.4.1 255.255.255.0
TestRouter2(config-if)#no shutdown
TestRouter2(config-if)#exit
TestRouter2(config)#interface serial 0/0/0
TestRouter2(config-if)#ip address 172.16.1.6 255.255.255.252
TestRouter2(config-if)#no shutdown
TestRouter2(config-if)#exit
TestRouter2(config)#interface serial 0/0/1
TestRouter2(config-if)#ip address 172.16.1.9 255.255.255.252
TestRouter2(config-if)#no shutdown
TestRouter2(config-if)#exit
TestRouter2(config)#router ospf 1
TestRouter2(config-router)#router-id 2.2.2.2
TestRouter2(config-router)#network 192.168.3.0 0.0.0.255 area 0
TestRouter2(config-router)#network 192.168.4.0 0.0.0.255 area 0
TestRouter2(config-router)#network 172.16.1.4 0.0.0.3 area 0
TestRouter2(config-router)#network 172.16.1.8 0.0.0.3 area 0
TestRouter2(config-router)#log-adjacency-changes
TestRouter2(config-router)#default-information originate
TestRouter2(config-router)#exit
TestRouter2(config)#exit
TestRouter2#copy running-config startup-config
Router#configure terminal
Router(config)#hostname TestRouter2
TestRouter2(config)#enable password cisco (Plain Text Password)
TestRouter2(config)#enable secret class (Enycrypted Password)
TestRouter2(config)#username TestRouter secret csico
TestRouter2(config)#ip domain-name cisco.com
TestRouter2(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter2(config)#line console 0
TestRouter2(config-line)#password cisco
TestRouter2(config-line)#login
TestRouter2(config-line)#exit
TestRouter2(config)#line vty 0 4
TestRouter2(config-line)#transport input ssh
TestRouter2(config-line)#login local
TestRouter2(config-line)#exit
TestRouter2(config)#interface gigabitEthernet 0/0
TestRouter2(config-if)#ip address 192.168.3.1 255.255.255.0
TestRouter2(config-if)#no shutdown
TestRouter2(config-if)#exit
TestRouter2(config)#interface gigabitEthernet 0/1
TestRouter2(config-if)#ip address 192.168.4.1 255.255.255.0
TestRouter2(config-if)#no shutdown
TestRouter2(config-if)#exit
TestRouter2(config)#interface serial 0/0/0
TestRouter2(config-if)#ip address 172.16.1.6 255.255.255.252
TestRouter2(config-if)#no shutdown
TestRouter2(config-if)#exit
TestRouter2(config-if)#ip address 172.16.1.9 255.255.255.252
TestRouter2(config-if)#no shutdown
TestRouter2(config-if)#exit
TestRouter2(config)#router ospf 1
TestRouter2(config-router)#router-id 2.2.2.2
TestRouter2(config-router)#network 192.168.3.0 0.0.0.255 area 0
TestRouter2(config-router)#network 192.168.4.0 0.0.0.255 area 0
TestRouter2(config-router)#network 172.16.1.4 0.0.0.3 area 0
TestRouter2(config-router)#network 192.168.3.0 0.0.0.255 area 0
TestRouter2(config-router)#network 192.168.4.0 0.0.0.255 area 0
TestRouter2(config-router)#network 172.16.1.4 0.0.0.3 area 0
TestRouter2(config-router)#network 172.16.1.8 0.0.0.3 area 0
TestRouter2(config-router)#log-adjacency-changes
TestRouter2(config-router)#default-information originate
TestRouter2(config-router)#exit
TestRouter2(config-router)#exit
TestRouter2(config)#exit
TestRouter2#copy running-config startup-config
Test Router 3
Router>enable
Router#configure terminal
Router(config)#hostname TestRouter1
TestRouter3(config)#enable password cisco (Plain Text Password)
TestRouter3(config)#enable secret class (Enycrypted Password)
TestRouter3(config)#username TestRouter secret csico
TestRouter3(config)#ip domain-name cisco.com
TestRouter3(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter3(config)#line console 0
TestRouter3(config-line)#password cisco
TestRouter3(config-line)#login
TestRouter3(config-line)#exit
TestRouter3(config)#line vty 0 4
TestRouter3(config-line)#transport input ssh
TestRouter3(config-line)#login local
TestRouter3(config-line)#exit
TestRouter3(config)#interface gigabitEthernet 0/0
TestRouter3(config-if)#ip address 192.168.5.1 255.255.255.0
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#interface gigabitEthernet 0/1
TestRouter3(config-if)#ip address 192.168.6.1 255.255.255.0
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#interface serial 0/0/0
TestRouter3(config-if)#ip address 172.16.1.10 255.255.255.252
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#interface serial 0/0/1
TestRouter3(config-if)#ip address 172.16.1.13 255.255.255.252
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#router ospf 1
TestRouter3(config-router)#router-id 3.3.3.3
TestRouter3(config-router)#network 192.168.5.0 0.0.0.255 area 0
TestRouter3(config-router)#network 192.168.6.0 0.0.0.255 area 0
TestRouter3(config-router)#network 172.16.1.8 0.0.0.3 area 0
TestRouter3(config-router)#network 172.16.1.12 0.0.0.3 area 0
TestRouter3(config-router)#log-adjacency-changes
TestRouter3(config-router)#default-information originate
TestRouter3(config-router)#exit
TestRouter3(config)#exit
TestRouter3#copy running-config startup-config
Router>enable
Router#configure terminal
Router(config)#hostname TestRouter1
TestRouter3(config)#enable password cisco (Plain Text Password)
TestRouter3(config)#enable secret class (Enycrypted Password)
TestRouter3(config)#username TestRouter secret csico
TestRouter3(config)#ip domain-name cisco.com
TestRouter3(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter3(config)#line console 0
TestRouter3(config-line)#password cisco
TestRouter3(config-line)#login
TestRouter3(config-line)#exit
TestRouter3(config)#line vty 0 4
TestRouter3(config-line)#transport input ssh
TestRouter3(config-line)#login local
TestRouter3(config-line)#exit
TestRouter3(config)#interface gigabitEthernet 0/0
TestRouter3(config-if)#ip address 192.168.5.1 255.255.255.0
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#interface gigabitEthernet 0/1
TestRouter3(config-if)#ip address 192.168.6.1 255.255.255.0
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#interface serial 0/0/0
TestRouter3(config-if)#ip address 172.16.1.10 255.255.255.252
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#interface serial 0/0/1
TestRouter3(config-if)#ip address 172.16.1.13 255.255.255.252
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
Router#configure terminal
Router(config)#hostname TestRouter1
TestRouter3(config)#enable password cisco (Plain Text Password)
TestRouter3(config)#enable secret class (Enycrypted Password)
TestRouter3(config)#username TestRouter secret csico
TestRouter3(config)#ip domain-name cisco.com
TestRouter3(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter3(config)#line console 0
TestRouter3(config-line)#password cisco
TestRouter3(config-line)#login
TestRouter3(config-line)#exit
TestRouter3(config)#line vty 0 4
TestRouter3(config-line)#transport input ssh
TestRouter3(config-line)#login local
TestRouter3(config-line)#exit
TestRouter3(config)#interface gigabitEthernet 0/0
TestRouter3(config-if)#ip address 192.168.5.1 255.255.255.0
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#interface gigabitEthernet 0/1
TestRouter3(config-if)#ip address 192.168.6.1 255.255.255.0
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#interface serial 0/0/0
TestRouter3(config-if)#ip address 172.16.1.10 255.255.255.252
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#interface serial 0/0/1
TestRouter3(config-if)#ip address 172.16.1.13 255.255.255.252
TestRouter3(config-if)#no shutdown
TestRouter3(config-if)#exit
TestRouter3(config)#router ospf 1
TestRouter3(config-router)#router-id 3.3.3.3
TestRouter3(config-router)#network 192.168.5.0 0.0.0.255 area 0
TestRouter3(config-router)#network 192.168.6.0 0.0.0.255 area 0
TestRouter3(config-router)#network 172.16.1.8 0.0.0.3 area 0
TestRouter3(config-router)#network 192.168.5.0 0.0.0.255 area 0
TestRouter3(config-router)#network 192.168.6.0 0.0.0.255 area 0
TestRouter3(config-router)#network 172.16.1.8 0.0.0.3 area 0
TestRouter3(config-router)#network 172.16.1.12 0.0.0.3 area 0
TestRouter3(config-router)#log-adjacency-changes
TestRouter3(config-router)#default-information originate
TestRouter3(config-router)#exit
TestRouter3(config-router)#exit
TestRouter3(config)#exit
TestRouter3#copy running-config startup-config
TestRouter3#copy running-config startup-config
Test Router 4
Router>enable
Router#configure terminal
Router(config)#hostname TestRouter2
TestRouter4(config)#enable password cisco (Plain Text Password)
TestRouter4(config)#enable secret class (Enycrypted Password)
TestRouter4(config)#username TestRouter secret csico
TestRouter4(config)#ip domain-name cisco.com
TestRouter4(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter4(config)#line console 0
TestRouter4(config-line)#password cisco
TestRouter4(config-line)#login
TestRouter4(config-line)#exit
TestRouter4(config)#line vty 0 4
TestRouter4(config-line)#transport input ssh
TestRouter4(config-line)#login local
TestRouter4(config-line)#exit
TestRouter4(config)#interface gigabitEthernet 0/0
TestRouter4(config-if)#ip address 192.168.7.1 255.255.255.0
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#interface gigabitEthernet 0/1
TestRouter4(config-if)#ip address 192.168.8.1 255.255.255.0
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#interface serial 0/0/0
TestRouter4(config-if)#ip address 172.16.1.2 255.255.255.252
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#interface serial 0/0/1
TestRouter4(config-if)#ip address 172.16.1.14 255.255.255.252
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#router ospf 1
TestRouter4(config-router)#router-id 4.4.4.4
TestRouter4(config-router)#network 192.168.7.0 0.0.0.255 area 0
TestRouter4(config-router)#network 192.168.8.0 0.0.0.255 area 0
TestRouter4(config-router)#network 172.16.1.0 0.0.0.3 area 0
TestRouter4(config-router)#network 172.16.1.12 0.0.0.3 area 0
TestRouter4(config-router)#log-adjacency-changes
TestRouter4(config-router)#default-information originate
TestRouter4(config-router)#exit
TestRouter4(config)#exit
TestRouter4#copy running-config startup-config
Router>enable
Router#configure terminal
Router(config)#hostname TestRouter2
TestRouter4(config)#enable password cisco (Plain Text Password)
TestRouter4(config)#enable secret class (Enycrypted Password)
TestRouter4(config)#username TestRouter secret csico
TestRouter4(config)#ip domain-name cisco.com
TestRouter4(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter4(config)#line console 0
TestRouter4(config-line)#password cisco
TestRouter4(config-line)#login
TestRouter4(config-line)#exit
TestRouter4(config)#line vty 0 4
TestRouter4(config-line)#transport input ssh
TestRouter4(config-line)#login local
TestRouter4(config-line)#exit
TestRouter4(config)#interface gigabitEthernet 0/0
TestRouter4(config-if)#ip address 192.168.7.1 255.255.255.0
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#interface gigabitEthernet 0/1
TestRouter4(config-if)#ip address 192.168.8.1 255.255.255.0
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#interface serial 0/0/0
TestRouter4(config-if)#ip address 172.16.1.2 255.255.255.252
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
Router#configure terminal
Router(config)#hostname TestRouter2
TestRouter4(config)#enable password cisco (Plain Text Password)
TestRouter4(config)#enable secret class (Enycrypted Password)
TestRouter4(config)#username TestRouter secret csico
TestRouter4(config)#ip domain-name cisco.com
TestRouter4(config)#crypto key generate rsa
(Set key between 360 - 2048)
TestRouter4(config)#line console 0
TestRouter4(config-line)#password cisco
TestRouter4(config-line)#login
TestRouter4(config-line)#exit
TestRouter4(config)#line vty 0 4
TestRouter4(config-line)#transport input ssh
TestRouter4(config-line)#login local
TestRouter4(config-line)#exit
TestRouter4(config)#interface gigabitEthernet 0/0
TestRouter4(config-if)#ip address 192.168.7.1 255.255.255.0
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#interface gigabitEthernet 0/1
TestRouter4(config-if)#ip address 192.168.8.1 255.255.255.0
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#interface serial 0/0/0
TestRouter4(config-if)#ip address 172.16.1.2 255.255.255.252
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#interface serial 0/0/1
TestRouter4(config-if)#ip address 172.16.1.14 255.255.255.252
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config-if)#ip address 172.16.1.14 255.255.255.252
TestRouter4(config-if)#no shutdown
TestRouter4(config-if)#exit
TestRouter4(config)#router ospf 1
TestRouter4(config-router)#router-id 4.4.4.4
TestRouter4(config-router)#network 192.168.7.0 0.0.0.255 area 0
TestRouter4(config-router)#network 192.168.8.0 0.0.0.255 area 0
TestRouter4(config-router)#network 172.16.1.0 0.0.0.3 area 0
TestRouter4(config-router)#network 192.168.7.0 0.0.0.255 area 0
TestRouter4(config-router)#network 192.168.8.0 0.0.0.255 area 0
TestRouter4(config-router)#network 172.16.1.0 0.0.0.3 area 0
TestRouter4(config-router)#network 172.16.1.12 0.0.0.3 area 0
TestRouter4(config-router)#log-adjacency-changes
TestRouter4(config-router)#default-information originate
TestRouter4(config-router)#exit
TestRouter4(config-router)#exit
TestRouter4(config)#exit
TestRouter4#copy running-config startup-config
TestRouter4#copy running-config startup-config
No comments:
Post a Comment