Chapter Six
Open Shortest Path Protocol (OSPF) Single Area and Multiarea Configuration
This chapter will walk you through the configuration processes of single area OSPF and multiarea OSPF. I will explain each configuration process by neatly stating the step-by-step commands.
Single Area OSPF Configuration
The configuration of a single area OSPF system comprises the following steps.
-
The command Router>en is the first step to kick off the configuration process.
-
The command Router#config t is the second step. It will land you in the configuration mode.
-
The command Router(config)#no ip domain-lookup will allow you to turn off the DNS queries so that the spelling mistakes will never allow you to slow down.
-
The command Router(config)#hostname Georgia will allow you to set up the name of the host.
-
The command Georgia(config)#line con 0 is the next step on the line.
-
The command Georgia(config-line)#logging sync will allow you to list the commands that are interrupted by the console messages and append them to a new line.
-
The command Georgia(config-line)#exit will is the next step on the line.
-
The command Georgia(config)#int fa 0/0 will allow you to set up Fast Ethernet.
-
The command Georgia(config-if)#ip add 172.16.10.1 255.255.255.0 will allow you to set up the system's IP address.
-
The command Georgia(config-if)#no shut is the step for the configuration.
-
The command Georgia(config-if)#int s0/0 is the next step.
-
The command Georgia(config-if)#ip add 172.16.20.1 255.255.255.0 will allow you to set up and add another IP address for the system.
-
The command Georgia(config-if)#clock rate 56000 will allow you to set up and connect the DCE cable to your interface.
-
The next command to enter the system is Georgia(config-if)#no shut.
-
The command Georgia(config-if)#exit will allow you to exit the previous state.
-
The command Georgia(config)#route ospf 1 will allow you to turn on the OSPF process 1.
-
The command Georgia(config-router)#net 172.16.10.0.0.0.255 area 0 will allow you to pair up any interface that has an address of 172.10.10.x with area 0.
-
The command Georgia(config-router)#net 172.16.20.0.0.0.255 area 0 will allow you to pair up any interface that has an address of 172.16.10.x with area 0.
-
The command Georgia(config-router)#Ctrl + Z is the second last command to apply for the configuration process.
-
The command Georgia#copy run start will finish the configuration process.
Multi-area OSPF
OSPF uses different types of messages. A few of them are given as under. Each OSPF packet is packed up inside an IP header.
-
The first type of OSPF messages is named Hello. The message is used to discover the neighbors and it also builds the adjacencies that are between them.
-
The second type of OSPF messages is named Database description (DBD). The message is used to check for the synchronization of the database between the routers.
-
The third type of OSPF messages is named Link-state request (LSR). The message is used to request specific link-state advertisements (LSAs) from a different router.
-
The fourth type of OSPF messages is named Link-state update(LSU). The message is used to send off the specifically requested LSAs.
-
The fifth type of OSPF messages is named Link-state acknowledgment (LSAck). The message is used to acknowledge the different types of packets.
LSA Types
In the next section, I will explain the different types of LSA that the OSPF uses. LSAs are considered as the building blocks of the OSPF link-state database (LSDB). LSAs act as database records. They describe the topology of the OSPF network area.
-
The first type of LSA is Router LSA. It describes the router link state to area. It remains flooded in a single area.
-
The second type of LSA is Network LSA. Designated routers generate this type. It is also flooded in a single area.
-
The third type of LSA is Summary LSA. This type is used by area Border Router (ABR). It is also used to harvest information that is collected from one area. It also summarizes it for a different area.
-
The fourth type of LSA is ASBR summary LSA. It tends to inform the OSPF domain on how to approach the ASBR.
-
The fifth type of LSA is Autonomous system LSA. Its description is that ASBR generates it. These types of LSAs describe the routes to the destinations that are generally external to the systems that operate autonomously.
-
The sixth type of LSA is Group membership LSA. Its description is that it is used in multicast OSPF apps. Multicast apps or MOSPF apps have been deprecated.
-
The seventh type of LSA is NSSA external link entry LSA. Its description is it is used in the special types of areas are known as not-so-stubby-area (NSSA). It tends to advertise the external routes in the NSSA.
-
The eighth type of LSA is Link-local LSA for OSPFv3. Its description is that it yields information about the link-local addresses in addition to displaying a list of IPv6 addresses on the link. It is generally not supported by Cisco.
-
The ninth type of LSA is Opaque LSA. This LSA is reserved for future usage.
-
The tenth type of LSA is Opaque LSA. This LSA is reserved for future usage.
-
The eleventh type of LSA is Opaque LSA. This LSA is reserved for future usage.
OSPF Configuration
There are a few steps involved in the configuration process of OSPF.
The steps are given below.
-
The command Georgia(config)#router ospf 555 will allow you to initiate the OSPF process 555. The ID can be a positive integer between 1 and 65,535. The process ID is never related to the OSPF area. The process ID distinguishes one process from another one inside of the device.
-
The command Georgia(config-router)#network 172.16.10.0 0.0.0.0255 area 0 will allow you to use the wildcard mask to determine which interfaces you can advertise. Any interface that has an address of 172.16.10.x will run the OSPF. It can also be put into area 0.
-
The command Georgia(config-router)#log-adjacency-changes detail will allow you to configure routers to some syslog messages whenever there is some change of state inside the OSPF neighbors.
You can use different wildcard masks with OSPF areas. When you compare it with an IP address, a wildcard mask will help you locate what addresses will be matched up to run the OSPF and also be placed inside a particular area.
-
The zero(0) in the wildcard mask means checking the corresponding bit within the address to make a perfect match.
-
The one(1) in the wildcard mask means ignorance of the corresponding bit within the address.
The following commands will do the trick for you.
-
The command Georgia(config-router)# network 172.16.0.1 0.0.0.0 area 0 will allow you to confirm that any interface that possesses the address 172.16.10.1 will run OSPF and will also be placed inside area 0.
-
The command Georgia(config-router)# network 172.16.0.0
0.0.255.255 area 0 will allow you to confirm that any interface that possesses the address 172.16.y.y will run OSPF and will also be placed inside area 0.
-
The command Georgia(config-router)# network 0.0.0.0 255.255.255.255 area 0 will allow you to confirm that any interface that any possesses address type will run OSPF and will also be placed inside area 0.
Multiarea OSPF Configuration
Georgia Router:
-
The command Router> enable will allow you to shift to the privileged mode.
-
The command Router#configure terminal will allow you to shift to the global configuration mode.
-
The command Router(config)#hostname Georgia will allow you to set up the name of the router.
-
The command Georgia(config)#interface loopback0 will allow you to enter the mode of the loopback interface.
-
The command Georgia(config-if)#ip address (enter ip address here) will allow you to assign the IP address and the netmask to the network.
-
The command Georgia(config-if)#description Router ID will allow you to set up a locally significant description.
-
The command Georgia(config-if)#exit will allow you to shift back to the global configuration mode.
-
The command Georgia(config)#ip route 0.0.0.0 0.0.0.0 10.1.0.2 fastethernet0/1 will allow you to create a default route. If you use the next-hop address and exit interface on a Fast Ethernet interface, you will be able to prevent the recursive look-ups within the routing table.
-
The command Georgia(config)#ip route 11.0.0.0 0.0.0.0 null0 will allow you to create a kind of static route to the null interface. This example shows you the routes that represent some remote simulated destination.
-
The command Georgia(config)#ip route 12.0.0.0 0.0.0.0 null0 will allow you to create a kind of static route to the null interface. This example shows you the routes that represent some remote simulated destination.
-
The command Georgia(config)#ip route 13.0.0.0 0.0.0.0 null0 will allow you to create a kind of static route to the null interface. This example shows you the routes that represent some remote simulated destination.
-
The command Georgia(config)#router ospf1 will allow you to kick off OSPF 1.
-
The command Georgia(config-router)#network 172.16.0.0 0.0.255.255 area 0 will ensure that the interface with the IP address 172.16.y.y will operate OSPF it will also be put in area 0.
-
The command Georgia(config-router)#default-information originate will allow you to set up the default route that must be propagated to the OSPF routers.
-
The command Georgia(config-router)#redistribute static will allow you to redistribute the OSPF process's static routes. This will turn the router into Georgia because the static routes are usually not a part of OSPF. The definition of Georgia is a router that usually sits in between OSPF and the static routing process.
-
The command Georgia(config-router)#exit will take you back to the global configuration mode.
-
The command Georgia(config)#exit will allow you to get
back to the privileged mode.
-
The command Georgia#copy running-config startup-config will allow you to save your network configuration to NVRAM.
Georgia1 Router:
-
The command Router> enable will allow you to shift to the privileged mode.
-
The command Router#configure terminal will allow you to shift to the global configuration mode.
-
The command Router(config)#hostname Georgia1 will allow you to set up the name of the router.
-
The command Georgia1(config)#interface loopback0 will allow you to enter the mode of the loopback interface.
-
The command Georgia1(config-if)#ip address (enter ip address here) will allow you to assign the IP address and the netmask to the network.
-
The command Georgia1(config-if)#description Router ID will allow you to set up a locally significant description.
-
The command Georgia1(config-if)#exit will allow you to shift back to the global configuration mode.
-
The command Georgia1(config-if)#interface fastethernet0/1 will allow you to shift back to the interface configuration mode.
-
The command Georgia1(config-if)#ip ospf priority 200 will set up the priority for BDR and DR election processes. The router is likely to win and become the DR.
-
The command Georgia1(config-if)#no shutdown will allow you to shift back to the interface mode.
-
The command Georgia1(config-if)#exit will allow you to reenter the global configuration mode.
-
The command Georgia1(config)#router ospf1 will allow you to kick off OSPF 1.
-
The command Georgia1(config)#ip route 0.0.0.0 0.0.0.0 10.1.0.2 fastethernet0/1 will allow you to create a default route. If you use next-hop address and exit interface on a Fast Ethernet interface, you will be able to prevent the recursive look-ups within the routing table.
-
The command Georgia1(config-router)#network 172.16.1.0 0.0.0.255 area 0 will ensure that the interface that has the IP address 172.16.1.y will operate OSPF and it will also be put in area 0.
-
The command Georgia1(config-router)#network 172.16.51.1 0.0.0.0 area 51 will ensure that the interface that has the IP address 172.16.51.1 will operate OSPF and it will also be put in area 51.
-
The command Georgia1(config-router)#exit will take you back to the global configuration mode.
-
The command Georgia1(config)#exit will allow you to get back to the privileged mode.
-
The command Georgia1#copy running-config startup-config will allow you to save your network configuration to NVRAM.
Georgia2 router:
-
The command Router> enable will allow you to shift to the privileged mode.
-
The command Router#configure terminal will allow you to shift to the global configuration mode.
-
The command Router(config)#hostname Georgia2 will allow you to set up the name of the router.
-
The command Georgia2(config)#interface loopback0 will allow you to enter the mode of the loopback interface.
-
The command Georgia2(config-if)#ip address (enter ip address here) will allow you to assign the IP address and the netmask to the network.
-
The command Georgia2(config-if)#description Router ID will allow you to set up a locally significant description.
-
The command Georgia2(config-if)#exit will allow you to shift back to the global configuration mode.
-
The command Georgia2(config-if)#interface fastethernet0/0 will allow you to shift back to the interface configuration mode.
-
The command Georgia2(config-if)#ip ospf priority 100 will set up the priority for BDR and DR election processes. The router is likely to win and become the DR.
-
The command Georgia2(config-if)#no shutdown will allow you to shift back to the interface mode.
-
The command Georgia2(config-if)#exit will allow you to reenter the global configuration mode.
-
The command Georgia2(config)#router ospf1 will allow you to kick off OSPF 1.
-
The command Georgia2(config)#ip route 0.0.0.0 0.0.0.0 10.1.0.2 fastethernet0/1 will help you create a default route. If you use next-hop address and exit interface on a Fast Ethernet interface, you will be able to prevent the recursive look-ups within the routing table.
-
The command Georgia2(config-router)#network 172.16.1.0
0.0.0.255 area 0 will ensure that the interface that has the IP address 172.16.1.y will operate OSPF and it will also be put in area 0.
-
The command Georgia2(config-router)#network 172.16.10.14 0.0.0.3 area 1 will ensure that the interface with the IP address 172.16.10.4—7 will operate OSPF it will also be put in area 1.
-
The command Georgia2(config-router)#area 1 stub will allow you to make area 1 stub area. The LSA type 4 and 5s are usually blocked. They are generally not sent into area 1. Usually, a default route is placed into the stub area. It points to Georgia1.
-
The command Georgia2(config-router)#exit will take you back to the global configuration mode.
-
The command Georgia2(config)#exit will allow you to get back to the privileged mode.
-
The command Georgia2#copy running-config startup-config will allow you to save your network configuration to NVRAM.
GeorgiaInt Router:
-
The command Router> enable will allow you to shift to the privileged mode.
-
The command Router#configure terminal will allow you to shift to the global configuration mode.
-
The command Router(config)#hostname GeorgiaInt will allow you to set up the name of the router.
-
The command GeorgiaInt(config)#interface loopback0 will allow you to enter the mode of loopback interface.
-
The command GeorgiaInt(config-if)#ip address (enter ip
address here) will allow you to assign the IP address and the netmask to the network.
-
The command GeorgiaInt(config-if)#description Router ID will allow you to set up a description that is locally significant.
-
The command GeorgiaInt(config-if)#exit will allow you to shift back to the global configuration mode.
-
The command GeorgiaInt(config-if)#exit will allow you to reenter the global configuration mode.
-
The command GeorgiaInt(config)#router ospf1 will allow you to kick off OSPF 1.
-
The command GeorgiaInt(config-router)#network 172.16.0.0 0.0.255.255 area 1 will ensure that the interface that has the IP address 172.16.y.y will operate OSPF and it will also be put in area 0.
-
The command GeorgiaInt(config-router)#area 1 stub will allow you to make area 1 stub area.
-
The command GeorgiaInt(config-router)#exit will take you back to the global configuration mode.
-
The command GeorgiaInt(config)#exit will allow you to get back to the privileged mode.
-
The command GeorgiaInt#copy running-config startup-config will allow you to save your network configuration to NVRAM.
Loopback Interfaces
-
The command Georgia(config)#interface loopback0 will allow you to create a type of virtual interface named Loopback 0. It then shifts the router to the configuration mode of the interface.
-
The command Georgia(config-if)#ip address (Ip address) will allow you to assign an IP address to your interface. The loopback interfaces are all the time up. They do not go down unless you shut them down manually. This is why loopback interfaces are great for usage as OSPF router ID.
Router ID
-
The command Georgia(config)#router ospf 1 will allow you to kick off process 1.
-
The command Georgia(config-router)#router-id 10.1.1.1 will allow you to set up the router ID and fix it to 10.1.1.1. If you use the command on the OSPF router process that is active already, the new router ID will be used at the next reload. It will also be used for the manual restart of the OSPF process.
-
The command Georgia(config-router)#no router-id 10.1.1.1 will allow you to remove your static router ID from the process of configuration. If you use the command on the ODPF router process that is active already, the old router ID will be used at the upcoming reload or at the manual restart of the OSPF process.
If you want to choose the router ID at the point of the initialization of the OSPF process, the router will use the following criteria in a particular order.
-
You should use the router ID that is specified in the command regarding the router-id ip address.
-
You should use the highest IP address among the active loopback interfaces that present are on the router.
-
You should use the highest IP address among the active nonloopback interfaces that are present on the router.
DR/BDR Elections
-
The command Georgia(config)#interface fastethernet0/0
will allow you to enter into the interface's configuration mode.
-
The command Georgia(config-if)#ip ospf priority 100 will allow you to change the priority of the ospf interface to 100. You can set the priority at any figure between 0 and 255. The priority of 0 will make the router ineligible to create a designated router (DR). The highest priority will win the election and become the DR. The one that comes at the second slot will win the position of BDR. If all the routers on a network have the same priority, there will be a tie. You can break up a tie by the highest router ID. The default setting for the priorities is set at 1.
Passive Interfaces
-
The command Georgia(config)#router ospf 1 will allow you to kick off the OSPF process 1.
-
The command Georgia(config-router)#network 172.16.10.0 0.0.0.255 area 0 will allow you to put the interface with the address 172.16.10.y into area 0.
-
The command Georgia(config-router)#passive-interface fastethernet0/0 will disable the process of sending OSPF packets on your interface.
-
The command Georgia(config-router)#passive-interface default will disable the process of sending OSPF packets on all the interfaces in the system.
-
The command Georgia(config-router)#no passive-interface serial 0/0/1 will enable the process of sending OSPF packets to interface serial0/0/1. That’s how it allows the neighbor adjacencies to formulate.
Cost Metrics
-
The command Georgia(config)#interface will land you in the
mode of configuration of your interface.
-
The command Georgia(config-if)#bandwidth 256 will let you change the bandwidth of your network. If you change it, the OSPF will allow you to recalculate the link cost.
Configuration: OSPF Single Area
In the following section, I will show network topology for single-area OSPF. I will state all the relevant commands to single-area OSPF.
Georgia1 router:
-
The command Georgia1(config)#router ospf1 will allow you to kick off OSPF 1.
-
The command Georgia1(config-router)#network 172.16.10.0 0.0.255.255 area 0 will ensure that the interface that has the IP address 172.16.y.y will operate OSPF and it will also be put in area 0.
-
The command Georgia1(config-router)#network 172.16.20.0 0.0.255.255 area 0 will ensure that the interface that has the IP address 172.16.y.y will operate OSPF and it will also be put in area 0.
-
The command Georgia1(config-router)#<CTRL> z will take you back to the network system's privileged mode.
-
The command Georgia1#copy running-config startup-config will allow you to save your network configuration to NVRAM.
Georgia2:
-
The command Georgia1(config)#router ospf1 will allow you to kick off OSPF 1.
-
The command Georgia1(config-router)#network 172.16.10.0. 0.0.255.255 area 0 will ensure that the
interface that has the IP address 172.16.y.y will operate OSPF and it will also be put in area 0.
-
The command Georgia1(config-router)#<CTRL> z will take you back to the network system's privileged mode.
-
The command Georgia1#copy running-config startup-config will allow you to save your network configuration to NVRAM.
Georgia3:
-
The command Georgia1(config)#router ospf1 will allow you to kick off OSPF 1.
-
The command Georgia1(config-router)#network 172.16.40.2 0.0.0.0 area 0 will ensure that the interface that has the IP address 172.16.40.2 will operate OSPF and it will also be put in area 0.
-
The command Georgia1(config-router)#network 172.16.50.1 0.0.0.0 area 0 will ensure that the interface that has the IP address 172.16.50.1 will operate OSPF and it will also be put in area 0.
-
The command Georgia1(config-router)#<CTRL> z will take you back to the network system's privileged mode.
-
The command Georgia1#copy running-config startup-config will allow you to save your network configuration to NVRAM.
OSPF Single Area Configuration
I will use three routers and set up the commands accordingly.
Georgia:
-
The command Georgia(config)#router ospf1 will allow you to initiate the OSPF 1 process.
-
The command Georgia(config-router)#network 172.16.10.0 0.0.0.255 area 0 will ensure that the interface that has the IP address 172.16.10.y will operate OSPF and it will also be put in area 0.
-
The command Georgia(config-router)#network 172.16.20.0 0.0.0.255 area 0 will ensure that the interface with the IP address 172.16.20.y will operate OSPF it will also be put in area 0.
-
The command Georgia(config)#<CTRL> z will allow you to get back to the privileged mode.
-
The command Georgia#copy running-config startup-config will allow you to save your network configuration to NVRAM.
Georgia1:
-
The command Georgia1(config)#router ospf1 will allow you to initiate the OSPF 1 process.
-
The command Georgia1(config-router)#network 172.16.0.0 0.0.255.255 area 0 will ensure that the interface with the IP address 172.16.y.y will operate OSPF and it will also be put in area 0.
-
The command Georgia1(config)#<CTRL> z will allow you to get back to the privileged mode.
-
The command Georgia1#copy running-config startup-config will allow you to save your network configuration to NVRAM.
Georgia3:
-
The command Georgia3(config)#router ospf1 will allow you to initiate the OSPF 1 process.
-
The command Georgia3(config-router)#network
172.16.40.2 0.0.0.0 area 0 will ensure that the interface with the IP address 172.16.40.2 will operate OSPF and it will also be put in area 0.
-
The command Georgia3(config)#<CTRL> z will allow you to get back to the privileged mode.
-
The command Georgia3#copy running-config startup-config will allow you to save your network configuration to NVRAM.