-3

I have 2 computer(A n B) which connected same wifi. If i want to access my localhost(127.0.0.1) from computer A to B i just enter LAN IP(example http://192.168.99.5) on computer B. But how to access 127.0.0.2 or 127.0.0.3 etc to other computer?

  • 2
    `But how to access 127.0.0.2 or 127.0.0.3 etc to other computer?` - You can't. - https://tools.ietf.org/html/rfc3330 – joeqwerty Jul 07 '17 at 03:14
  • I can't follow what you're asking, but you can have OpenSSH tunneling/forwarding packets so you can access https://127.0.0.2:80 and have it actually connect to 192.168.99.6:80. http://blog.trackets.com/2014/05/17/ssh-tunnel-local-and-remote-port-forwarding-explained-with-examples.html etc. – TessellatingHeckler Jul 07 '17 at 07:30

2 Answers2

4

Any packets with an address in the 127.0.0.0/8 range can never appear on any network anywhere. Traffic sent to an address in that range will immediately loop back inside the host.

Start with RFC 1700, Assigned Numbers:

(g) {127, }

Internal host loopback address. Should never appear outside a host.

There are other RFCs in that vein, including the one mentioned by @joeqwerty in the comment, 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
  • 3,158
  • 1
  • 11
  • 16
  • There is a related question (_[Can my default gateway of router be 127.0.0.1?](https://networkengineering.stackexchange.com/q/40153/8499)_) on [networkengineering.se]. – Ron Maupin Jul 11 '17 at 01:19
1

If you need to connect to a local loopback 127.0.0.0/8 network on another computer, the connection must originate from the same machine. You may need to do so for example if a service is only bind to 127.0.0.1; therefore, it cannot be connected using LAN/public IP. This can be achieved several ways, but using an SSH tunnel is the easiest to set up.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122