1

I aim to create 2 loopback interfaces and have them saved permanently in EC2 instance on AWS Linux Ubuntu based. I did the following in /ect/network/interfaces

auto lo lo:1 lo:2
iface lo inet loopback

iface lo:1 inet static
        address 127.0.0.1
        netmask 255.255.255.240
        network 127.0.0.0

iface lo:2 inet static
        address 127.0.0.2
        netmask 255.255.255.240
        network 127.0.0.0

When I restard the machine, I got nothing in ifconfig only the interfaces which are already configured when I installed the operating system.

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 172.2.1.10  netmask 255.255.255.240  broadcast 172.2.1.15
        inet6 2600:1f14:8df:c16:b320:cc3f:ad7a:e26  prefixlen 128  scopeid 0x0<global>
        inet6 fe80::843:d4ff:feb2:a872  prefixlen 64  scopeid 0x20<link>
        ether 0a:43:d4:b2:a8:72  txqueuelen 1000  (Ethernet)
        RX packets 503  bytes 61839 (61.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 545  bytes 74423 (74.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 124  bytes 9720 (9.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 124  bytes 9720 (9.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
3
  • 1
    Do a ip addr show dev lo and see if the additional IP addresses are there.
    – LawrenceC
    Jun 13 '19 at 16:46
  • @LawrenceC there is only one which is shown in the ifconfig, the others are not shown. Jun 14 '19 at 8:33
  • The interesting question here is why do you think you need two loopback interfaces? If you want to assign multiple addresses to the loopback interface, you can do that on lo (which is created by default), and what is actually what the syntax lo:1 and lo:2 means. I can't think of any situation where multiple loopback interfaces would be needed.
    – dirkt
    Jun 14 '19 at 9:58
-1

I've managed to find a solution. It turns out the Ubuntu Server 18 has some other configuration for such purposes. I decided to go with version 16, and the configuration is working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.