Module 2
Module 2
Module 2
• The figure shows the topology used for configuring OSPFv2 in this module. T
• he routers in the topology have a starting configuration, including interface addresses.
• There is currently no static routing or dynamic routing configured on any of the routers.
• All interfaces on R1, R2, and R3 (except the loopback 1 on R2) are within the OSPF
backbone area. The ISP router is used as the gateway to the internet of the routing domain
Command
Router configuration mode for ospf R1(config)# router ospf 10
Router configuration mode for ospf
Router ID
• An OSPF router ID is a 32-bit value, represented as an IPv4 address. It is used to uniquely identify an OSPF router,
and all OSPF packets include the router ID of the originating router.
Every router requires a router ID to participate in an OSPF domain. It can be defined by an administrator or automatically
assigned by the router. The router ID is used by an OSPF-enabled router to do the following
A 32-bit host route would not get advertised as a route to other OSPF routers.
OSPF does not need to be enabled on an interface for that interface to be
chosen as the router ID.
Specify the interfaces that belong to a point-to-point network Router(config-router)# network network-address wildcard-
mask area area-id
• The network-address wildcard-mask syntax is used
to enable OSPF on interfaces. Any interfaces on a
router that match this part of the command are
enabled to send and receive OSPF packets.
• The area area-id syntax refers to the OSPF area.
When configuring single-area OSPFv2, the network
command must be configured with the same area-id
value on all routers. Although any area ID can be
used, it is good practice to use an area ID of 0 with
single-area OSPFv2.
• This convention makes it easier if the network is
later altered to support multiarea OSPFv2.
The wildcard mask
• The wildcard mask is typically the inverse of the subnet mask configured on that interface.
• The easiest method for calculating a wildcard mask is to subtract the network subnet mask from 255.255.255.255, as
shown for /24 and /26 subnet masks in the figure
Configure OSPF using network command R1(config)# router ospf 10
R1(config-router)# network 10.10.1.0 0.0.0.255 area 0
R1(config-router)# network 10.1.1.4 0.0.0.3 area 0
R1(config-router)# network 10.1.1.12 0.0.0.3 area 0
R1(config-router)#
Specifying the exact interface IPv4 Address R1(config)# router ospf 10
R1(config-router)# network 10.10.1.1 0.0.0.0 area 0
• Entering network 10.1.1.5 0.0.0.0 area 0 on R1 tells R1(config-router)# network 10.1.1.5 0.0.0.0 area 0
the router to enable interface Gigabit Ethernet 0/0/0 R1(config-router)# network 10.1.1.14 0.0.0.0 area 0
for the routing process. R1(config-router)#
• The advantage of specifying the interface is that the
wildcard mask calculation is not necessary. Notice
that in all cases, the area argument specifies area 0.
Configure OSPF Directly on the interface Router(config-if)# ip ospf 10 area 0
Passive Interface
Inefficient Use of Available bandwidth is consumed transporting unnecessary messages
Bandwidth
Inefficient Use of All devices on the LAN must process and eventually discard the message
Resources
Increased Security Without additional OSPF security configurations, OSPF messages can be intercepted with packet
Risk sniffing software. Routing updates can be modified and sent back to the router, corrupting the
routing table with false metrics that misdirect traffic
• Multiaccess OSPF networks are unique in that one router controls the distribution of LSAs.
• The router that is elected for this role should be determined by the network administrator
through proper configuration
Designated router
• OSPF elects a DR and BDR.
• The DR is responsible for collecting and distributing LSAs sent and received. The DR uses the multicast IPv4
address 224.0.0.5 which is meant for all OSPF routers.
• A BDR is also elected in case the DR fails. The BDR listens passively and maintains a relationship with all the
routers. If the DR stops producing Hello packets, the BDR promotes itself and assumes the role of DR.
All other routers become a DROTHER (a router that is neither the DR nor the BDR). DROTHERs use the multiaccess
address 224.0.0.6 (all designated routers) to send OSPF packets to the DR and BDR. Only the DR and BDR listen for
224.0.0.6.
OPSF Multiaccess Reference Topology
• The routers in the network elect the router with the highest interface priority as the DR. The router with the second
highest interface priority is becomes the BDR.
• The priority can be configured to be any number between 0 – 255.
• If the interface priority value is set to 0, that interface cannot be elected as DR nor BDR.
• The default priority of multiaccess broadcast interfaces is 1. 2. If the interface priorities are equal, then the router
with the highest router ID is elected the DR. The router with the second highest router ID is the BDR.
The election process takes place when the first router with an OSPF-enabled interface is active on the network. If all of the
routers on the network have not finished booting, it is possible that a router with a lower router ID becomes the DR. • The
addition of a new router does not initiate a new election process
• After the DR is elected, it remains the DR until one of the following events occurs:
• The DR fails.
• The OSPF process on the DR fails or is stopped.
• The multiaccess interface on the DR fails or is shutdown.
If the DR fails, the BDR is automatically promoted to DR. This is the case even if another DROTHER with a higher priority
or router ID is added to the network after the initial DR/BDR election. However, after a BDR is promoted to DR, a new
BDR election occurs and the DROTHER with the highest priority or router ID is elected as the new BDR
Set priority of an interface ip ospf priority value, where value is 0 to 255
Configure OSPF Priority R1(config)# interface GigabitEthernet 0/0/0
R1(config-if)# ip ospf priority 255
R1(config-if)# end R1# clear ip ospf process
Default Route Propagation
• To propagate a default route, the edge router must be configured with the following:
• A default static route using the ip route 0.0.0.0 0.0.0.0 [next-hop-address | exit-intf] command.
• The default-information originate router configuration command.
• This instructs R2 to be the source of the default route information and propagate the default static route in
OSPF updates. In the example, R2 is configured with a loopback to simulate a connection to the internet.
• A default route is configured and propagated to all other OSPF routers in the routing domain.
verifies that the desired interfaces are active with correct IP addressing. show ip interface brief
verifies that the routing table contains all the expected routes show ip route
verify that the router has formed an adjacency with its neighboring routers. show ip ospf neighbo
If the router ID of the neighboring router is not displayed, or if it does not show as being in a
state of FULL, the two routers have not formed an OSPFv2 adjacency.
• The subnet masks do not match, causing the routers to be on separate networks.
• The OSPFv2 Hello or Dead Timers do not match.
• The OSPFv2 Network Types do not match.
• There is a missing or incorrect OSPFv2 network command
to verify vital OSPF configuration information show ip protocols
• This includes the OSPFv2 process ID, the router ID, interfaces explicitly configured
to advertise OSPF routes,
• the neighbors the router is receiving updates from, and the default administrative
distance, which is 110 for OSPF.
used to examine the OSPFv2 process ID and router ID show ip ospf
• This command displays the OSPFv2 area information and the last time the SPF
algorithm was executed.
provides a detailed list for every OSPFv2-enabled interface. Specify an interface to display Show ip ospf interface
the settings of just that interface
• This command shows the process ID, the local router ID, the type of network, OSPF
cost, DR and BDR information on multiaccess links (not shown), and adjacent
neighbors