-1

We know that we can ping Localhost which means it can be used as Destination Address.

Why can't Loopback Address be used as Source Address inside packet?

  • Any address in the 127.0.0.0/8 block can never appear anywhere on any network, nor can any address in that block be used as a source or destination address for packets outside the host. RFC 3330, Special-Use IPv4 Addresses: "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]." – Ron Maupin Oct 28 '20 at 2:08
2

It can be used as the source address, and in fact it is the source address when you pinged localhost!

Network traffic to/from localhost is the same as any other network traffic except that it never leaves the host. The localhost address is both source and destination address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.