Featured image

Table of Contents Link to heading

Open Short Path First (OSPF) Link to heading

Info
a popular, standards-based IGP, link-state routing protocol, designed to address the limitations of RIP.

OSPF propagates link-state advertisements (LSAs) rather than routing table updates (like DVRPs), which means OSPF networks converge faster than DVRPs.

There are two versions of OSPF that are in use:

  1. OSPFv2
    • The second iteration in OSPF, works primarily with IPv4.
  2. OSPFv3
    • Runs on top of IPv6 and uses IPv6 link-local addresses for OSPFv3 control packets.
    • It is required that IPv6 be enabled on an OSPFv3 link, although the link may not be participating in any IPv6 address family (AF).
    • OSPFv3 AF for IPv4 unicast is not backwards compatible with OSPFv2.
    • Separate process from OSPFv2, basically same but run independently.

Key Features Link to heading

  1. Independent transport: OSPF works on top of Internet Protocol (IP) and uses protocol number 89. It does not rely on the functions of the transport layer protocols TCP or UDP.
  2. Efficient use of updates: When an OSPF router first discovers a new neighbour, it sends a full update with all known link-state information. All routers within an area must have identical and synchronised link-state information in their OSPF link-state databases. When an OSPF network is in a converged state and a new link comes up or a link becomes unavailable, an OSPF router sends only a partial update to all its neighbour. This update will then be flooded to all OSPF routers within an area.
  3. Metric: OSPF uses a metric that is based on the cumulative costs of all outgoing interfaces from source to destination. The interface cost is inversely proportional to the interface bandwidth and can be also set up explicitly.
  4. Update destination address: OSPF uses multicast and unicast, rather than broadcast, for sending messages. The IPv4 multicast addresses used for OSPF are 224.0.0.5 to send information to all OSPF routers and 224.0.0.6 to send information to DR/BDR routers.
  5. VLSM support: OSPF is a classless routing protocol. It supports variable-length subnet masking (VLSM) and discontiguous networks. It carries subnet mask information in the routing updates.
  6. Manual route summarisation: You can manually summarise OSPF interarea routes at the Area Border Router (ABR), and you have the possibility to summarise OSPF external routes at the Autonomous System Boundary Router (ASBR). OSPF does not know the concept of autosummarisation.
  7. Authentication: OSPF supports clear-text, MD5, and SHA authentication.

Operation Link to heading

To create and maintain routing information, OSPF routers complete the following generic link-state routing process to reach the convergence state:

  1. Build the adjacency database: Routers must form adjacencies with their neighbour before they can exchange information.
    • A router sends Hello packets out all OSPF-enabled interfaces to determine whether neighbours are present on those links.
    • If a neighbour is present, these two routers will establish a neighbour adjacency (aka a bi-directional communication).
    • All neighbours to which a router has established bi-directional communication is stored in its adjacency database (aka a neighbour table).
  2. Exchange link-state advertisements: After adjacencies are established, routers flood link-state advertisements (LSAs) to all adjacent neighbours.
    • An LSA contains a link-state packet (LSP) which describe each directly connected link state.
    • Adjacent neighbours receiving the LSA immediately flood the LSA to other adjacent neighbours.
  3. Build the link-state database: After LSAs are received by all routers in the area, each router builds its local link-state database (LSDB) (aka a topology table) based on all the received LSAs.
    • An LSDB stores all the information about the network topology (every directly connected link state).
    • All LSDBs is eventually synchronised among routers within the same area.
  4. Execute the SPF algorithm: After all LSDBs are synchronised, routers then execute the SPF algorithm to compute the best path to each destination network.
    • The SPF algorithm builds an inverted tree, with the router itself at the top while other routers and their connected network segments beneath it.
  5. Build the forwarding database: From the SPF tree, only the best paths to each network are inserted into the forwarding database (aka a routing table).
    • Routing decisions are then made based on the entries in the routing table.
    • By examining the SPF’s inverted tree, loops can easily be detected and thus not included in the population of the routing table, thereby eliminating routing loops.

Areas Link to heading

Info
logical groupings of routers and links that divides the network.

Routers share link-state information with only the routers in their areas.

Types of Areas Link to heading

  • There are two levels of hierarchy: a backbone area and other connected areas.

Backbone Area (Area 0) Link to heading

Info
The logical and physical structure for the AS to which all regular areas must be attached.
  • Reserves the address 0.0.0.0.
  • Exists in any internetwork using OSPF over multiple areas.
  • Responsible for distributing routing information among nonbackbone areas.
  • Must be contiguous, but need not be physically contiguous.

Single-Area OSPF Link to heading

Info
All routers are in the one area, implemented in small networks where scalability is not of interest.
  • A single-area OSPF is the backbone area itself.
  • The configuration is simple, so as some of the hidden details in how OSPF works.
  • The same link-state information and LSDBs are synchronised across the area.

Multiarea OSPF Link to heading

Info
A two-layer area hierarchy using a backbone area interconnecting all other regular areas; useful in larger network deployments comprising hundreds of routers.
  • LSDBs are synchronised individually in each area of the network.
  • Different areas will have different LSDBs.
  • Using a multiarea topology helps to:
    • Reduce memory and processor resources
    • Lower frequencies of SPF recalculations if an interface state changes
    • Reduce the size of broadcast domains
    • Limit LSA flooding
    • Allow for route aggregation at the ABRs, hence fewer entries in LSDB
    • Add an additional layer of security by hiding the topology of one area from another area
    • Overall, improve convergence time

Stub Area Link to heading

Info
A dead end within the network where there is only a single exit point from that area.

Standard Area Characteristics Link to heading

Tip
  • Areas contain a group of contiguous hosts and networks.
  • Routers have a per-area topological database and run the same SPF algorithm.
  • Each area must be connected to the backbone area.
  • Virtual links can be used to connect to the backbone area in emergencies.
  • Intra-area routing describes routes to destinations within an area.

Design Best Practices Link to heading

Standard Area Design Rules Link to heading

Tip
  • A backbone area must always be present.
  • All areas must be connected to a backbone router, even stub areas.
  • The backbone area must be contiguous.
  • Only use virtual links as an emergency temporary measure.

Hierarchical Network Design Techniques Link to heading

Tip
  • A three-tiered backbone approach allows fast convergence and economy of scale.
  • Never use more than six router hops from source to destination.
  • Use 30 to 100 routers per area.
  • Do not allow more than two areas per ABR in addition to the ABR’s connection to the backbone. Otherwise, the ABR must keep track of too many LSDBs.

Types of Routers Link to heading

Internal Router (IR) Link to heading

Info
whose interfaces all belong to the same area.
  • Have a only one LSDB.
  • Can be a L3 switch that has its routing capability enabled.

Area Border Router (ABR) Link to heading

Info
located on the border of one or more areas (including Area 0) and connect those areas to the backbone network, which are considered to be members of both the backbone and the connected areas.
  • Maintain multiple LSDBs: one for each connected area that is summarised and then presented to the backbone for distribution to other areas.

Autonomous System Boundary Router (ASBR) Link to heading

Info
connected to more than one AS and exchange routing information with routers in another AS. Every router within an AS knows how to reach its ASBR.
  • Inject the external LSAs into the local-area LSDB - redistribution.
  • Can run multiple routing protocol together.
  • Must reside in a nonstub area.

Backbone Router Link to heading

Info
whose interfaces connect themselves only to the backbone area.
  • Do not have an interface to the other areas.

Designated Router (DR) Link to heading

Info

the collection and distribution point for every sent- and received-LSA in the multiaccess network, which means that it establishes OSPF adjacencies with all other routers on the network.

It is responsible for updating all DROther when a change occurs in the multiaccess network, which helps to prevent extensive flooding of LSAs.

  • Selected based on the router priority (default, 1).
  • If the router priority is identical, the router with the highest router ID is selected.

Backup Designated Router (BDR) Link to heading

Info
monitors the DR and takes over as DR if the current DR fails.
  • When the DR fails on the network, the BDR becomes the DR and a new BDR is elected.

DROther Link to heading

Info
a router that is neither the DR nor the BDR.

Link-State Packets (LSPs) Link to heading

  • Each LSP contains the following information:
  1. LSP.Router - identification (address) of the sender of the LSP
  2. LSP.age - age or remaining lifetime of the LSP
  3. LSP.seq - sequence number of the LSP. The lower the sequence number, the older and more redundant the LSP.
  4. LSP.Links[] - links advertised in the LSP. Each directed link is represented with the following information:
    1. LSP.Links[i].Id - identification of the neighbour
    2. LSP.Links[i].cost - cost of the link
  • Each type of LSP serves a specific function in the OSPF routing process.
  1. Hello - Used to discover, establish, and maintain adjacencies with other neighbours.
  2. Database description (DBD/DDP) - Contains an abbreviated list of the sending router’s LSDB and is used by receiving routers to check against their local LSDBs.
  3. Link-state request (LSR) - Sent to request for more information about an entry in the DBD when a router finds its LSDB needs updating.
  4. Link-state update (LSU) - Contains one or more, fully-detailed, LSAs and is used to reply an LSR packet.
  5. Link-state acknowledgement (LSAck) - Sent by the recipient of an LSU packet to confirm its receipt.

Link-State Advertisements (LSAs) Link to heading

Tip
Each LSA has its own aging timer that its link state age field carries.
  • The age of an LSA age starts at 0, updated in increments of 1 every second.
  • Once converged, OSPF refreshes each LSA if its age reaches 1800 (the default value, but configurable).
  • What this means is that router originating the LSA refloods the LSA with a higher sequence number (in increments of 1) in an LSU to verify the link is still active, with the aim of maintaining synchronised LSDBs.
  • The LSA validation method is bandwidth-friendly, compared to DVRPs which sends the entire routing table as updates at short periodic intervals.
Tip
The Flooding algorithm is used to efficiently distribute LSAs across the network.
Example
Router R’s LSA/LSP/LSU arrives at a neighbour’s interface.
if entry_in_lsdb(LSP, LSDB(LSP.Router)):
    if seq_same(LSP.seq):
         Ignore LSP
        end()
    else:
        if seq_higher(LSP.seq):
             Contain newer information
            LSDB.add(LSP)
            send_ack(LSP.LSAck)
            flood_lsp(LSP)  flood the new information to neighbours
            run_spf()
        elif seq_lower(LSP.seq):
             Contain older information
             Then send an LSU to sender with its newer information
            update_sender(recipient_lsp)
        else:
            end()
else:
    LSDB.add(LSP)
    send_ack(LSP.LSAck)
    flood_lsp(LSP)  flood the new information to neighbours
    run_spf()
Tip
LSAs are generated to be flooded within an area, between areas, and through the entire AS; for participating routers, DRs, ABRs, and ASBRs. Thus, there are 11 types of LSAs (9 to 11 are opaque and reserved for future use).
LSA TypeDescription
1Router LSAs
2Checks for LSDB synchronisation among routers
3Summary LSAs for ABRs
4Summary LSAs for ASBRs
5Autonomous System External LSAs
6Multicast OSPF LSAs
7Not-So-Stubby Area (NSSA) External LSA
8External Attributes LSA for BGP

Type 1 - Router LSA Link to heading

Info
Intra-area LSAs that have an area-flooding scope.
  • Produced by every OSPF-enabled router.
  • Include all the router’s links, interfaces, state of links, and cost.
  • Identified by the Router ID or the originating router.
  • Flooded immediately within an area and cannot cross the ABR.
  • Represented in the routing table as “O” routes.

Type 2 - Network LSA Link to heading

Info
Intra-area LSAs that have an area-flooding scope, providing information used by each router participating in OSPF to build the exact picture of the described multiaccess segment, which cannot be fully described with just type 1 LSAs.
  • Produced by every DR Router on every broadcast multiaccess or nonbroadcast multiaccess (NBMA) network.
  • Describe the network segment listing the DR address, the attached routers making up the transit network, and the used subnet mask used on the link.
  • Identified by the network ID and subnet mask.
  • Flooded to all OSPF routers (i.e. 224.0.0.5) on the multiaccess network and cannot cross the ABR.
  • Represented in the routing table as “O” routes.

Type 3 - Summary ABR LSA Link to heading

Info
Interarea LSAs that are a summary of destinations outside the local area but within the AS, propagating network information to other areas.
  • Produced by ABRs.
  • Describe networks that are in an area to the remaining areas in the OSPF autonomous system.
  • Represented in the routing table as “OIA” routes.

Type 4 - Summary ASBR LSA Link to heading

Info
Interarea LSAs that provides reachability about the ASBR.
  • Produced by ABRs.
  • When there is an ASBR in the OSPF domain, it advertises itself using a special type 1 LSA.
  • When an ABR receives this type 1 LSA, it builds a type 4 LSA to advertise the existence of the ASBR (including the ASBR’s IP address) and floods it to other areas.
  • Subsequent ABRs regenerate a type 4 LSA and flood it into their areas.

Type 5 - AS External LSA Link to heading

Info
Intra-AS LSAs that have a domain-flooding scope.
  • Produced by ASBRs.
  • Sent into an AS to advertise external OSPF routes to the OSPF domain.
  • Flooded to the entire AS.
  • The advertising router ID is not changed throughout the AS when it is propagating.

Type 7 - NSSA external LSA Link to heading

Info
Similar to type 5 LSAs but are used in Not-So-Stubby Areas (NSSAs) which do not allow type 5 LSAs and therefore type 7 LSAs are generated instead.
  • Produced by NSSA ASBR.
  • Sent into an AS of a NSSA to advertise external OSPF routes to the OSPF domain.
  • The ABR converts the type 7 LSA to a type 5 LSA and propagates it to other areas.
  • An NSSA network is a special-case area type used to reduce the amount of flooding, the LSDB size, and the routing table size in routers within the area.

Hello Protocol Link to heading

  1. Ensures that communication between neighbours is bidirectional (two-way).
  2. Discovers, establishes, and maintains neighbour relationships.
  3. Elects the DR and BDR on Ethernet and NBMA networks.
  4. Verifies that neighbouring OSPF routers are operational (that is, to act as a keepalive mechanism).

When a new OSPF router is introduced, the operation of the Hello protocol is as follows:

  1. The OSPF router sends out Hello packets as a multicast.
    • Interfaces not running OSPF ignore the multicast packet.
  2. All OSPF routers within the same area receive and process the Hello packets.
  3. When a neighbouring OSPF router receives a Hello packet with a router ID not in its neighbour table, it will attempt to establish an adjacency with the sending router by sending a Hello packet.

Hello packets are transmitted:

  • Using multicast address:
    • 224.0.0.5 to neighbours for P2P networks.
    • 224.0.0.6 to DR and BDR for broadcast (Ethernet) and NBMA networks (Frame Relay).
  • Using unicast (virtual links) or multicast addresses to neighbours for nonbroadcast point-to-multipoint networks.
  • Every 10 seconds (default) - broadcast multiaccess (Ethernet) and P2P networks.
  • Every 30 seconds - NBMA (Frame Relay) networks.
  • The Dead interval is four times the Hello interval.
    • Period that the sending router waits to receive a Hello packet before declaring the neighbour is dead.
    • When a neighbour is dead, the router(s) that detect it flood the LSDB about it to all OSPF-enabled interfaces.

Adjacencies Link to heading

Info
control the distribution of routing updates in the sense that only routers adjacent to the sending one can process the update.
  • Required neighbours to be discovered before forming.
  • Not every neighbouring router forms an adjacency.
  • Requirements to form adjacencies:
  1. Network connectivity is P2P.
  2. Network connectivity is achieved through a virtual link.
  3. One router is either a DR or a BDR.
  • The number of adjacencies needed = n(n-1)/2, where n is the number of routers.
    • e.g. a network with 5 routers will need 5(5-1)/2=10 adjacencies.

OSPF Operational States Link to heading

There are several states that OSPF goes through to reach convergence:

  1. Down - R1 first starts OSPF and has yet to discover any neighbours.
  2. Attempt - R1 attempts to contact its neighbours by sending Hello packets containing its RID.
  3. Init - R2 receives R1’s Hello packet but does not see its RID in the packet.
    • R2 responds by sending a Hello packet to R1 containing both RIDs in it.
    • They will have decided on the DR (and BDR if necessary) and Hello timers by this point as well.
      • If R1/R2’s link is not P2P, the DR/BDR election process takes place.
  4. 2-Way - Bidirectional communication is established between two OSPF routers and they are considered neighbours.
  5. Exstart - Two routers negotiate to form a master/slave relationship.
    • To decide who will always speak first in subsequent communications - the master.
    • Both routers will claim to be the master by sending an empty DBD packet with the Master Slave bit (MS-bit) set to one indicating that both routers believe they are the master.
    • The neighbour with the lower RID will become the slave and will reply with a DBD packet in which the MS-bit packet is set to zero and the DD initial sequence number is set to the master’s sequence number.
  6. Exchange - DBD packets are exchanged (one at a time with sequence numbers in increments of 1) back and forth until the LSDBs are synchronised.
    • Every time a router receives a DBD packet, it must acknowledge with an LSAck packet.
    • Each router compares the received DBD packet with its local LSDB and if the DBD has more current link state, the routing transitions to the Loading state. Otherwise, it transitions straight to the Full state.
  7. Loading - LSRs and LSUs are sent to gain more information that had yet to be received in the Exchange state.
  8. Full - LSDBs are fully synchronised.
    • Full is the normal state for DR and BDR or P2P links, but 2-Way is normal for non-DR or non-BDR routers.
    • OSPF uses incremental updates after entering a full state.
      • Whenever a change takes place, only the change is shared with the DR, which will then share this information with other routers on the segment.

DR/BDR Election Process Link to heading

Info
DR and BDR are automatically elected during the last phase of the 2-Way OSPF neighbour state, before the Exstart state.

DR and BDR elections are conducted as follows:

  1. An OSPF router interface with a priority greater than 0 attempts to become BDR on the link.
  2. If no BDR exists, then it elects itself the BDR. If there is a tie with another router, the highest router ID is used.
  3. If there is no DR, the BDR promotes itself as DR.
  4. The neighbour with the next highest priority is elected BDR.

Cisco IOS Configuration Link to heading

Routing Process ID Link to heading

Info
simply an identifier for a process running on the local router, unknown to external routers, and therefore need not be the same across all routers.
  • Assigning a routing process id establishes the OSPF routing process.
  • However, the best practice is to maintain a consistent process ID throughout the routing domain.
  • Although more than one OSPF process can run at a single time on a single router, this should be avoided.
Note
Router(config)# router ospf process_#

Interface Advertisement Link to heading

Info
specifies what interfaces (networks attached to a router) to be advertised to other OSPF routers.

There are three techniques to advertise an interface.

Tip
  1. The 1st technique should be used when matching a range of networks, reducing the number of commands needing to be typed.
  2. The 2nd technique should be used when matching a specific network.
  3. The 3rd technique, intended to be a shorthand, must only be used when the intended interface is the last to be configured.

Wildcard Mask Link to heading

Info
A mask of bits that determines whether the corresponding bits in the IP address should be checked or ignored.
  • Wildcard masking is used to identify a single address or multiple addresses.
  • Wildcard masks are used in situations where subnet masks may not apply. For instance, when two affected hosts fall in different subnets, the use of a wildcard mask will group them together.
  • A wildcard mask bit of 0 means “check the corresponding bit value,” and a wildcard mask bit of 1 means “do not check (ignore) that corresponding bit value”
  • A wildcard mask is the “inverse subnet mask” (1’s and 0’s are flipped), calculated by deducting the subnet mask from 255.255.255.255.
Note
  • Subnet mask: 255.255.255.0 or /24
  • 255 - 255 = 0; 255 - 255 = 0; 255 - 255 = 1; 255 - 0 = 255
  • Wildcard mask: 0.0.0.255
  • This matches an IP address’s first three octets but ignores the last octet.
Tip
  1. An octet of 0 means an exact octet match.
  2. An octet of 255 means every possible octet value.
  3. An octet of x means the network includes x+1 address.
Example

Network: 192.168.12.64
Wildcard mask: 0.0.0.63

The first three octets equate to 0 => exact octet match => 192.168.12.?
The last octet equates to 63 => include 64 addresses => 192.168.12.64 to 192.168.12.127

Using Interface Network Address Link to heading

Info
specifies the wildcard mask can explicitly match a subnet, or it can be more vague to match several subnets as required.
  • The networks advertised must exist on the router in order to be sent to other routers.
  • The networks to advertise can be determined by taking the network prefix and prefix length of the router’s interface. These networks are then put into the OSPF configuration, allowing other routers to form adjacencies with the current router.
  • For an adjacency to form, the same network prefix and prefix length must be advertised on each side of a link.
Note

Router(config-router)# network interface_IP_# wildcard_mask area area_#

For single-area OSPF, the area_# argument is normally set to 0.

Example

If we want to match two networks 10.10.4.0/30 and 10.10.5.0/24, we need the summary network 10.10.4.0/23

Router(config-router)# network OSPF 10.10.4.0 0.0.1.255 area 0

This command reads “All interface(s) having the IP address that begins with 10.10.*.* is to be put into Area 0.”

The wildcard mask 0.0.1.255 matches two networks 10.10.4.0/30 and 10.10.5.0/24

Using Explicit Interface IP Address Link to heading

Info
specifies the IP address assigned to an interface explicitly enables OSPF on that interface.
Tip
A quad-zero mask, 0.0.0.0, will match an interface configured exactly with the specified IP address only, and nothing else.

Although this command produces the same result as the previous one, it is much faster if using the IP addressing table since there is no need to work out the wildcard mask.

Note
Router(config-router)# network interface_IP_# 0.0.0.0 area area_#

Specifically, if all the interfaces on the router belonged to the same area, use the following IP address configuration as the 0.0.0.0 network with 255.255.255.255 wildcard mask matches all enabled interfaces.

Note
Router(config-router)# network 0.0.0.0 255.255.255.255 area area_#

Directly Enabling OSPF on Interface Link to heading

Tip
only when the network address for the interface matches the range of addresses that was specified via the network statement.
  • This capability simplifies the configuration of unnumbered interfaces with different areas.
  • A use case of this would be in a stub network or a P2P network where one router has advertised the P2P link’s IP address with the network statement.
    • The routing table already stores this network address.
    • Thus, there is no need to reconfigure this network address on the other end of the P2P connection.
    • Instead, just enable OSPF on the interface connected to this P2P network.
    • As long as the specified interface is the last to be configured.
Note

Router(config)# interface interface_#
Router(config-if)# ip ospf process_# area area_# [secondaries none]

The secondaries none keyword prevents secondary IP addresses on the interface from being advertised.

Router ID (RID) Link to heading

Info
  1. Uniquely identifies each router in the same area.
  2. Determines what router becomes the master/slave in a P2P network and what router becomes the DR/BDR in an area.

It is a 32-bit number, formatted the same as an IPv4 address.

Note
Router(config-router)# router-id router_#

The OSPF router ID is chosen in order of preference:

  1. Manually configured using the router-id router configuration command.
  2. If it is not manually assigned, then the highest enabled loopback IP address is used as the router ID.
  3. If there are no loopback interfaces configured, then the highest IP address of any active physical interfaces in the up state becomes the Router ID when the OSPF process initialises.
Tip
The best practice is to assign a static OSPF router ID for troubleshooting purposes.

To force an existing OSPF network to use the new router ID, the OSPF process must be reset.

Note
Router# clear ip ospf process
Reset ALL OSPF processes? [no]: yes

Loopback Interface Link to heading

Info
a logical and virtual interface, but is treated as a physical interface on a router.

Loopback interfaces can be assigned addressing information, include network numbers in routing updates, or even terminate IP connections on it, like telnet. They are also used for for testing purposes since this interface is always up.

Tip

Given that loopback interfaces are immune to physical and data link problems, configuring them is an excellent method to set an RID.

Router(config)# interface loopback loopback_#
Router(config-if)# ip address IP_# subnet_mask

Example

In case the loopback interface is configured to simulate another network for OSPF to advertise (e.g. 192.168.1.0/26).

The default behaviour of OSPF for loopback interfaces is to advertise a 32-bit host route. To ensure that the /26 network is advertised, the network type on the loopback interface must be changed to P2P so that they are advertised with the correct subnet.

R1(config)# interface loopback loopback_#
R1(config-if)# ip ospf network P2P

Tip
OSPF P2P (P2P) interface and does not require a DR or BDR. An interface in this state is fully functional and starts exchanging hello packets with all of its neighbours.

Router Priority Link to heading

Info
A value that determines the order of processing for topology instances when an SPF calculation is scheduled and the role of an interface in the DR/BDR election process.
Tip
Set priority value of a router’s interface to 255 (0) ensures that it always win (lose) the DR/BDR election.
Note
Router(config-if)# ip ospf priority priority_value

After modifying priorities, the OSPF process on each router must be reset to force a new DB/BDR election.

Note
Router# clear ip ospf process
Reset ALL OSPF processes? [no]: yes

Passive Interface Link to heading

Info
does not send out OSPF messages or process any received OSPF packets. Since Hellos are suppressed, neighbour relationships are not formed; therefore, no routing updates are sent nor received.

However, the passive interface network segment is still added to the LSDB and advertised out of non-passive interfaces.

The passive interface appears as a stub network in the OSPF domain.

Tip

Configure an interface to be passive if it:

  1. does not connect to another OSPF interface.
  2. does not connect to another network, such as LANs.
  3. is susceptible to routing loops.
Note

There are two techniques to identify passive interfaces.

  1. Router(config-router)# passive-interface interface_#
    • Render an interface passive.
    • A good approach to use when there are only a few interfaces to render passive.
  2. Router(config-router)# passive-interface default
    • Render all interfaces passive, and then reenable some interfaces using the no passive-interface interface_# command.
    • A good approach to use when there are many interfaces to render passive, but only a few interfaces that should not be passive.
    • A L3 switch can potentially have many interfaces that should be passive.

Metric/Cost Link to heading

Info
the inverse of the accumulated bandwidth values of the interface.
  • The lower the cost, the more likely the interface is to be used to forward data traffic.
Note
Cost = reference_bandwidth / interface_bandwidth
  • The default reference bandwidth is 100 Mbps = 105 or 10,000 Kbps = 108 or 100,000,000 bps.
  • This reference-bandwidth means that:
    • The default formula is Cost = 100,000,000/interface_bandwidth
    • Ethernet (10GE) interfaces have a cost of 10.
    • FastEthernet (FE) and GigabitEthernet (GE) interfaces have the identical cost of 1 (rounded up from a value lower than 1).

Assigning a Specific Cost Link to heading

Info
overrides all other OSPF cost considerations and thus altering the reference bandwidth.
  • It is very important that the costs for a link match for every router on a given segment.
  • Mismatched cost values on a segment can cause routers to continually run the SPF algorithm, greatly affecting the routers’ performance.
  • Therefore, normally, you will not be changing the default cost values on an interface.
Note
Router(config-if)# ip ospf cost cost_value

Modifying the Interface Bandwidth Link to heading

Info
The higher the interface bandwidth, the lower the cost.
  • Since OSPF uses the inverse of bandwidth as a metric, and serial interfaces default to a bandwidth of 1,544 Kbps, you will definitely want to match the bandwidth metric on the serial interface to its real clock rate.
  • If the clock rate is 64,000, the interface bandwidth metric will be 64 Kbps.
Note
Router(config-if)# bandwidth bandwidth_Kbps

Modifying the Reference Bandwidth Link to heading

Info
The higher the reference bandwidth, the higher the cost.

However, the ensure that the reference bandwidth is consistent across all routers in the area; otherwise, suboptimal routing may occur.

Note
Router(config-router)# auto-cost reference-bandwidth bandwidth_Mbps
  1. Assigns the default reference bandwidth to 100 Mbps which is the default setting: FE = 1, GE = 1, and 10GE = 1.
  2. Assigns the default reference bandwidth to 1000 Mbps or 1 Gbps: FE = 10, GE = 1, and 10GE = 1.
  3. Assigns the default reference bandwidth to 10000 Mbps or 10 Gbps: FE = 100, GE = 10, and 10GE = 1
Tip
Setting the reference cost value too high may cause issues with low-bandwidth interfaces.

Hello Timer Link to heading

Info
On broadcast and P2P links, the default hello timer interval is 10 seconds. On NBMA and point-to-multipoint networks, the default Hello interval is 30 seconds.
Note
Router(config-if)# ip ospf hello-interval timer_value

Dead Timer Link to heading

Info
On broadcast and P2P links, the default dead timer interval is 40 seconds. On NBMA and point-to-multipoint networks, the default dead timer interval is 120 seconds.
Note
Router(config-if)# ip ospf dead-interval timer_value
Tip
Modifying the Dead interval is not necessary because changing the hello timer interval automatically modifies the default Dead interval (which is four times higher).

Default Route Propagation Link to heading

  • This static default route can be propagated to other routers within the OSPF domain.
  • Routers who receive the propagated route will use O*E2 to identify the route in its routing table.
  • Other routers will send any unmatched traffic (not in their own routing table) to the router propagating the default route - who will then forward these traffic using its own static default route.
Note

Router(config)# ip route 0.0.0.0 0.0.0.0 local_interface_#
Router(config)# router ospf process_#
Router(config-router)# default-information originate [always] [metric metric-value] [metric-type type-value]

The always keyword advertises a default route even if a static default route does not exist while the route metric and metric type can be changed.

Route Summarisation Link to heading

Info
OSPF routes can only be summarised between areas (interarea) and is configured on ABRs.

If there are contiguous networks and they cannot easily be summarised, split them into multiple summary commands.

Note

Router(config-router)# area area_# range summary_IP_# summary_subnet_mask {advertise | not-advertise} [cost metric]

The not-advertise keyword sets the address range status to DoNotAdvertise and can be used for route filtering as the type 3 summary LSA is suppressed, and the component networks remain hidden from other networks.

Route Filtering Link to heading

Info
A method for selectively identifying routes that are advertised or received from neighbour routers.

Filtering of routes with vector-based routing protocols is straightforward. This is because the routes are filtered as routing updates and are advertised to downstream neighbours. However, with link-state routing protocols such as OSPF, every router in an area shares a complete copy of the link-state database. Therefore, filtering of routes generally occurs as routes enter the area on the ABR.

Filtering with Summarisation Link to heading

Info
filters summary networks from being advertised to other areas. An easy router filtering method but is limited in its ability to filter.
Note
Router(config-router)# area area_# range summary_IP_# summary_subnet_mask not-advertise
Example

R3(config-router)# area 2 range 10.10.18.0 255.255.255.0 not-advertise

The 10.10.18.0/24 prefix is filtered from being advertised to other areas.

Area Filtering Link to heading

Info
filters networks sent to/from a specific area.
Note

Router(config-router)# ip prefix-list prefix_list_name {permit | deny} IP_#/CIDR_# [{ge | le} length]

The ge/le keyword specifies the minimum/maximum prefix length to be matched.

Router(config)# area area_# filter-list prefix prefix_list_name {in | out}

The in/out keyword filters networks sent to/from the specified area.

Example
  1. Create the following prefix list on R1 to deny 10.10.2.0/24 but permit everything else.

R1(config)# ip prefix-list FILTER-1 deny 10.10.2.0/24
R1(config)# ip prefix-list FILTER-1 permit 0.0.0.0/0 le 32

  1. Enter OSPF router configuration mode and assign the prefix filter incoming in Area 0.

R1(config)# router ospf 123
R1(config-router)# area 0 filter-list prefix FILTER-1 in

The 10.10.2.0/24 prefix is filtered from being advertised into OSPF Area 0.

Local OSPF Filtering Link to heading

Info
To enable a route to exist in the OSPF LSDB (within the same area) and prevent it from being installed in the local routing table, use the distribute list feature.
Note

Router(config-router)# distribute-list {acl_number | acl_name | prefix prefix_list_name | route-map route_map_name} {in | out}

The in/out keyword filters incoming/outgoing routing updates.

Example
  1. Enter an ACL called OSPF-FILTER that denies 10.10.20.0/24 but permits everything else.

R2(config)# ip access-list standard OSPF-FILTER
R2(config-std-nacl)# deny 10.10.20.0 0.0.0.255
R2(config-std-nacl)# permit any

  1. On R2, enter OSPF router configuration mode and assign the distribute list filter.

R2(config)# router ospf 123
R2(config-router)# distribute-list OSPF-FILTER in

The 10.10.20.0/24 prefix still appears in the routing table of other routers in the area. The distribute list only filtered the route from entering the routing table on R2 but is still in the LSDB for this Area.

Equal Cost Load Balancing Link to heading

Info
By default, OSPF allows the installation of up to 4 multiple paths of a single network with identical metrics. This number may be decreased or increased to a maximum of 16.
Note
Router(config)# router ospf process_# Router(config-router)# maximum-paths number_of_paths

Debug Link to heading

TaskIOS Command
Monitor OSPF adjacency events (DR/BDR election process)Router# debug ip ospf adj
Monitor all OSPF eventRouter# debug ip ospf events
Turn off debuggingRouter# undebug all

Verification Link to heading

TaskIOS Command
Filter the routing table to display only the routes learnt through OSPFRouter# show ip route ospf
Show vital OSPF configuration information (advertising networks, neighbouring routers, passive interfaces, AD)Router# show ip protocols
Show OSPF detailed information (process ID, RID, area information, SPF last calculation)Router# show ip ospf
Show a list of neighbour IDs, their state, dead timer, along with the associated interfaceRouter# show ip ospf neighbour
Quickly verify Hello and Dead intervalsRouter# show ip ospf interface
Provide a summary of the interfaces including their area, cost, and stateRouter# show ip ospf interface brief
Show the local LSDB and reveal the presence of different LSA types (sending router ID, age)Router# show ip ospf database
Show LSA type 1 (router link states) detailed informationRouter# show ip ospf database router
Show LSA type 2 (network link states) detailed informationRouter# show ip ospf database network
Show LSA type 3 (summary area border link states) detailed informationRouter# show ip ospf database summary
Show LSA type 4 (summary AS border link states) detailed informationRouter# show ip ospf database asbr-summary
Show LSA type 5 (AS external link states) detailed informationRouter# show ip ospf database external

Troubleshooting Link to heading

Neighbour and Adjacency Problems Link to heading

  • OSPF is not enabled on the interface, or a network router configuration command is misconfigured or missing.
  • Mismatched Hello or dead timers, E-bits (set for stub areas), area IDs, authentication types, or network masks.
  • Access list is misconfigured and might be blocking OSPF Hellos.
  • Virtual link and stub area configurations are mismatched.
  • OSPF is not enabled on the interface.
  • Interface is defined as passive.
  • Mismatched Hello/Dead interval.
  • Mismatched authentication key.
  • Mismatched area ID.
  • Layer 2 is down.
  • Interface is defined as passive under OSPF.
  • Mismatched subnet number/mask over a broadcast link.
  • Mismatched authentication type (plaintext versus MD5).
  • Mismatched stub/transit/NSSA options.
  • No network type is defined over NBMA (Frame Relay, X.25, SMDS, and so on).
  • Frame-relay/dialer-map statement is missing the keyword broadcast on both sides.

Stuck in INIT Link to heading

  • One side is blocking the Hello packet.
  • One side is translating (NAT) OSPF Hellos.
  • One side multicast capabilities are broken.
  • Must be a Layer 2 problem.
  • The dialer map or frame-relay map command is missing the broadcast keyword.
  • Router sending Hellos to contact neighbour on NBMA but have received no reply.
  • Neighbour Hellos are getting lost in the NBMA cloud.
  • Neighbour received our Hello but is rejecting it for some reason (Layer 2).

Stuck in EXSTART/EXCHANGE Link to heading

  • If the neighbour is bay router, adjust the interface MTU to match other vendors. OSPF sends the interface MTU in a database description packet. If there is any MTU mismatch, OSPF does not form an adjacency. See this link ๐Ÿ”—.
  • Neighbour RIDs are identical unicast is broken:
    • Wrong VC/DLCI mapping in frame/ATM environment in a highly redundant network.
    • MTU problem, cannot ping across with more than certain length packet.
    • Access list blocking unicast. After 2-way OSPF send unicast packet except P2P links.
    • NAT is translating unicast packet.
  • Between PRI and BRI/dialer and network type is P2P.

Stuck in LOADING Link to heading

  • LS request is being made and neighbour is sending bad packet or corrupt memory:
    • Execute a show ip ospf request-list neighbor RID interface command to see a bad LSA.
    • show log will show OSPF-4-BADLSATYPE message.
  • LS request is being made and neighbour is ignoring the request.
  • MTU mismatch problem. Old IOS does not detect it (RFC 1583).

Routes Missing from Routing Table Link to heading

  • One side is numbered, and the other is unnumbered.
  • IP addresses are flipped, dual serial.
  • Forwarding address is not known or is known via external/static (O*E1, O*E2) - route sum and redistribute connections?
  • Different IP address or mask in P2P networks.
  • distribute-list in is configured.
  • Backbone area became discontiguous.
  • OSPF is enabled on secondary but not on primary.