To create a range of OSPFv2 interfaces:
Each router running OSPFv2 has a database describing a map of the routing domain. This map needs to be identical in all participating routers.
network area
- host1(config-if)#ip address 2.2.2.1 255.255.0.0
- host1(config-if)#ip address 2.2.1.1 255.255.0.0
secondary
- host1(config)#router ospf 2
- host1(config-router)#network 2.2.2.0 0.0.0.255
area 0
- host1(config-if)#ip address 2.2.2.1 255.255.255.0
- host1(config-if)#ip address 2.2.1.1 255.255.255.0
secondary
- host1(config)#router ospf 2
- host1(config-router)#network 2.2.2.0 0.0.0.255
area 0
- host1(config-router)#network 2.2.1.0 0.0.0.255
area 1
This 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: Until you activate the configured network range for summaries by issuing the area range command, the range is not active for summarization; the network range is summarized through area summaries—for ABRs only. (See Aggregating OSPF Networks .) 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.) |
ospf enable
- host1(config-router)#ospf enable
router ospf
ipv6 router ospf
- host1(config)#router ospf 5
- host1(config)#ipv6 router ospf 5