O'Reilly logo

JUNOS Cookbook by Aviva Garrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.1. Configuring OSPF

Problem

Your want to configure OSPF on a JUNOS router.

Solution

You enable OSPF by defining the interfaces on which it will run and the area to which the interfaces will be attached:

	[edit protocols]
	aviva@RouterG# set ospf area 0.0.0.0 interface fe-0/0/1.0
	aviva@RouterG# set ospf area 0.0.0.0 interface fe-1/0/1.0

Discussion

The basic setup for configuring a single OSPF area is straightforward. Enable the protocol on all router interfaces that will participate in the OSPF domain and specify which area the interfaces are in. In this recipe, area 0 has three routers (see Figure 12-1).

In this recipe, we configure OSPF on two interfaces of a router that is in the backbone area, which has an area identifier of 0.0.0.0. In addition, the router must have a router ID to identify the router from which OSPF packets originate. In this recipe, we don't set one explicitly because we have configured a unicast IP address on the router's lo0 interface and this address is used as the router ID:

	aviva@RouterG> show configuration interfaces lo0
	unit 0 {
	     family inet {
	          address 192.168.19.1/32;
	     }
	}
OSPF single-area topology

Figure 12-1. OSPF single-area topology

You do not need to explicitly configure OSPF to run on lo0, because the JUNOS software automatically configures lo0 as a stub network if the router ID is the same as the address on the lo0 interface (which is what is recommended). Use the following command ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required