[ Contents] [ Prev] [ Next] [ Index] [ Report an Error]

Configuring a Routing Protocol

This section describes how to configure an OSPF backbone area that has two SONET interfaces. You can use it as a starting point for configuring additional protocols at a later time.

The final configuration looks like this:

[edit]
protocols {
ospf {
area 0.0.0.0 {
interface so-0/0/0 {
hello-interval 5;
dead-interval 20;
}
interface so-0/0/1 {
hello-interval 5;
dead-interval 20;
}
}
}
}

Shortcut

You can create this entire configuration with two commands:

[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/0 hello-interval 5 dead-interval 20
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/1 hello-interval 5 dead-interval 20

Longer Configuration Example

This section provides a longer example of creating the above OSPF configuration. In the process, it illustrates how to use the different features of the CLI.

  1. Enter configuration mode by issuing the configure top-level command:

    Notice that the prompt has changed to a pound sign (#) to indicate configuration mode.

  2. To create the above configuration, you start by editing the protocols ospf statements:
  3. Now add the OSPF area:
  4. Add the first interface:

    You now have four nested statements.

  5. Set the hello and dead intervals.
  6. You can see what is configured at the current level with the show command:
  7. You are finished at this level, so back up a level and take a look at what you have so far:

    The interface statement appears because you have moved to the area statement.

  8. Add the second interface:
  9. Back up to the top level and see what you have:

    This configuration now contains the statements you want.

  10. Before committing the configuration (and thereby activating it), verify that the configuration is correct:
  11. Commit the configuration to activate it on the router:

Making Changes to the Routing Protocol Configuration

Suppose you decide to use different dead and hello intervals on interface so-0/0/1. You can make changes to the configuration.

  1. Go directly to the appropriate hierarchy level by typing the full hierarchy path to the statement you want to edit.
  2. If you decide not to run OSPF on the first interface, delete the statement:

    Everything inside the statement you deleted was deleted with it. You can also eliminate the entire OSPF configuration by simply entering delete protocols ospf while at the top level.

  3. If you decide to use the default values for the hello and dead intervals on your remaining interface but you want OSPF to run on that interface, delete the hello and dead interval timers:

    You can set multiple statements at the same time as long as they are all part of the same hierarchy (the path of statements from the top inward, as well as one or more statements at the bottom of the hierarchy). This feature can reduce considerably the number of commands you must enter.

  4. To go back to the original hello and dead interval timers on interface so-0/0/1, enter:
  5. You also can re-create the other interface, as you had it before, with only a single entry:

[ Contents] [ Prev] [ Next] [ Index] [ Report an Error]