See what process is using a specific port

For Mac (if no netstat):

PORT=8080
sudo lsof -n -i4TCP:$PORT | grep LISTEN
sudo lsof -n -iTCP:$PORT | grep LISTEN
sudo lsof -n -i:$PORT | grep LISTEN

For Linux (if no lsof):

netstat -tulpn | grep $PORT

Docker network info, linked containers

To see network info for Docker host, use the network (v1.9+) command:

docker network [OPTIONS] COMMAND [OPTIONS]

To link containers by name, you now need to use the –link command:

The docker network inspect command above shows all the connected containers and their network resources on a given network. Containers in this default network are able to communicate with each other using IP addresses. Docker does not support automatic service discovery on the default bridge network. If you want to communicate with container names in this default bridge network, you must connect the containers via the legacy docker run --link option.

If you upgraded your Docker host from pre 1.9 and your containers were not longer able to communicate, this is probably why.

$ docker run --rm -ti busybox ping my-container
ping: bad address 'my-container'
$ docker run --rm -ti --link=my-container busybox ping my-container
PING my-container (172.17.0.2): 56 data bytes
...

See https://docs.docker.com/engine/userguide/networking/dockernetworks/

And note:

While links are still supported in this limited capacity, you should avoid them in preference of Docker networks. The link feature is expected to be deprecated and removed in a future release.

So also see: https://docs.docker.com/engine/userguide/networking/default_network/build-bridges/ etc.

Iptables see specific table rules

See specific table rules for iptables — otherwise filter table is used. Add -v for more info.

iptables --table nat --list