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


Configure the Loopback Interface

On the router, you can configure one physical loopback interface, lo0, and one or more addresses on the interface. To do this, include the following statements at the [edit interfaces] hierarchy level:

[edit interfaces]
lo0 {
    unit 0 {
        family inet {
            address loopback-address;
            address <loopback-address2>;
            ...
        }
    }
}

When specifying the loopback address, do not include a destination prefix. Also, in most cases, do not specify a loopback address on any unit other than unit 0.

For Layer 3 virtual private networks (VPNs), you can configure multiple logical units for the loopback interface. This allows you to configure a logical loopback interface for each virtual routing and forwarding (VRF) routing instance. For more information, see the JUNOS Internet Software Configuration Guide: VPNs.


If you configure the loopback interface, it is automatically used for unnumbered interfaces. If you do not configure the loopback interface, the router chooses the first interface to come online as the default. If you configure more than one address on the loopback interface, we recommend that you configure one to be the primary address to ensure that it is selected for use with unnumbered interfaces. By default, the primary address is used as the source address when packets originate from the interface.

For more information about unnumbered interfaces, see Configure an Unnumbered Interface. For more information about primary addresses, see Configure the Interface Address.

Example: Configure the Loopback Interface

Configure two addresses on the loopback interface:

[edit]
user@host# edit interfaces lo0 unit 0 family inet
[edit interfaces lo0 unit 0 family inet]
user@host# set address 127.0.0.1 
[edit interfaces lo0 unit 0 family inet]
user@host# set address 10.0.0.1 
[edit interfaces lo0 unit 0 family inet]
user@host# top
[edit]
user@host# show
interfaces {
    lo0 {
        unit 0 {
            family inet {
                127.0.0.1;
                10.0.0.1;
            }
        }
    }
}


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