Enabling OSPF
When you enable OSPF on your system, you can create either a range of OSPF interfaces or a single OSPF interface.
Creating a Range of OSPF Interfaces
To create a range of OSPF interfaces:
- Create an OSPF routing process.
- Create the range of IP addresses associated with the routing process and the corresponding OSPF interfaces.
- Assign an area ID associated with each range of IP addresses.
Each router running OSPF has a database describing a map of the routing domain. This map needs to be identical in all participating routers.
network area
- Use to configure a range of OSPF interfaces and their related area.
- If the specified range matches one or more of the IP addresses configured for IP interfaces, one or more corresponding OSPF interface(s) is created and placed in the specified area.
- Create address ranges that do not overlap; you can attach only the same range of interfaces to a single area.
- You cannot use this command for unnumbered interfaces.
- If the range specified by this command includes an address on an interface that is being referred to by unnumbered interfaces, all of the unnumbered interfaces will begin trying to form adjacencies. If this behavior is not intended, you must reevaluate the interface assignment or the range specified by the command.
- Example 1 shows the creation of one OSPF interface in the backbone area:
host1(config-if)#ip address 2.2.2.1 255.255.0.0host1(config-if)#ip address 2.2.1.1 255.255.0.0 secondaryhost1(config)#router ospf 2host1(config-router)#network 2.2.2.0 0.0.0.255 area 0
- Example 2 shows the creation of two OSPF interfaces, one in the backbone area and one in a non-backbone area:
host1(config-if)#ip address 2.2.2.1 255.255.255.0host1(config-if)#ip address 2.2.1.1 255.255.255.0 secondaryhost1(config)#router ospf 2host1(config-router)#network 2.2.2.0 0.0.0.255 area 0host1(config-router)#network 2.2.1.0 0.0.0.255 area 1This sequence of commands creates two OSPF ranges (2.2.2.0/24 and 2.2.1.0/24), with each range belonging to a different area. Area 0 is configured for 2.2.2.0/24, and area 1 is configured for 2.2.1.0/24. This sequence also creates two OSPF interfaces: one in the backbone area (area 0) using IP address 2.2.2.1, the second in a nonbackbone area (area 1) using IP address 2.2.1.1. This command also creates the two areas if they do not already exist.
Note: The configured network range is not active for summarization until you activate this range for summaries by issuing the area range command. The only range that is active by default if you do not issue the area range command is the network that matches the IP interface's network exactly. (In other words, by default the exact network of the IP interface is going to be summarized into other areas.)![]()
Note: Active for summarization means that the network range is summarized through area summaries—for ABRs only. See the Aggregating OSPF Networks section in this chapter.![]()
ospf enable
host1(config-router)#ospf enable
- The no version of this command is obsolete and may be removed in the future. Use the ospf shutdown command to disable OSPF on the router.
router ospf
- Use to set an OSPF process ID.
- The process ID can be any positive integer 1-65535.
- You must assign a unique ID for each OSPF routing process.
- From a virtual router context you can specify a VRF name. Doing so changes the context to that of the specified VRF and remains so until you exit from the OSPF router context.
- Example
host1(config)#router ospf 5Creating a Single OSPF Interface
To create a single OSPF interface:
- Create an OSPF routing process.
- Create the OSPF interface associated with the IP interface at the specified address.
Each router running OSPF has a database describing a map of the routing domain. This map needs to be identical in all participating routers.
address area
- Use to create an interface in an area on which OSPF runs, on top of the IP interface at the specified IP address.
- You can specify either an IP address or an unnumbered interface.
- Configures OSPF with the default values. You can configure the interface with a nondefault value by using the other address commands. You must first issue the address area command before issuing any other address commands. See Configuring OSPF Interfaces in this chapter for more information.
- Example
host1(config-router)#address 10.10.32.100 area 0.0.0.0ospf enable
host1(config-router)#ospf enable
- The no version of this command is obsolete and may be removed in the future. Use the ospf shutdown command to disable OSPF on the router.
router ospf
- Use to set an OSPF process ID.
- The process ID can be any positive integer 1-65535.
- You must assign a unique ID for each OSPF routing process.
- Example
host1(config)#router ospf 5