I can change netmask of loopback inteface (usually lo interface has 127.0.0.1/8):

pi@raspberrypi:~ $ ifconfig
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)

pi@raspberrypi:~ $ sudo ifconfig lo 127.0.0.1 netmask 255.255.255.0 up

pi@raspberrypi:~ $ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.255.255.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Local Loopback)

What negative effects can this have? What pitfalls it hides?


Then loopback only responds to 127.0.0.1/24. Do not do it, there is no purpose to this non-standard configuration.

Just one thing that might be broken: Debian systems that ensure their own hostname can be resolved via in /etc/hosts, possibly to 127.0.1.1.


Remember that on Linux ifconfig has been obsolete for many years.

The equivalent iproute is:

ip addr add 127.0.0.1/24 dev lo
ip addr del 127.0.0.1/8 dev lo