Example: Controlling OSPF Route Selection in the Forwarding Table

This example shows how to control OSPF route selection in the forwarding table.

Requirements

Before you begin:

  1. Configure network interfaces. See the Junos OS Interfaces Configuration Guide for Security Devices.
  2. Configure security filters. See the Junos OS Security Configuration Guide.
  3. Configure the router identifiers for the devices in your OSPF network. See Example: Configuring an OSPF Router Identifier.
  4. Control OSPF designated router election. See Example: Controlling OSPF Designated Router Election.
  5. Create the backbone area for your OSPF network and add the appropriate interfaces to the area. See Example: Configuring a Single-Area OSPF Network.

    Note: Once you complete this step, OSPF begins sending LSAs. No additional configuration is required to enable OSPF traffic on the network.

  6. Configure a multiarea OSPF network. See Example: Configuring a Multiarea OSPF Network.
  7. Configure OSPF stub and not-so-stubby areas. See Example: Configuring OSPF Stub and Not-So-Stubby Areas.
  8. Enable authentication for OSPF exchanges. See Example: Enabling Authentication for OSPF Exchanges.
  9. Control the cost of individual OSPF network segments. See Example: Controlling the Cost of Individual OSPF Network Segments.

Overview

In this example, you set the external route preference to 130 and the internal route preference to 7.

Configuration

Step-by-Step Procedure

To control OSPF route selection in the forwarding table:

  1. Configure OSPF and set the external and internal routing preferences.
    [edit]user@host# set protocols ospf external-preference 130 preference 7
  2. If you are done configuring the device, commit the configuration.
    [edit]user@host# commit

Verification

To verify the configuration is working properly, enter the show protocols ospf command.

Verifying OSPF-Enabled Interfaces

Purpose

Verify that OSPF is running on a particular interface and that the interface is in the desired area.

Action

From operational mode, enter the show ospf interface command.


user@host> show ospf interface
Intf                State     Area            DR ID           BDR ID       Nbrs
at-5/1/0.0          PtToPt   0.0.0.0         0.0.0.0         0.0.0.0         1
ge-2/3/0.0          DR       0.0.0.0         192.168.4.16    192.168.4.15    1
lo0.0               DR       0.0.0.0         192.168.4.16    0.0.0.0         0
so-0/0/0.0          Down     0.0.0.0         0.0.0.0         0.0.0.0         0
so-6/0/1.0          PtToPt   0.0.0.0         0.0.0.0         0.0.0.0         1
so-6/0/2.0          Down     0.0.0.0         0.0.0.0         0.0.0.0         0
so-6/0/3.0          PtToPt   0.0.0.0         0.0.0.0         0.0.0.0         1

Meaning

The output shows a list of the device interfaces that are configured for OSPF. Verify the following information:

Verifying OSPF Neighbors

Purpose

OSPF neighbors are interfaces that have an immediate adjacency. On a point-to-point connection between the device and another router running OSPF, verify that each router has a single OSPF neighbor.

Action

From operational mode, enter the show ospf neighbor command.


user@host> show ospf neighbor
 Address         Intf               State      ID              Pri  Dead
192.168.254.225  fxp3.0              2Way      10.250.240.32    128   36
192.168.254.230  fxp3.0              Full      10.250.240.8     128   38
192.168.254.229  fxp3.0              Full      10.250.240.35    128   33
10.1.1.129       fxp2.0              Full      10.250.240.12    128   37
10.1.1.131       fxp2.0              Full      10.250.240.11    128   38
10.1.2.1         fxp1.0              Full      10.250.240.9     128   32
10.1.2.81        fxp0.0              Full      10.250.240.10    128   33

Meaning

The output shows a list of the device's OSPF neighbors and their addresses, interfaces, states, router IDs, priorities, and number of seconds allowed for inactivity (“dead” time). Verify the following information:

Verifying the Number of OSPF Routes

Purpose

Verify that the OSPF routing table has entries for the following:

For example, Figure 21 shows a sample network with an OSPF topology.

Figure 21: Sample OSPF Network Topology

Image g015031.gif

In this topology, OSPF is being run on all interfaces. Each segment in the network is identified by an address with a /24 prefix, with interfaces on either end of the segment being identified by unique IP addresses.

Action

From operational mode, enter the show ospf route command.


user@host> show ospf route
Prefix               Path   Route       NH   Metric  NextHop       Nexthop
                     Type   Type        Type         Interface     addr/label
10.10.10.1/24        Intra  Network     IP   1       ge-0/0/2.0    10.0.21.1
10.10.10.2/24        Intra  Network     IP   1       ge-0/0/2.0    10.0.21.1
10.10.10.4/24        Intra  Network     IP   1       ge-0/0/1.0    10.0.13.1
10.10.10.5/24        Intra  Network     IP   1       ge-0/0/2.0    10.0.21.1
10.10.10.6/24        Intra  Network     IP   1       ge-0/0/1.0    10.0.13.1
10.10.10.10/24       Intra  Network     IP   1       ge-0/0/2.0    10.0.21.1
10.10.10.11/24       Intra  Network     IP   1       ge-0/0/1.0    10.0.13.1
10.10.10.13/24       Intra  Network     IP   1       ge-0/0/1.0
10.10.10.16/24       Intra  Network     IP   1       ge-0/0/1.0    10.0.13.1
10.10.10.19/24       Intra  Network     IP   1       ge-0/0/1.0    10.0.13.1
10.10.10.20/24       Intra  Network     IP   1       ge-0/0/2.0    10.0.21.1
10.10.10.21/24       Intra  Network     IP   1       ge-0/0/2.0
192.168.5.1          Intra  Router      IP   1       ge-0/0/2.0    10.0.21.1
192.168.5.2          Intra  Router      IP   1       lo0
192.168.5.3          Intra  Router      IP   1       ge-0/0/1.0    10.0.13.1
192.168.5.4          Intra  Router      IP   1       ge-0/0/1.0    10.0.13.1
192.168.5.5          Intra  Router      IP   1       ge-0/0/1.0    10.0.13.1
192.168.5.6          Intra  Router      IP   1       ge-0/0/2.0    10.0.21.1
192.168.5.7          Intra  Router      IP   1       ge-0/0/2.0    10.0.21.1
192.168.5.8          Intra  Router      IP   1       ge-0/0/2.0    10.0.21.1
192.168.5.9          Intra  Router      IP   1       ge-0/0/1.0    10.0.13.1

Meaning

The output lists each route, sorted by IP address. Routes are shown with a route type of Network, and loopback addresses are shown with a route type of Router.

For the example shown in Figure 22, verify that the OSPF routing table has 21 entries, one for each network segment and one for each router's loopback address.

Verifying Reachability of All Hosts in an OSPF Network

Purpose

By using the traceroute tool on each loopback address in the network, verify that all hosts in the network are reachable from each device.

Action

For each device in the OSPF network:

  1. In the J-Web interface, select Troubleshoot>Traceroute.
  2. In the Host Name box, type the name of a host for which you want to verify reachability from the device.
  3. Click Start. Output appears on a separate page.
1 172.17.40.254 (172.17.40.254) 0.362 ms 0.284 ms 0.251 ms
2 routera-fxp0.englab.mycompany.net (192.168.71.246) 0.251 ms 0.235 ms 0.200 ms

Meaning

Each numbered row in the output indicates a routing “hop” in the path to the host. The three-time increments indicate the round-trip time (RTT) between the device and the hop, for each traceroute packet. To ensure that the OSPF network is healthy, verify the following information:

Related Topics