summaryrefslogtreecommitdiff
path: root/docs/configuration/interfaces/loopback.rst
blob: 77b6e47577ec87dbe72b40e643f8f9c76acc2e0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
:lastproofread: 2026-01-23

.. _loopback-interface:

########
Loopback
########

The loopback interface is a virtual, software-based network interface. All 
traffic sent to it loops back and only targets services on the local host.

.. note:: Only one loopback ``lo`` interface is allowed per operating system. 
   If you require multiple virtual interfaces, use the :ref:`dummy-interface`
   interface type.

.. hint:: The loopback interface is always operational, making it suitable for 
   management traffic or as a stable source/destination for routing protocols such 
   as BGP. This ensures internal routing sessions remain independent of physical 
   link states. 

   However, in most cases, the dummy interface is preferred over the loopback 
   interface.

*************
Configuration
*************

Common interface configuration
==============================

.. cmdinclude:: /_include/interface-address.txt
   :var0: loopback
   :var1: lo

.. cmdinclude:: /_include/interface-description.txt
   :var0: loopback
   :var1: lo

*********
Operation
*********

.. opcmd:: show interfaces loopback

   Show brief interface information.

   .. code-block:: none

     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

.. opcmd:: show interfaces loopback lo

   Show detailed interface information.

   .. code-block:: none

     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