Chapter Five
Open Shortest Path Protocol (OSPF)
This chapter will walk you through the commands related to the Open Shortest Path First (OSPF). You will navigate through the commands regarding the configuration of single-area OSPF, the use of wildcard masks in OSPF areas, and the configuration of single-area OSPF such as cost metrics and loopback interfaces, timers, authentication, and propagation of default tone. You will also learn about the commands to verify OSPF and the troubleshooting of issues that pop up along the way.
Mandatory Commands for OSPF
-
The command Georgia(config)#router ospf 123 will allow you to turn on the OSPF process number 123. The process ID can be anywhere between 1-65535. Its ID is not in any way linked to OSPF area.
-
The command Georgia(Config)#network 172.16.10.0 0.0.0.255 area 0 will allow you to advertise the interfaces. OSPF does not advertise networks however it does advertise interfaces. It will use a wildcard mask that will determine which interface it has to advertise. The interfaces that belong to the address 172.16.10.x will be placed into Area 0. The process ID number of a router need not match the process ID number of other routers. Unlike Enhanced IGRP (EIGRP) and Interior Gateway Routing Protocol (IGRP), matching the number across the existing routers does not ensure adjacencies' formation.
When it is compared with the IP address of a computer, a wildcard mask will identify how addresses will be matched for the placement into a particular area.
A zero (0) inside a wildcard mask means checking the corresponding bit inside the address to have an exact match. A one (1) inside a wildcard means ignorance of the corresponding bit for the address. Here are some uses of wildcard masks for OSPF.
-
The command Georgia(config-router)#network 72.16.10.1 0.0.0.0 area 0 will allow you to put an interface that has an address 172.16.10.1 in Area 0.
-
The command Georgia(config-router)#network 72.16.10.0 0.0.255.255 area 0 will allow you to put your interface that has an address 172.16.x.x in Area 0.
-
The command Georgia(config-router)#network 0.0.0.0 255.255.255.255 area 0 will allow you to put your interface with any address in Area 0.
Optional Commands for OSPF
The first commands on the line are for loopback interfaces.
-
The command Georgia(config)#interface 1o0 will allow you to shift from your current interface to the virtual interface that is Loopback 0.
-
The command Georgia(config-if)#ip address 192.168.100.1 255.255.255.255 will allow you to assign an IP address to your interface. You can choose any IP address that fulfills your requirements. The loopback interfaces always remain up and up. They do not go down unless you manually shut them down, which is why loopback interfaces are considered wonderful for using OSPF router ID.
The following commands will help you modify the OSPF cost metrics.
-
The command Georgia(config)#int s 0/0 will allow you to modify the metrics.
-
The command Georgia(config-if)#bandwidth 256 will allow
you to change the bandwidth of the network. You can change it to 128. OSPF will also recalculate the cost of the link.
-
The command Georgia(config-if)#ip ospf cost 1690 will allow you to change the cost figure to the value of 1690. The link's cost is generally determined by the division of the reference bandwidth by interface bandwidth. The default bandwidth can be a number from 1-10,000,000. It is generally measured in kilobits. The cost is a number between 1-65,535.
Authentication
-
The command Georgia(config)#router ospf 456 will allow you to kick off the authentication process.
-
The next command on the line is Georgia(config-router)#area 0 authentication will allow you to turn on the process of simple authentication. You can send in the password in clear text.
-
The command Georgia(config-router)#exit will allow you to exit the authentication process.
-
The next command to enter in the interface is Georgia(config)#int fa0/0.
-
The command Georgia(config-if)#ip ospf authentication-key jasmine will allow you to set the password for your authentication process to jasmine. You can choose any other word to set the password. You can also make it more complex so that it defies any cracking attempts.
MD5 Authentication
-
The command Georgia(config)#router ospf 456 will allow you to kick off the process of authentication using MD5.
-
The command Georgia(config-router)#area 0 authentication
message-digest will allow you to enable the authentication process with MD5 password encryption.
-
The command Georgia(config-router)#exit will allow you to exit the process at any time.
-
The next command on the line is Georgia(config-router)#int fa 0/0.
-
The command Georgia(config-if)#ip ospf message-digest-key 1 md5 jasmine will allow you to encrypt the password that you have filled in the interface. In the command 1 is the key-id. This value remains the same. The key and password must remain the same for any neighboring router.
Timers
-
The command Georgia(config-if)#ip ospf hello-interval timer 30 will allow you to change the Hello interval to 30 seconds. You can change the timing as per your custom requirements.
-
The command Georgia(config-if)#ip ospf dead-interval 90 will allow you to change the dead interval to 90 seconds. You can fill it in with any other amount of seconds.
Default Route
-
The command Georgia(config)#ip route 0.0.0.0 0.0.0.0 s0/0 will allow you to create a default route in the system. After you have entered the abovementioned command, you can fill in the system with the following command Georgia(config)#router ospf 1 to further the process of creating default routes.
-
The command Georgia(config-router)#default-information-originate will allow you to set the default route so that it can be propagated across the OSPF routers.
OSPF Configuration Verification
-
The command Georgia#show ip protocol will allow you to see the parameters for different protocols that are running on the routers.
-
The command Georgia#show ip route will allow you to see the full IP routing tables.
-
The command Georgia#show ip ospf will allow you to see the basic information of the network.
-
The command Georgia#show ip ospf interface will allow you to see the information about OSPF because the same is related to all the interfaces that exist on the system.
-
The command Georgia#show ip ospf int fa 0/0 will allow you to see the OSPF information for the interface titled fa 0/0.
-
The command Georgia#show ip ospf neighbor will allow you to see the list of all the OSPF neighbors and their respective states.
-
The command Georgia#show ip ospf neighbor detail will allow you to see all the neighbors' detailed lists in the network system.
-
The command Georgia#show ip ospf database will allow you to see the contents of the OSPF database.
Troubleshooting Process
-
The command Georgia#clear ip route * will allow you to clear the routing table. It forces the users to rebuild the table. In that way, the problem is automatically killed.
-
The command Georgia#clear ip route x.x.x.x will allow you to clear a specific route to the network x.x.x.x.
-
The command Georgia#clear ip ospf counters will allow you to clear and reset the OSPF counters.
-
The command Georgia#clear ip ospf process will allow you to reset the OSPF process. This forces the OSPF to recreate the neighbors, routing tables and databases. This is how the problem is tackled and erased completely from the system.
-
The command Georgia#debug ip ospf events will allow you to see OSPF events in the system. This is how you can correct any problem that pops up along the way.
-
The command Georgia#debug ip ospf packets will allow you to see the OSPF packets.
-
The command Georgia#debug ip ospf adj will allow you to see different states of OSPF.