# Packages required
apt-get update && apt-get install net-tools bridge-utils iputils-ping iproute2 -y Â
# Show nat rules
iptables -t nat -L -n
# Show bridge NetworkSettings
brctl show
# Show all network in dockerÂ
sudo docker network ls
# remove unused Networks
docker network prune
# Create a new custom bridge networkÂ
docker network create –driver bridge vlan20
docker network create –driver bridge vlan2000
# Â Create a container in network host /bridge/none
sudo docker run -dt –name web99 –network host busybox:latest
docker run -dt –name web10 –network vlan20 imagename
docker run -dt –name web10 –network none imagename
# Show containers in a network
docker network inspect bridge
docker network inspect host
# Get IP address for all containers
docker inspect –format='{{.Name}} {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ $(docker ps -q)
# Get IP address for a specific container
docker inspect <container id> | grep “IPAddress”