The main purpose of loopback interfaces is to provide one or more permanent addresses to a network device, regardless of which network interfaces are up. A loopback address is typically announced into the routing tables, and can therefore be used as a management address instead of a physical interface address. This is preferable since a loopback interface is independent from any physical interface and is, therefore, always available. This also enables to configure unnumbered point-to-point interfaces (for example with a PPPv4 server) A loopback address will typically be used in IPv4 packets. Finally, a prefix configured on a loopback interface can be used to announce some directly connected networks via dynamic routing protocols.

To configure loopback, enter the context interface type loopback from the VRF in which you plan to define a loopback logical interface.

vsr running vrf main# interface loopback loop0
vsr running loopback loop0# commit

Let’s fetch the state after committing this configuration:

vsr running vrf main# interface loopback loop0
vsr running loopback loop0# show state
loopback loop0
    oper-status UP
    enabled true
    mtu 1500
        in-octets 0
        out-octets 0
        in-errors 0
        in-unicast-pkts 0
        in-discards 0
        out-unicast-pkts 0
        out-errors 0
        out-discards 0
        mac-address 26:16:54:8d:10:0a
        address fe80::2416:54ff:fe8d:100a/64

The same configuration can be made using this NETCONF XML configuration:

vsr running loopback loop0# show config xml absolute
<config xmlns="urn:6wind:vrouter">
    <interface xmlns="urn:6wind:vrouter/interface">
      <loopback xmlns="urn:6wind:vrouter/loopback">

See also

The command reference for details.