Propagate a Default Static Route in OSPFv2

Your network users will need to send packets out of your network to non-OSPF networks, such as the internet. This is where you will need to have a default static route that they can use. In the topology in the figure, R2 is connected to the internet and should propagate a default route to R1 and R3. The router connected to the internet is sometimes called the edge router or the gateway router. However, in OSPF terminology, the router located between an OSPF routing domain and a non-OSPF network is called the autonomous system boundary router (ASBR).

All that is required for R2 to reach the internet is a default static route to the service provider.

Note: In this example, a loopback interface with IPv4 address 64.100.0.1 is used to simulate the connection to the service provider.

To propagate a default route, the edge router (R2) must be configured with the following:

  • A default static route using the ip route 0.0.0.0 0.0.0.0 [next-hop-address | exit-intf] command.
  • The default-information originate router configuration command. This instructs R2 to be the source of the default route information and propagate the default static route in OSPF updates.

In the following example, R2 is configured with a loopback to simulate a connection to the internet. Then a default route is configured and propagated to all other OSPF routers in the routing domain.

Note: When configuring static routes, best practice is to use the next-hop IP address. However, when simulating a connection to the internet, there is no next-hop IP address. Therefore, we use the exit-intf argument

R2(config)# interface lo1
R2(config-if)# ip address 64.100.0.1 255.255.255.252 
R2(config-if)# exit
R2(config)# ip route 0.0.0.0 0.0.0.0 loopback 1
%Default route without gateway, if not a point-to-point interface, may impact performance
R2(config)# router ospf 10
R2(config-router)# default-information originate
R2(config-router)# end
R2#

Verify the Propagated Default Route

You can verify the default route settings on R2 using the show ip route command. You can also verify that R1 and R3 received a default route.

Notice that the route source on R1 and R3 is O*E2, signifying that it was learned using OSPFv2. The asterisk identifies this as a good candidate for the default route. The E2 designation identifies that it is an external route. The meaning of E1 and E2 is beyond the scope of this module.

Click each button see the output for the show ip route command on each router.

R2 Routing Table

R2# show ip route | begin Gateway
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
S*    0.0.0.0/0 is directly connected, Loopback1
      10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
C        10.1.1.4/30 is directly connected, GigabitEthernet0/0/0
L        10.1.1.6/32 is directly connected, GigabitEthernet0/0/0
C        10.1.1.8/30 is directly connected, GigabitEthernet0/0/1
L        10.1.1.9/32 is directly connected, GigabitEthernet0/0/1
O        10.1.1.12/30 [110/40] via 10.1.1.10, 00:48:42, GigabitEthernet0/0/1
                      [110/40] via 10.1.1.5, 00:59:30, GigabitEthernet0/0/0
O        10.10.1.0/24 [110/20] via 10.1.1.5, 00:59:30, GigabitEthernet0/0/0
C        10.10.2.0/24 is directly connected, Loopback0
L        10.10.2.1/32 is directly connected, Loopback0
O        10.10.3.0/24 [110/20] via 10.1.1.10, 00:48:42, GigabitEthernet0/0/1
      64.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        64.100.0.0/30 is directly connected, Loopback1
L        64.100.0.1/32 is directly connected, Loopback1
R2#

R1 Routing Table

R1# show ip route | begin Gateway
Gateway of last resort is 10.1.1.6 to network 0.0.0.0
O*E2  0.0.0.0/0 [110/1] via 10.1.1.6, 00:11:08, GigabitEthernet0/0/0
      10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
C        10.1.1.4/30 is directly connected, GigabitEthernet0/0/0
L        10.1.1.5/32 is directly connected, GigabitEthernet0/0/0
O        10.1.1.8/30 [110/20] via 10.1.1.6, 00:58:59, GigabitEthernet0/0/0
C        10.1.1.12/30 is directly connected, GigabitEthernet0/0/1
L        10.1.1.14/32 is directly connected, GigabitEthernet0/0/1
C        10.10.1.0/24 is directly connected, Loopback0
L        10.10.1.1/32 is directly connected, Loopback0
O        10.10.2.0/24 [110/20] via 10.1.1.6, 00:58:59, GigabitEthernet0/0/0
O        10.10.3.0/24 [110/30] via 10.1.1.6, 00:48:11, GigabitEthernet0/0/0
R1#
R3 Routing Table
R3# show ip route | begin Gateway
Gateway of last resort is 10.1.1.9 to network 0.0.0.0
O*E2  0.0.0.0/0 [110/1] via 10.1.1.9, 00:12:04, GigabitEthernet0/0/1
      10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
O        10.1.1.4/30 [110/20] via 10.1.1.9, 00:49:08, GigabitEthernet0/0/1
C        10.1.1.8/30 is directly connected, GigabitEthernet0/0/1
L        10.1.1.10/32 is directly connected, GigabitEthernet0/0/1
C        10.1.1.12/30 is directly connected, GigabitEthernet0/0/0
L        10.1.1.13/32 is directly connected, GigabitEthernet0/0/0
O        10.10.1.0/24 [110/30] via 10.1.1.9, 00:49:08, GigabitEthernet0/0/1
O        10.10.2.0/24 [110/20] via 10.1.1.9, 00:49:08, GigabitEthernet0/0/1
C        10.10.3.0/24 is directly connected, Loopback0
L        10.10.3.1/32 is directly connected, Loopback0
R3#

Verify Single-Area OSPFv2