Use this procedure to configure OSPFv2 on the near end and far end nodes to enable automatic topology discovery.
Use this task to configure OSPFv2 on the near end and far end nodes of the topology shown in this image.
OSPFv2 supports only IPv4 addressing.
Procedure
-
Configure the interfaces.
- Use the interface Loopback command to configure the loopback interface IPv4 address, which is the primary loopback address that you want to reuse for all areas.
Example:
Node 1:
RP/0/CPU0:ios(config)# interface Loopback 0 RP/0/CPU0:ios(config-if)# ipv4 address 10.10.10.10 255.255.255.255 RP/0/CPU0:ios(config-if)# no shut RP/0/CPU0:ios(config-if)# exitNode 2:
RP/0/CPU0:ios(config)# interface Loopback 0 RP/0/CPU0:ios(config-if)# ipv4 address 10.10.10.11 255.255.255.255 RP/0/CPU0:ios(config-if)# no shut RP/0/CPU0:ios(config-if)# exit - Use the interface GigabitEthernet command to configure the Gigabit Ethernet interface for the OSC link.
Example:
Node 1:
RP/0/CPU0:ios(config)# interface GigabitEthernet 0/1/0/5 RP/0/CPU0:ios(config-if)# ipv4 point-to-point RP/0/CPU0:ios(config-if)# ipv4 unnumbered Loopback0 RP/0/CPU0:ios(config-if)# no shut RP/0/CPU0:ios(config-if)# exitNode 2:
RP/0/CPU0:ios(config)# interface GigabitEthernet 0/3/0/5 RP/0/CPU0:ios(config-if)# ipv4 address 10.1.1.2 255.255.255.0 RP/0/CPU0:ios(config-if)# no shut RP/0/CPU0:ios(config-if)# exit
- Use the interface Loopback command to configure the loopback interface IPv4 address, which is the primary loopback address that you want to reuse for all areas.
-
Configure the OSPF process:
- Use the router ospf process-name to enable OSPF routing.
- Use the distribute link-state keyword to distribute OSPF link-state data.
- Use the segment-routing mpls keyword to enable MPLS-based segment routing for the OSPF process.
This step is optional.
- Use the network point-to-point keyword to configure an interface OSPF network type to point-to-point.
- Use the area keyword to configure an OSPF area.
Example:
Node 1 and 2:
RP/0/RP0/CPU0:ios(config)# router ospf 1 RP/0/RP0/CPU0:ios(config-ospf)#distribute link-state RP/0/RP0/CPU0:ios(config-ospf)#segment-routing mpls RP/0/RP0/CPU0:ios(config-ospf)#area 0 -
Add the configured interfaces to the OSPF area.
Example:
Node 1:
RP/0/RP0/CPU0:ios(config-ospf-ar)# interface Loopback 0 RP/0/RP0/CPU0:ios(config-ospf-ar-if)# exit RP/0/RP0/CPU0:ios(config-ospf-ar)# interface GigabitEthernet 0/1/0/5Node 2:
RP/0/RP0/CPU0:ios(config-ospf-ar)# interface Loopback 0 RP/0/RP0/CPU0:ios(config-ospf-ar-if)# exit RP/0/RP0/CPU0:ios(config-ospf-ar)# interface GigabitEthernet 0/3/0/5 -
Exit the OSPF area configuration mode and commit your configuration.
Example:
Node 1 and 2:
RP/0/RP0/CPU0:ios(config-ospf-ar-if)# exit RP/0/RP0/CPU0:ios(config-ospf-ar)# exit RP/0/(config-ospf)# exit RP/0/RP0/CPU0:ios(config)# commit RP/0/RP0/CPU0:ios(config)# exit