0

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?

mastupristi
  • 101
  • 1

2 Answers2

2

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
John Mahowald
  • 30,009
  • 1
  • 17
  • 32
0

well, looks like it will be the future 127/16

according to this doc https://www.ietf.org/id/draft-schoen-intarea-unicast-127-00.html

Peca
  • 11
  • 2
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://serverfault.com/help/whats-reputation) you will be able to [comment on any post](https://serverfault.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/503076) – guntbert Nov 20 '21 at 22:43