3 ms·
I just tested this and it seems to work by default on Linux but not on FreeBSD. On both the address is configured as 127.0.0.1/8, i.e the whole block. Go figure
by MawKKe 5y ago
I just tested this and it seems to work by default on Linux but not on FreeBSD. On both the address is configured as 127.0.0.1/8, i.e the whole block. Go figure.
This discussion [1] sheds some light on the matter, but does not fully explain the reasons for differing behaviour across OS's.
[1]: https://serverfault.com/questions/293874/why-cant-i-ping-an-address-on-the-loopback-device-under-freebsd https://serverfault.com/questions/293874/why-cant-i-ping-an-...
- nousermane 5y agoInteresting. Linux also does that with any other address/subnet added to "lo": # ping -c 1 10.10.10.10 1 packets transmitted, 0 received # ip addr add 10.10.10.1/24 dev lo # ping -c 1 10.10.10.10 64 bytes from 10.10.10.10: time=0.023 ms 1 packets transmitted, 1 received
- edoceo 5y agoThe 127 I get. This one seems odd though.
- toast0 5y agoIt seems to me (based on reported behavior), that Linux is special casing the loopback interface: when you add an address with a netmask to the loopback interface, it considers all of those addresses as local addresses. As opposed to a normal interface where only the specific address is a local address, but the rest of the network specified are accessible through that interface. Maybe one /8 wasn't enough addresses for you, so you added more? Doesn't seem like an unreasonable way to behave, even if it's different than BSD behavior; it certainly makes it easier to use lots of loopback addresses.