Example docker networks that blocks traffic. Use as the network when starting the container with --net
or docker network connect
.
docker network create -o "com.docker.network.bridge.enable_ip_masquerade"="false" lan-restricted
10.0.1.10:22
)docker network create -o "com.docker.network.bridge.enable_icc"="false" icc-restricted
icc-restricted
network.iptables -I INPUT -i docker0 -m addrtype --dst-type LOCAL -j DROP
docker0
docker network create --subnet=192.168.0.0/24 --gateway=192.168.0.1 --ip-range=192.168.0.0/25 local-host-restricted
iptables -I INPUT -s 192.168.0.0/24 -m addrtype --dst-type LOCAL -j DROP
Creates a network called local-host-restricted
which which:
Custom networks have bridge names like br-15bbe9bb5bf5
, so we uses it's subnet instead.