0% found this document useful (0 votes)
31 views21 pages

01 Ospf Config

This document discusses configuring single-area OSPFv2 on an enterprise network. It covers enabling OSPF on routers, configuring router IDs, identifying interfaces to participate in OSPF, and verifying DR/BDR adjacencies on multiaccess networks. Specific topics covered include OSPF router configuration mode, router ID precedence, modifying router IDs, using network commands to enable OSPF on interfaces, configuring passive interfaces, and changing point-to-point networks.

Uploaded by

gabi_maris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views21 pages

01 Ospf Config

This document discusses configuring single-area OSPFv2 on an enterprise network. It covers enabling OSPF on routers, configuring router IDs, identifying interfaces to participate in OSPF, and verifying DR/BDR adjacencies on multiaccess networks. Specific topics covered include OSPF router configuration mode, router ID precedence, modifying router IDs, using network commands to enable OSPF on interfaces, configuring passive interfaces, and changing point-to-point networks.

Uploaded by

gabi_maris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Single-Area OSPFv2

Configuration

Enterprise Networking, Security, and Automation v7.0


(ENSA)
OSPF Router ID
OSPF Reference Topology
The figure shows the topology
used for configuring OSPFv2 in this
module. The 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.
OSPF Router ID
Router Configuration Mode for OSPF
OSPFv2 is enabled using the router ospf process-id global configuration mode command.
The process-id value represents a number between 1 and 65,535 and is selected by the network
administrator. The process-id value is locally significant. It is considered best practice to use the
same process-id on all OSPF routers.
R1(config)# router ospf 10
R1(config-router)# ?
area OSPF area parameters
auto-cost Calculate OSPF interface cost according to bandwidth
default-information Control distribution of default information
distance Define an administrative distance
exit Exit from routing protocol configuration mode
log-adjacency-changes Log changes in adjacency state
neighbor Specify a neighbor router
network Enable routing on an IP network
no Negate a command or set its defaults
passive-interface Suppress routing updates on an interface
redistribute Redistribute information from another routing protocol
router-id router-id for this OSPF process
R1(config-router)#
OSPF Router ID
Router ID Order of Precedence
Cisco routers derive the router ID based on
one of three criteria, in the following
preferential order:
1. The router ID is explicitly configured
using the OSPF router-id 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.
3. The router chooses the highest active
IPv4 address of any of its physical
interfaces.
OSPF Router ID
Modify a Router ID
• After a router selects a router ID, an active OSPF router does not allow the router ID to be
changed until the router is reloaded or the OSPF process is reset.
• Clearing the OSPF process is the preferred method to reset the router ID.

R1# show ip protocols | include Router ID


Router ID 10.10.1.1
R1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)# router ospf 10
R1(config-router)# router-id 1.1.1.1
% OSPF: Reload or use "clear ip ospf process" command, for this to take effect
R1(config-router)# end
R1# clear ip ospf process
Reset ALL OSPF processes? [no]: y
*Jun 6 01:09:46.975: %OSPF-5-ADJCHG: Process 10, Nbr 3.3.3.3 on GigabitEthernet0/0/1 from FULL to
DOWN, Neighbor Down: Interface down or detached
*Jun 6 01:09:46.981: %OSPF-5-ADJCHG: Process 10, Nbr 3.3.3.3 on GigabitEthernet0/0/1 from LOADING to
FULL, Loading Done *
R1# show ip protocols | include Router ID
Router ID 1.1.1.1
R1#
Point-to-Point OSPF Networks
Configure OSPF Using the network Command
Within routing configuration mode, there are two ways to identify the interfaces that will
participate in the OSPFv2 routing process.
• In the first example, the wildcard mask identifies the interface based on the network
addresses. Any active interface that is configured with an IPv4 address belonging to that
network will participate in the OSPFv2 routing process.
• Note: Some IOS versions allow the subnet mask to be entered instead of the wildcard mask.
The IOS then converts the subnet mask to the wildcard mask format.

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)#
Point-to-Point OSPF Networks
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.
Point-to-Point OSPF Networks
Configure OSPF Using the network Command (Cont.)
• As an alternative, OSPFv2 can be enabled by specifying the exact interface IPv4 address using
a quad zero wildcard mask. Entering network 10.1.1.5 0.0.0.0 area 0 on R1 tells the router to
enable interface Gigabit Ethernet 0/0/0 for the routing process.
• 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.

R1(config)# router ospf 10


R1(config-router)# network 10.10.1.1 0.0.0.0 area 0
R1(config-router)# network 10.1.1.5 0.0.0.0 area 0
R1(config-router)# network 10.1.1.14 0.0.0.0 area 0
R1(config-router)#
Point-to-Point OSPF Networks
Configure Passive Interfaces
• Use the passive-interface router
configuration mode command to
prevent the transmission of
routing messages through a
router interface, but still allow
that network to be advertised to
other routers.
• The show ip protocols command
is then used to verify that the
interface is listed as passive.
Point-to-Point OSPF Networks
OSPF Point-to-Point Networks
By default, Cisco routers elect a DR and BDR on Ethernet interfaces, even if there is only one
other device on the link. You can verify this with the show ip ospf interface command. The DR/
BDR election process is unnecessary as there can only be two routers on the point-to-point
network between R1 and R2. Notice in the output that the router has designated the network
type as BROADCAST.

R1# show ip ospf interface GigabitEthernet 0/0/0


GigabitEthernet0/0/0 is up, line protocol is up
Internet Address 10.1.1.5/30, Area 0, Attached via Interface Enable
Process ID 10, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 10.1.1.6
Backup Designated router (ID) 1.1.1.1, Interface address 10.1.1.5
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Point-to-Point OSPF Networks
OSPF Point-to-Point Networks (Cont.)
To change this to a point-to-point network, use the interface configuration command ip ospf
network point-to-point on all interfaces where you want to disable the DR/BDR election process.

R1(config)# interface GigabitEthernet 0/0/0


R1(config-if)# ip ospf network point-to-point
*Jun 6 00:44:05.208: %OSPF-5-ADJCHG: Process 10, Nbr 2.2.2.2 on GigabitEthernet0/0/0 from
FULL to DOWN, Neighbor Down: Interface down or detached
*Jun 6 00:44:05.211: %OSPF-5-ADJCHG: Process 10, Nbr 2.2.2.2 on GigabitEthernet0/0/0 from
LOADING to FULL, Loading Done
R1(config-if)# end
R1# show ip ospf interface GigabitEthernet 0/0/0
GigabitEthernet0/0/0 is up, line protocol is up
Internet Address 10.1.1.5/30, Area 0, Attached via Interface Enable
Process ID 10, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1

Topology-MTID Cost Disabled Shutdown Topology Name


Point-to-Point OSPF Networks
Loopbacks and Point-to-Point Networks
• Use loopbacks to provide additional interfaces for a variety of purposes. By default, loopback
interfaces are advertised as /32 host routes.
• To simulate a real LAN, the loopback interface can be configured as a point-to-point
network to advertise the full network.
• What R2 sees when R1 advertises the loopback interface as-is:
R2# show ip route | include 10.10.1
O 10.10.1.1/32 [110/2] via 10.1.1.5, 00:03:05, GigabitEthernet0/0/0

• Configuration change at R1:


R1(config-if)# interface Loopback 0
R1(config-if)# ip ospf network point-to-point

• Result at R2:
R2# show ip route | include 10.10.1
O 10.10.1.0/24 [110/2] via 10.1.1.5, 00:03:05, GigabitEthernet0/0/0
Multiaccess OSPF Networks
Verify DR/BDR Adjacencies
To verify the OSPFv2 adjacencies, use the show ip ospf neighbor command. The state of neighbors
in multiaccess networks can be as follows:
• FULL/DROTHER - This is a DR or BDR router that is fully adjacent with a non-DR or BDR router. 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.
The normal state for an OSPF router is usually FULL. If a router is stuck in another state, it is an
indication that there are problems in forming adjacencies. The only exception to this is the 2-WAY
state, which is normal in a multiaccess broadcast network.
Multiaccess OSPF Networks
Default DR/BDR Election Process
The OSPF DR and BDR election is based on the following criteria, in sequential order:
1. 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.
Multiaccess OSPF Networks
Configure OSPF Priority
The example shows the commands being used to change the R1 G0/0/0 interface priority from 1
to 255 and then reset the OSPF process.

R1(config)# interface GigabitEthernet 0/0/0


R1(config-if)# ip ospf priority 255
R1(config-if)# end
R1# clear ip ospf process
Reset ALL OSPF processes? [no]: y
R1# *Jun 5 03:47:41.563: %OSPF-5-ADJCHG: Process 10, Nbr 2.2.2.2 on GigabitEthernet0/0/0
from FULL to DOWN, Neighbor Down: Interface down or detached
Modify Single-Area OSPFv2
Cisco OSPF Cost Metric
• Routing protocols use a metric to determine the best path of a packet across a network. OSPF
uses cost as a metric. A lower cost indicates a better path.
• The Cisco cost of an interface is inversely proportional to the bandwidth of the interface.
Therefore, a higher bandwidth indicates a lower cost. The formula used to calculate the OSPF
cost is:
Cost = reference bandwidth / interface bandwidth
• The default reference bandwidth is 108 (100,000,000); therefore, the formula is:
Cost = 100,000,000 bps / interface bandwidth in bps
• Because the OSPF cost value must be an integer, FastEthernet, Gigabit Ethernet, and 10 GigE
interfaces share the same cost. To correct this situation, you can:
• Adjust the reference bandwidth with the auto-cost reference-bandwidth
command on each OSPF router.
• Manually set the OSPF cost value with the ip ospf cost command on necessary
interfaces.
Modify Single-Area OSPFv2
Cisco OSPF Cost Metric (Cont.)
Refer to the table for a breakdown of the cost calculation
Modify Single-Area OSPFv2
Verify Hello and Dead Intervals
• The OSPF Hello and Dead intervals are configurable on a per-interface basis.
• The OSPF intervals must match or a neighbor adjacency does not occur.
• To verify the currently configured OSPFv2 interface intervals, use the show ip ospf interface
command. The Gigabit Ethernet 0/0/0 Hello and Dead intervals are set to the default 10
seconds and 40 seconds respectively.

R1# show ip ospf interface g0/0/0


GigabitEthernet0/0/0 is up, line protocol is up
Internet Address 10.1.1.5/30, Area 0, Attached via Interface Enable
Process ID 10, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 10
Topology-MTID Cost Disabled Shutdown Topology Name
0 10 no no Base
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State POINT_TO_POINT
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
(output omitted)
Default Route Propagation
Propagate a Default Static Route in OSPFv2
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.
Note: When configuring static routes, best practice is to use the next-hop IP address. However, when simulating a connection to
the internet, there is no next-hop IP address. Therefore, we use the exit-intf argument.

R2(config)# interface lo1


R2(config-if)# ip address 64.100.0.1 255.255.255.252
R2(config-if)# exit
R2(config)# ip route 0.0.0.0 0.0.0.0 loopback 1
%Default route without gateway, if not a point-to-point interface, may impact performance
R2(config)# router ospf 10
R2(config-router)# default-information originate
R2(config-router)# end
R2#
Verify Single-Area OSPFv2
Verify OSPF Neighbors
After configuring single-area OSPFv2, you will need to verify your configurations. The following
two commands are particularly useful for verifying routing:
• show ip interface brief - This verifies that the desired interfaces are active with correct IP addressing.
• show ip route- This verifies that the routing table contains all the expected routes.
Additional commands for determining that OSPF is operating as expected include the following:
• show ip ospf neighbor
• show ip protocols
• show ip ospf
• show ip ospf interface

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy