Loopback

The loopback networking interface is a virtual network device implemented entirely in software. All traffic sent to it “loops back” and just targets services on your local machine.

Note

There can only be one loopback lo interface on the system. If you need multiple interfaces, please use the Dummy interface type.

Hint

A lookback interface is always up, thus it could be used for management traffic or as source/destination for and IGP like BGP so your internal BGP link is not dependent on physical link states and multiple routes can be chosen to the destination. A Dummy Interface should always be preferred over a Loopback interface.

Configuration

Common interface configuration

set interfaces loopback <interface> address <address>

Configure interface <interface> with one or more interface addresses.

  • address can be specified multiple times as IPv4 and/or IPv6 address, e.g. 192.0.2.1/24 and/or 2001:db8::1/64

Example:

set interfaces loopback lo address 192.0.2.1/24
set interfaces loopback lo address 2001:db8::1/64
set interfaces loopback <interface> description <description>

Set a human readable, descriptive alias for this connection. Alias is used by e.g. the show interfaces command or SNMP based monitoring tools.

Example:

set interfaces loopback lo description 'This is an awesome interface running on VyOS'

Operation

show interfaces loopback

Show brief interface information.

vyos@vyos:~$ show interfaces loopback
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface        IP Address                        S/L  Description
---------        ----------                        ---  -----------
lo               127.0.0.1/8                       u/u
                 ::1/128
show interfaces loopback lo

Show detailed information on the given loopback interface lo.

vyos@vyos:~$ show interfaces loopback lo
lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever

    RX:  bytes    packets     errors    dropped    overrun      mcast
           300          6          0          0          0          0
    TX:  bytes    packets     errors    dropped    carrier collisions
           300          6          0          0          0          0