integration/network/bridge/iptablesdoc/templates/usernet-portmap.md
Adding a network running a container with a mapped port, equivalent to:
docker network create \
-o com.docker.network.bridge.name=bridge1 \
--subnet 192.0.2.0/24 --gateway 192.0.2.1 bridge1
docker run --network bridge1 -p 8080:80 --name c1 busybox
The filter table is updated as follows:
{{index . "LFilter4"}}
{{index . "SFilter4"}}
Note that:
docker0 was
created before bridge1, the bridge1 rules appear above and below the
docker0 DROP rule.The corresponding nat table:
{{index . "LNat4"}}
{{index . "SNat4"}}
And the raw table:
{{index . "LRaw4"}}
{{index . "SRaw4"}}
filterDirectAccess adds a DROP rule to the raw-PREROUTING chain to block direct remote access to the mapped port.