JNCIP-SP: basic OSPF configuration.

This is going to be the start of everything OSPF in JNCIP-SP. During subsequent OSPF articles, I will constantly build upon this lab, adding routers along the way. Currently, at the start of this lab, there are only the following three routers:


This part will be about configuring basic neighbor relationships between R11 and R13 and between R13 and R12. At the end, there will be IP connectivity between the loopback addresses that belong to R11 and R12.

Let’s start the first neighbor relationship between R11 and R13 with a minimum amount of configuration:

set protocols ospf area interface ge-0/0/0.3030

The above command starts OSPF on the router. The referenced interface is placed into the backbone area, area, and the interface will start sending out Hello’s.

Since the router was configured with a loopback IP address (, that IP address was selected as a router-id. The selection of the router-id on a Juniper router is as follows;
1. Use the explicitly defined router-id statement configured under the [ edit routing-options] hierarchy (configuring the router-id is actually the best practice)
2. Use the lowest valid loopback IP address
3. Use the lowest configured physical IP address of an interface

To establish a neighbor relationship between R11 and R13, we need to start OSPF on R13 as well;


We can see that after committing, R13 has R11 as a neighbor. Besides this, we can also see that there is no connectivity between the loopback IP addresses of R11 and R13. This is because there is no routing information for the loopback IP addresses in the LSDB yet, despite the misleading Router-LSA’s named and

To achieve IP connectivity between the loopback IP addresses, we can configure the loopback interface under OSPF like this;

set protocols ospf area interface lo0.13

After enabling the loopback interface in the OSPF configuration hierarchy on both R11 and R13, they will be able to exchange packets between their loopback interfaces;


Let’s observe the following change in the Router-LSA that is generted by R11 after placing the loopback interface in the OSPF configuration.


Before including the loopback interface, we can see that R11 is advertising a Router-LSA with the ID This LSA listed only 1 link, the directly connected link which was included in the OSPF configuration.

After issuing the configuration command ‘set protocols ospf area interface lo0.11’, the Router-LSA changed its link count to 2. It added the loopback interface to the list of prefixes. A Router-LSA is originated by a router for each area that it belongs to. It describes the collected states of the router’s links to the area. The LSA is flooded throughout the area in which it is originated and no further. A more detailed explanation on LSA's will follow in a later post.

With this basic configuration, the interface is treated as a multi-access segment. This can be seen in the following output, where it is apparent that a DR/BDR election was held:


OSPF treats multiaccess segments differently from point-to-point links. On multiaccess segments, there is a DR/BDR election. What this is will be discussed in a later post. For now, the important thing to realize now is that this adds time to the neighbor relationship establishment.

Even though we configured the link with a /30 subnet, leaving room for only two hosts, you still have to tell Junos to make the link-type point-to-point, so let’s do that:


Beware, the interface type must match on both ends. After issuing the configuration commands, the neighbor will be listed as PtToPt and both DR and BDR fields will display ‘’:


This might seem like a pretty trivial thing, but the DR/BDR election can take up to 40 seconds of wait time between two adjacent routers. Also, besides the wait time, there is another advantage. There will be one less Network-LSA in the LSDB per multiaccess segment.

The last thing to do is finishing the configuration on R12. The configuration below is what I regard as being the most basic Junos OSPF configuration;


There are two extra configuration statements added that were not seen before on R13 and R11. The first one is the configuration of the router-id. The second is the addition of the keyword passive to the loopback interface. Adding passive to an interface means OSPF will only advertise the link, not try to establish a neighbor relationship across it. The configuration of both of these things can be regarded as best practice.

After the configuration of R12 (and of course the R12-facing interface on R13), there is IP connectivity between the R12 and R11 loopback interfaces;


That's a first step. Next, let's take a closer look into the OSPF neighbor establishment and the packets involved in OSPF.