3 ms·
> I can't ping or bind to 127.0.0.2, for example. You can as soon as you define it as an alias. > Linux's behavior of allowing the whole /8 to be used, even
by akira2501 2y ago
> I can't ping or bind to 127.0.0.2, for example.
You can as soon as you define it as an alias.
> Linux's behavior of allowing the whole /8 to be used, even when only a single address is assigned, is a bit of an oddity here.
Per the RFC: "127.0.0.0/8 - This block is assigned for use as the Internet host loopback address. A datagram sent by a higher level protocol to an address anywhere within this block should loop back inside the host."
- greyface- 2y agoYes, exactly. If I connect a physical loopback adapter to a network interface, I can't just ping any on-net address and expect a response. I need to add it as an explicit interface address/alias first. Just because the packet loops back on the interface doesn't mean that it will then be treated as if it were addressed to the host. Linux special-cases 127/8 on the virtual loopback interface and will treat all looped-back packets as if they were addressed to the host, even when the destination isn't explicitly configured as an alias. This behavior is not required by the quote from RFC3330.