Image may be NSFW.
Clik here to view.
Can you configure OSPFv2 without the network command? Today’s post gives you the answers to a recent CLI Lab that lets you practice OSPF interface configuration. Check out the lab, create your answer, and check back here to compare.
Answers
Figure 1: Three Router Triangle with IP Subnets
Image may be NSFW.
Clik here to view.
Example 4: R1 Config
interface GigabitEthernet0/1 ip ospf 11 area 0 ! interface GigabitEthernet0/2 ip ospf 11 area 0 ! router ospf 11 router-id 1.1.1.1
Example 5: R2 Config
interface GigabitEthernet0/1 ip ospf 22 area 0 ! interface GigabitEthernet0/2 ip ospf 22 area 0 ! router ospf 22 router-id 2.2.2.2
Example 6: R3 Config
interface GigabitEthernet0/1 ip ospf 33 area 0 ! interface GigabitEthernet0/2 ip ospf 33 area 0 ! router ospf 33 router-id 3.3.3.3
Commentary
The legacy method of configuring OSPF uses network statements inside of OSPF router configuration mode. The network command causes the OSPF process to match the interfaces that will be included into the OSPF area specified. The alternative is to use commands inside interface configuration mode to specify that it will be included inside the OSPF area specified. This newer interface method is considered by many to be easier and a more readable configuration method.
First, for the OSPF process itself, the configuration sits at the bottom of each of the three examples (Examples 4, 5, and 6). The lab asked that we not rely on interface IP addresses to find an OSPF router ID, so R1 is configured with a router-id of 1.1.1.1, R2 with a router-id of 2.2.2.2 and R3 with a router-id of 3.3.3.3, using the router-id command. This command is still located under OSPF router configuration mode even when using interface configuration commands to specify the included OSPF interfaces.
Note the absence of network commands under the router ospf commands.
Individual ip ospf process-id area area-id interface subcommands replace the network command’s purpose. Each of these commands enables the OSPF process listed by number – process number 11 on router R1, 22 on R2, and 33 on R3. Note that as always, OSPF process IDs are local settings and do not need to match between neighboring routers. However, the Individual ip ospf process-id area area-id interface subcommands must refer to that local router’s own process ID.
Note that the Individual ip ospf process-id area area-id interface subcommands also refer to the OSPF area, which in this lab is area 0 in all cases.