Supported Platforms
Configuring a Loopback Interface
The loopback interface supports many different network and operational functions and is an always-up interface. This means that the loopback interface ensures that the device is reachable, even if some of the physical interfaces are down or removed, or an IP address has changed. In most cases, you always define a loopback interface.
Junos OS follows the IP convention of using lo0 as the loopback interface’s identifier name.
Junos OS requires that the loopback interface always be configured with a /32 network mask, thus avoiding any unnecessary allocation of address space.
If you are using routing instances, you can configure the loopback interface for the default routing instance or for a specific routing instance. The following procedure adds the loopback interface to the default routing instance.
Optionally, instead of configuring the root password at the [edit interfaces] hierarchy level, you can use a configuration group, as shown in this procedure. This is a recommended best practice for configuring the loopback interface. This procedure uses a group called global as an example.
To configure a loopback interface:
- Using the proper IP address that has been allocated to
this particular host, assign it to the loopback interface.
Each host in your network deployment should have a unique loopback interface address. The address used here is only an example.
[edit groups global interfaces lo0 unit 0 family inet]user@host# set address 192.26.0.110/32 - (Optional) Set the address to be preferred.
You can configure as many addresses as you need on the lo0 interface, so it is good practice to make one address preferred.
[edit groups global interfaces lo0 unit 0 family inet]user@host# set address 192.26.0.110/32 preferred - (Optional) Configure additional addresses.
Only unit 0 is permitted as the master loopback interface. If you want to add more IP addresses to unit 0, you configure them in the normal way under unit 0, without the preferred option.
[edit groups global interfaces lo0 unit 0 family inet]user@host# set address 192.168.1.1/32 user@host# set address 192.168.2.1/32 - Configure the localhost address.
On the lo0.0 interface, it is useful to have the IP address 127.0.0.1 configured, as certain processes such as NTP and MPLS ping use this default host address. The 127.0.0.1/32 address is a Martian IP address (an address invalid for routing), so it is never advertised by the Juniper Networks device.
[edit groups global interfaces lo0 unit 0 family inet]user@host# set address 127.0.0.1/32 - (Optional) Configure an ISO address.
Depending on your network configuration, you might also need an ISO address for the IS-IS routing protocol.
[edit groups global interfaces lo0 unit 0 family iso]user@host# address 49.0026.0000.0000.0110.00 - If you used a configuration group, apply the configuration
group, substituting global with the appropriate group name.[edit]user@host# set apply-groups global
- Commit the configuration.user@host# commit