Hacker News new | ask | show | jobs
by nine_k 7 days ago
Isn't 127/8 always present in IPv4, without I'll consequences?
1 comments

I meant it's one address per interface, and loopback has always been its own interface.
One address per host is more common in serious networks that don't have endless IP addresses (10/8 block) allocated to them.
There is no problem with allocating one 127.0.0.0/8 to every interface on your host, because 127.0.0.0/8 is only ever accessible to the host itself. So even if you have multi-homed a single routable IPv4 address to 2 NICs on your server (for redundancy), you can still assign 127.0.0.1 to the first and 127.0.0.2 for the second, which you can then use to bind a port to a specific interface in the pair. (I don’t know if anyone actually does this.)
How would the receiving host know which 127 address you imagined belongs to it?
What do you mean “receiving host?” 127/8 is reserved for loopback. If you bind a socket to an interface with an address in that range, you can only use it to communicate with yourself. The sending and receiving hosts are the same.
I mean the host that receives the packet. Weren't you suggesting to use 127/8 as an alternative to link-local addresses?