Module 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

MODULE 2 : SINGLE-AREA OSPFv2 CONFIGURATION

• 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

Router ID order of Predecedence


• The router ID is explicitly configured using the OSPF routerid rid router configuration mode command. This is the
recommended method to assign a router ID. 2.
• The router chooses the highest IPv4 address of any of configured loopback interfaces.
The router chooses the highest active IPv4 address of any of its physical interfaces

Configure a loopback interface as router ID R1(Config-if) #interface loopback 1


R1(Config-if) #ip address 1.1.1.1
• Instead of relying on physical interface, the router ID can be 255.255.255.255
assigned to a loopback interface. R1(Config-if) #end
• Typically, the IPv4 address for this type of loopback interface should R1#show ip protocols | include router ID
be configured using a 32-bit subnet mask (255.255.255.255). This
effectively creates a host route.

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.

Explicitly Configure a router ID R1(config)# router ospf 10 R1(config-


router)# router-id 1.1.1.1 R1(config-router)#
end
Verify router ID Sh ip protocols
Modify router ID Clear ip ospf process
2.2 Point-to-point OSPF Networks

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

Configure Passive interfaces R1 (Config)# router ospf 10


R1(Config-router)#passive-interface loopback 0
OSPF Point-to-point Networks R1# show ip ospf interface GigabitEthernet 0/0/0

Change point-to-point network Ip ospf point-to-point


Multiaccess OSPF Networks

• 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

• n the multiaccess topology shown


in the figure, there are three
routers interconnected over a
common Ethernet multiaccess
network, 192.168.1.0/24.
• Because the routers are
connected over a common
multiaccess network, OSPF has
automatically elected a DR and
BDR.
• R3 has been elected as the DR
because its router ID is 3.3.3.3,
which is the highest in this
network. R2 is the BDR because
it has the second highest router
ID in the network
Verify OSPF Router roles show ip ospf interface
verify the OSPFv2 show ip ospf neighbor
adjacencies FULL/DROTHER These two neighbors can exchange Hello packets,
updates, queries, replies, and acknowledgments
FULL/DR The router is fully adjacent with the indicated DR
neighbor. These two neighbors can exchange Hello
packets, updates, queries, replies, and acknowledgments
FULL/BDR The router is fully adjacent with the indicated BDR
neighbor. These two neighbors can exchange Hello
packets, updates, queries, replies, and acknowledgments.
2-WAY/DROTHER The non-DR or BDR router has a neighbor relationship
with another non-DR or BDR router. These two
neighbors exchange Hello packets
Default DR/DBR Election Process

• 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

DR Failure and recovery

• 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.

Modify Single-Ares OSPFv2


OSPF Accumulates Cost
• The cost of an OSPF route is the accumulated value from one router to the destination network.
Assuming the auto-cost reference-bandwidth 10000 command has been configured on all three routers, the cost of the links
between each router is now 10. The loopback interfaces have a default cost of 1
Calculate Accumulates Cost
• calculate the cost for each router to reach each network.
• For example, the total cost for R1 to reach the 10.10.2.0/24 network is 11. This is because the link to R2 cost = 10
and the loopback default cost = 1. 10 + 1 = 11.
You can verify this with the show ip route command

change the cost value reported by the local ip ospf cost 10


OSPF router to other OSPF routers
Test Failover to Backup Route • What happens if the link between R1 and R2 goes down?
• You can simulate that by shutting down the Gigabit Ethernet 0/0/0
interface and verifying the routing table is updated to use R3 as the
next-hop router.
• Notice that R1 can now reach the 10.1.1.4/30 network through R3
with a cost value of 50.
Hello packet Intervals • OSPFv2 Hello packets are transmitted to multicast address 224.0.0.5
(all OSPF routers) every 10 seconds.
• This is the default timer value on multiaccess and point-to-point
networks.
• Note: Hello packets are not sent on interfaces set to passive by the
passive-interface command.
• The Dead interval is the period that the router waits to receive a
Hello packet before declaring the neighbor down.
• If the Dead interval expires before the routers receive a Hello packet,
OSPF removes that neighbor from its link-state database (LSDB).
• The router floods the LSDB with information about the down
neighbor out all OSPFenabled interfaces. Cisco uses a default of 4
times the Hello interval. This is 40 seconds on multiaccess and point-
to-point networks.
To verify the currently configured OSPFv2 Show ip ospf interface
interface intervals
to see the Dead Time counting down from 40 Show ip ospf neighbor
seconds/ verify neighbor adjencies
Modify OSPFv2 Intervals Router(config-if)# ip ospf hello-interval seconds Router(config-if)# ip ospf
dead-interval seconds
Reset the intervals to their default • no ip ospf hello-interval
• no ip ospf dead-interval
2.4 Verify single-area OSPF

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

quick summary of OSPFv2-enabled interfaces show ip ospf interface brief


• useful for seeing important information including:
• Interfaces are participating in OSPF
• Networks that are being advertised (IP Address/Mask)
• Cost of each link
• Network state
• Number of neighbors on each link

You might also like