www.howtonetwork.org

CCNA & CCNP Certifcation Training

  • About
  • Contact
  • FAQ
  • Join
  • Home
  • CCNA
    • ICND1
    • ICND2
    • 101 CCNA LABS
  • CCNP
    • ROUTE
    • SWITCH
    • TSHOOT
    • 101 CCNP LABS
  • CompTIA
    • Security+
    • Network+
  • Design
    • CCDA
    • CCDP
You are here: Home / ICND1 / Day 12 – OSPF Basics / Day 12 Tasks / OSPF Configuration

OSPF Configuration

This section describes OSPF configuration fundamentals.

 

Enabling OSPF in Cisco IOS Software

OSPF is enabled in Cisco IOS software by issuing the router ospf [process id] global configuration command. The [process id] keyword is locally significant and does not need to be the same on all routers in the network in order to establish an adjacency. The use of the locally significant process ID allows you to configure multiple instances of OSPF on the same router.

The OSPF process ID is an integer between 1 and 65535. Each OSPF process maintains its own separate Link State Database; however, all routes are entered into the same IP routing table. In other words, there is no unique IP routing table for each individual OSPF process configured on the router.

In earlier versions of Cisco IOS software, OSPF would not be enabled if the router did not have at least one interface configured with a valid IP address in the up/up state. This restriction has been removed in current versions of Cisco IOS software. In the event that the router has no interfaces configured with a valid IP address and in the up/up state, Cisco IOS will create a Proximity Database (PDB) and allow the process to be created. However, it is important to remember that the process will be inactive until a router ID is selected, which can be performed in the following two ways:

  • Configuring a valid IP address on an interface and bringing the interface up
  • Configuring the router ID manually using the router-id command (see below)

As an example, consider the following router, which has all interfaces disabled:

R3#show ip interface brief

Interface        IP-Address   OK? Method Status                Protocol

FastEthernet0/0  unassigned   YES manual administratively down down

Serial0/0        unassigned   YES NVRAM  administratively down down

Serial0/1        unassigned   YES unset  administratively down down

Next, OSPF is enabled on the router using the router ospf [process id] global configuration command, as illustrated in the following output:

R3(config)#router ospf 1R3(config-router)#exit

Based on this configuration, Cisco IOS software assigns the process a default router ID of 0.0.0.0, as illustrated in the following output of the show ip protocols command:

R3#show ip protocolsRouting Protocol is “ospf 1″Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRouter ID 0.0.0.0

Number of areas in this router is 0. 0 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

Reference bandwidth unit is 100 mbps

Routing Information Sources:

Gateway         Distance      Last Update

 

Distance: (default is 110)

However, the show ip ospf [process id] command reveals that the process is not actually active and indicates that a router ID needs to be configured, as illustrated below:

 

R3#show ip ospf 1%OSPF: Router process 1 is not running, please configure a router-id

 

Enabling OSPF Routing for Interfaces or Networks

After OSPF has been enabled, two actions can be performed to enable OSPF routing for one or more networks or interfaces on the router, as follows:

  • Using the [network] [wildcard] area [area id] router configuration command
  • Using the ip ospf [process id] area [area id] interface configuration command

Unlike EIGRP, the wildcard mask is mandatory in OSPF and must be configured; however, as is the case with EIGRP, it serves the same function in that it matches interfaces within the range specified. As an example, the statement network 10.0.0.0 0.255.255.255 area 0 would enable OSPF routing for interfaces with the IP address and subnet mask combination of 10.0.0.1/30, 10.5.5.1/24, and even 10.10.10.1/25. The interfaces would all be assigned to OSPF Area 0 based on the OSPF network configuration.

NOTE: The wildcard mask for OSPF can also be entered in the same format as a traditional subnet mask, for example, network 10.0.0.0 255.0.0.0 area 0. In this case, Cisco IOS software will invert the subnet mask and the wildcard mask will be entered into the running configuration. In addition, it is important to remember that OSPF also supports the use of the all ones or all zeros wildcard mask to enable OSPF routing for a specific interface. This configuration enables OSPF on a particular interface but the router advertises the actual subnet mask configured on the interface itself.

After the network [network] [wildcard] area [area id] command has been issued, the router sends out Hello packets on interfaces matching the specified network and wildcard mask combination and attempts to discover neighbours. The connected subnet is then advertised to one or more neighbour routers during the OSPF database exchange, and, finally, this information is then added to the OSPF Link State Database of the OSPF routers.

When the network [network] [wildcard] area [area id] command is issued, the router matches the most specific entry in order to determine the area the interface will be assigned to. Consider the following OSPF network statement configurations, as an example:

  • First configuration statement: network 10.0.0.0 0.255.255.255 Area 0
  • Second configuration statement: network 10.1.0.0 0.0.255.255 Area 1
  • Third configuration statement: network 10.1.1.0 0.0.0.255 Area 2
  • Fourth configuration statement: network 10.1.1.1 0.0.0.0 Area 3
  • Fifth configuration statement: network 0.0.0.0 255.255.255.255 Area 4

Following this configuration on the router, the Loopback interfaces shown in Table 12.1 below are then configured on the same router:

 

Table 12.1 – Assigning Interfaces to OSPF Areas

Interface

IP Address/Mask

Loopback 0

10.0.0.1/32

Loopback 1

10.0.1.1/32

Loopback 2

10.1.0.1/32

Loopback 3

10.1.1.1/32

Loopback 4

10.2.0.1/32

 

As was previously stated, when the network [network] [wildcard] area [area id] command is issued, the router matches the most specific entry in order to determine the area in which the interface will be assigned. For the network statement configuration and the Loopback interfaces configured on the router, the show ip ospf interface brief command would show that the interfaces were assigned to the following OSPF areas:

R1#show ip ospf interface brief

Interface    PID   Area    IP Address/Mask    Cost  State Nbrs F/C

Lo4          1     0       10.2.0.1/32        1     LOOP  0/0

Lo1          1     0       10.0.1.1/32        1     LOOP  0/0

Lo0          1     0       10.0.0.1/32        1     LOOP  0/0

Lo2          1     1       10.1.0.1/32        1     LOOP  0/0

Lo3          1     3       10.1.1.1/32        1     LOOP  0/0

NOTE: Regardless of the order in which the network statements are entered, within the running configuration, the most specific entries are listed first in the output of the show running-config command on the router.

The ip ospf [process id] area [area id] interface configuration command negates the need to use the network [network] [wildcard] area [area id] router configuration command. This command enables OSPF routing for the specified interface and assigns the interface to the specified OSPF area. These two commands perform the same basic function and may be used interchangeably.

Additionally, if, for example, two routers are connected back to back, with one router configured using the ip ospf [process id] area [area id] interface configuration command and the neighbour router configured using the network [network] [wildcard] area [area id] router configuration command, then, assuming the area IDs are the same, the routers will successfully establish an OSPF adjacency.

OSPF Areas

The OSPF area ID may be configured either as an integer between 0 and 4294967295 or using dotted-decimal notation (i.e., using the IP address format). Unlike the OSPF process ID, the OSPF area ID must match in order for adjacency to be established. The most common type of OSPF area configuration is using an integer to specify the OSPF area. However, ensure that you are familiar with both supported methods of area configuration.

 

OSPF Router ID

In order for OSPF to operate on a network, each router must have a unique identifying number, and in the context of OSPF the router ID number is used.

 

When determining the OSPF router ID, Cisco IOS selects the highest IP address of configured Loopback interfaces. If no Loopback interfaces are configured, the software uses the highest IP address of all configured physical interfaces as the OSPF router ID. Cisco IOS software also allows administrators to specify the router ID manually using the router-id [address] router configuration command.

Loopback interfaces are very useful, especially during testing because they require no hardware and are logical, so they can never be down.

On the router below, I have configured IP address 1.1.1.1/32 for Loopback0 and 2.2.2.2/24 for F0/0. I then configured OSPF for all interfaces on the router:

Router(config-if)#router ospf 1

Router(config-router)#net 0.0.0.0 255.255.255.255 area 0

Router(config-router)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

 

Router#show ip protocols

 

Routing Protocol is “ospf 1”

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

  Router ID 1.1.1.1

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

0.0.0.0 255.255.255.255 area 0

Routing Information Sources:

Gateway         Distance      Last Update

1.1.1.1              110      00:00:14

Distance: (default is 110)

I want to hard code the router ID to 10.10.10.1. I could have done this by configuring another Loopback interface with this IP address, or I can simply add this at the OSPF router ID. I will have to either reload the router or clear the IP OSPF process on the router in order for this to take effect.

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#router ospf 1

Router(config-router)#router-id 10.10.10.1

Router(config-router)#Reload or use “clear ip ospf process” command, for this to take effect

 

Router(config-router)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

 

Router#clear ip ospf process

Reset ALL OSPF processes? [no]: yes

 

Router#show ip prot

 

Routing Protocol is “ospf 1”

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Router ID 10.10.10.1

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

0.0.0.0 255.255.255.255 area 0

Routing Information Sources:

Gateway         Distance      Last Update

1.1.1.1              110      00:03:15

Distance: (default is 110)

The router ID is of particular importance when it comes to electing the DR and BDR as you will see in Day 39.

 

OSPF Passive Interfaces

Passive interfaces can be described as interfaces over which no routing updates are sent. In Cisco IOS software, an interface is configured as passive by using the passive-interface [name] router configuration command. If there are multiple interfaces on the router that need to be configured as passive, the passive-interface default router configuration command should be used. This command configures all interfaces that fall within the configured network range on the router to be passive. Interfaces on which adjacencies or neighbour relationships should be allowed can then be configured using the no passive-interface [name] router configuration command.

Passive interface configuration works the same for both OSPF and EIGRP in that if an interface is marked as passive, all neighbour relationships via that interface will be torn down and Hello packets will not send or receive packets via that interface. However, the interface will continue to be advertised based on the configured network statement configuration on the router:

Router(config)#router ospf 10

Router(config-router)#passive-interface f0/0

 

Router#show ip ospf int f0/0

FastEthernet0/0 is up, line protocol is up

Internet address is 192.168.1.1/24, Area 0

Process ID 10,Router ID 172.16.1.1,Network Type BROADCAST, Cost: 1

Transmit Delay is 1 sec, State WAITING, Priority 1

No designated router on this network

No backup designated router on this network

Timer intervals configured,Hello 10, Dead 40, Wait 40,Retransmit 5

No Hellos (Passive interface)

 

Prev

About Us

This is a free bonus site for members of www.howtonetwork.com

Copyright

The content on this copyright Reality Press Ltd.
Copyright Reality Press Ltd.