Hi all,

I have a Ubuntu VM running an app in docker compose - the app is crAPI, something I am using for hacking APIs book.

I can access the crAPI app from the Ubuntu VM using 127.0.0.1:8888

However, I want to access the crAPI from another VM, for example a Kali VM on the same local network but I cant because the crAPI is using some 172 ip address. This seems to be some internal ip address accessible only from the Ubuntu VM, surely there is a way to make crAPI accessible on the network?

I am well prepared and ready for some wacky commands to make this simple idea work.

Any ideas please?

Many thanks

5 Spice ups

This 127.0.0.1 is a loopback address, not related to Ubuntu. It’s available on all OSes. You should really know what this is so it makes sense.

Changing it’s listening IP is done as documented here

I know what a loopback address is, 127.0.0.1 is relative to each OS, for example, the underlying host running VirtualBox has a 127.0.0.1 address as does the Ubuntu VM, the host and VM do not share the same loopback address.

I have now sorted this.

I found the IP address of the Ubuntu VM then added it to docker-compose.yml under the crapi-web section.

Basically change the loopback address to the address of the VM running the docker container…

crapi-web:
container_name: crapi-web
image: crapi/crapi-web:${VERSION:-latest}
ports:

  • “192.168.0.10:8888:80”

I can now access crAPI from any device on the network and not just from the Ubuntu VM.

1 Spice up