OSPF Configuration
Thursday, August 26, 2021 2:45 PM
Verifying OSPF Configuration
If you have configuration.enable mode access, use the show running-config command to examine the
If you have only configuration. user mode access,use the show ip protocols command to re-create the OSPF
Use the show ip ospf interface [brief] command to determine whether the router enabled OSPF
on the correct interfaces or not based on the configuration.
show ip ospf interface brief showing all the interfaces on which OSPF has been enabledcommand shown here. It lists one line per interface, with the list
Configuring the OSPF Router ID
most enterprise networks that use OSPF choose to configure each router’s OSPF router ID
If therouter-id rid OSPF subcommand is configured, this value is used as the RID.
If any loopback interfaces have an IP address configured, status of up, the router picks the highest numeric IP address among these loopback interfaces.and the interface has an interface
The router picks the code (first status code) is up. (In other words, an interface in up/down state will be included by highest numeric IP address from all other interfaces whose interface status
OSPF when choosing its router ID.)
stops and restarts the OSPF processup, and later the configuration changes in a way that would impact the OSPF RID, OSPF does not (with the clear ip ospf process command). So, if OSPF comes
change the RID immediately. Instead, IOS waits until the next time the OSPF process is restarted.
OSPF Interface Configuration Example
Step 1. Use the no network network-id area area-id subcommands in OSPF configuration mode
to remove the network commands.
Step 2. Add one ip ospf process-id area area-id command in interface configuration mode under
each interface on which OSPF should operate,correct OSPF area number. with the correct OSPF process (process-id) and the
Verifying OSPF Interface Configuration
Additional OSPFv2 Features
Passive interfaces
Default routes
Metrics
Load balancing
OSPF Passive Interfaces
When no routers exist on a link
OSPF continues to advertise about the subnet that is connected to the interface.
OSPF no longer sends OSPF Hellos on the interface.
OSPF no longer processes any received Hellos on the interface.
OSPF still advertises about the connected subnet, but OSPF also does not form neighbor
relationships over the interface.
First, configuration mode:you can add the following command to the configuration of the OSPF process, in router
passive-interface type number
Alternately, the configuration can change the default setting so that all interfaces are passive by default and then add a no passive-interface command for all interfaces that need to not be
passive:
passive-interface default
no passive-interface type number
The passive interfaces. show ip ospf interface brief command lists all interfaces on which OSPF is enabled, including
The show ip ospf interface command lists a single line that mentions that the interface is passive.
OSPF Default Routes
All routers learn specific (nondefault) routes for subnets inside the company; a default route is not needed when forwarding packets to these destinations.
One router connects to the Internet, and it has a default route that points toward the Internet.
All routers should dynamically learn a default route,that all packets destined to locations in the Internet go to the one router connected to the used for all traffic going to the Internet, so
Internet.
default using OSPF to the remote routers (B1 and B2). - information originate command (Step 2) makes the router advertise a default route
OSPF Metrics (Cost)
Cisco routers allow three different ways to change the OSPF interface cost:
Directly, using the interface subcommand ip ospf cost x.
Using the default calculation per interface, and changing the interface bandwidth setting, which changes the calculated value.
Using the default calculation per interface, and changing the OSPF reference bandwidth setting, which changes the calculated value.
Setting the Cost Based on Interface and Reference Bandwidth
You can still use OSPF’s default cost calculation (and many do) just by changing the reference
bandwidth with the auto-cost reference-bandwidth speed OSPF mode subcommand
For instance, routers to use autoin an enterprise whose fastest links are 10 Gbps (10,000 Mbps), you could set all -cost reference-bandwidth 10000, meaning 10,000 Mbps or 10 Gbps. In that
case, by default, a 10cost of 10, and a 100–MBps link a cost of 100Gbps link would have an OSPF cost of 1, while a 1. -Gbps link would have a
Set the cost explicitly, using the 65,535, inclusive. ip ospf cost x interface subcommand, to a value between 1 and
Although it should be avoided, change the interface bandwidth with the bandwidth speed
command,with speed being a number in kilobits per second (Kbps).
Change the reference bandwidth, using router OSPF subcommandauto-cost reference-
bandwidth ref-bw, with a unit of megabits per second (Mbps).
OSPF Load Balancing
when the metrics tie for multiple routes to the same subnet, the router can put multiple equalcost routes in the routing table (the default is four different routes) based on the setting of the -
maximum-paths number router subcommand
the default (and better) method, the load balancing could be on a per-destination IP address
basis.