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;
- }
- }
- }
- }
This topic contains the following examples of configuring a routing protocol:
- [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
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.
- user@host> configure
- entering configuration mode
- [edit]
- user@host#
Notice that the prompt has changed to a pound sign (#) to indicate configuration mode.
- [edit]
- user@host# edit protocols ospf
- [edit protocols ospf]
- user@host#
- [edit protocols ospf]
- user@host# edit area 0.0.0.0
- [edit protocols ospf area 0.0.0.0]
- user@host#
- [edit protocols ospf area 0.0.0.0]
- user@host# edit interface so0
- [edit protocols ospf area 0.0.0.0 interface so-0/0/0]
- user@host#
You now have four nested statements.
[edit protocols ospf area 0.0.0.0 interface so-0/0/0]
user@host#set ?
Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups > authentication > bfd-liveness-detection Bidirectional Forwarding Detection options dead-interval Dead interval (seconds) (1..65535) demand-circuit Interface functions as a demand circuit disable Disable OSPF on this interface hello-interval Hello interval (seconds) (1..255) interface-type Type of interface ipsec-sa IPSec security association name > ldp-synchronization Advertise maximum metric until LDP is operational metric Interface metric (1..65535) > neighbor NBMA neighbor no-neighbor-down-notification Don't inform other protocols about neighbor down events > passive Do not run OSPF, but advertise it poll-interval Poll interval for NBMA interfaces (1..65535) priority Designated router priority (0..255) retransmit-interval Retransmission interval (seconds) (1..65535) te-metric Traffic engineering metric (1..65535) transit-delay Transit delay (seconds) (1..65535) [edit protocols ospf area 0.0.0.0 interface so-0/0/0.0]
user@host# set hello-interval 5
user@host# set dead-interval 20
user@host#
- [edit protocols ospf area 0.0.0.0 interface so-0/0/0]
- user@host# show
- hello-interval 5;
- dead-interval 20;
- [edit protocols ospf area 0.0.0.0 interface so-0/0/0]
- user@host#
- [edit protocols ospf area 0.0.0.0 interface so-0/0/0]
- user@host# up
- [edit protocols ospf area 0.0.0.0]
- user@host# show
- interface so-0/0/0 {
- hello-interval 5;
- dead-interval 20;
- }
- [edit protocols ospf area 0.0.0.0]
- user@host#
The interface statement appears because you have moved to the area statement.
- [edit protocols ospf area 0.0.0.0]
- user@host# edit interface so-0/0/1
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# set hello-interval 5
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# set dead-interval 20
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# up
- [edit protocols ospf area 0.0.0.0]
- user@host# show
- interface so-0/0/0 {
- hello-interval 5;
- dead-interval 20;
- }
- interface so-0/0/1 {
- hello-interval 5;
- dead-interval 20;
- }
- [edit protocols ospf area 0.0.0.0]
- user@host#
- [edit protocols ospf area 0.0.0.0]
- user@host# top
- [edit]
- user@host# show
- 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;
- }
- }
- }
- }
- [edit]
- user@host#
This configuration now contains the statements you want.
- [edit]
- user@host# commit check
- configuration check succeeds
- [edit]
- user@host#
- [edit]
- user@host# commit
- commit complete
- [edit]
- user@host#
Suppose you decide to use different dead and hello intervals on interface so-0/0/1. You can make changes to the configuration.
- [edit]
- user@host# edit protocols ospf area 0.0.0.0
interface so-0/0/1
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# show
- hello-interval 5;
- dead-interval 20;
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# set hello-interval 7
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# set dead-interval 28
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# top
- [edit]
- user@host# show
- 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 7;
- dead-interval 28;
- }
- }
- }
- }
- [edit]
- user@host#
- [edit]
- user@host# edit protocols ospf area 0.0.0.0
- [edit protocols ospf area 0.0.0.0]
- user@host# delete interface so-0/0/0
- [edit protocols ospf area 0.0.0.0]
- user@host# top
- [edit]
- user@host# show
- protocols {
-
- ospf {
-
- area 0.0.0.0 {
-
- interface so-0/0/1 {
- hello-interval 7;
- dead-interval 28;
- }
- }
- }
- }
- [edit]
- user@host#
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.
- [edit]
- user@host# edit protocols ospf area 0.0.0.0
interface so-0/0/1
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# delete hello-interval
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# delete dead-interval
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# top
- [edit]
- user@host# show
- protocols {
-
- ospf {
-
- area 0.0.0.0 {
- interface so-0/0/1;
- }
- }
- }
- [edit]
- user@host#
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.
- [edit]
- user@host# edit protocols ospf area 0.0.0.0
interface so-0/0/1
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# set hello-interval 5 dead-interval
20
- [edit protocols ospf area 0.0.0.0 interface so-0/0/1]
- user@host# exit
- [edit]
- user@host# show
- protocols {
-
- ospf {
-
- area 0.0.0.0 {
-
- interface so-0/0/1 {
- hello-interval 5;
- dead-interval 20;
- }
- }
- }
- }
- [edit]
- user@host#
- [edit]
- user@host# set protocols ospf area 0.0.0.0
interface so-0/0/1 hello-interval 5 dead-interval
20
- [edit]
- user@host# show
- 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;
- }
- }
- }
- }
- [edit]
- user@host#