Loopback interface on Linux catches all loopback traffic

Solution 1:

Windows has this behaviour too. I guess this is different interpretations of rfc 3330

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. This is ordinarily implemented using only 127.0.0.1/32 for loopback, but no addresses within this block should ever appear on any network anywhere [RFC1700, page 5].

It looks like Linux interprets this as meaning that any (even an unconfigured address) in the 127.0.0.0/8 range should be looped back and thence you get a response from ping.

Solution 2:

The behavior is documented in RFC 1700. 127.7.23.4 is also a loopback address and also assigned to the local machine. (What else would it be assigned to?)

IP-address ::= { <Network-number>, <Host-number> }
...
{127, <any>}
Internal host loopback address. Should never appear outside a host.

There is no requirement to make all addresses in this range work, but it's particularly handy when dealing with protocols that don't permit you to specify a port but only an IP address. Having multiple local IP addresses allows you to run multiple instances of those servers for local use.