virtual machine – How to access addresses 127.0.0.1-127.0.0.10 on a server running in VirtualBox

You cannot do that. The block 127.0.0.0/8 is reservedfor the local host and is not accessible outside of that host (see RFC3330, RFC5735, RFC6890).

If you really need to access a service on, say, 127.0.0.10 then the only way to access this from outside a host is to create a packet forwarder on that machine that listens on its public IP address (192.168.1.2 in your example) and forwards the packets to 128.0.0.10. Tools like socat can do this for you.

For example (only lightly tested):

sudo socat UDP4-RECVFROM:161,fork,reuseaddr UDP4-SENDTO:localhost:161,reuseaddr

However, what would be far better is to modify the configuration for the service that’s listening only on a local port and have it listen on its public IP address.

Read more here: Source link