Answers for "iptables allow traffic to docker network"

0

iptables allow traffic to docker network

Container communicates with host using docker0 interface. To allow traffic from container add:

iptables -t nat -nL

iptables -A INPUT -i docker0 -j ACCEPT
iptables -A FORWARD -o docker0 -j DOCKER
iptables -A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i docker0 ! -o docker0 -j ACCEPT
iptables -A FORWARD -i docker0 -o docker0 -j ACCEPT

iptables -t nat -nL

sysctl --write net.ipv4.ip_forward=1
cat /proc/sys/net/ipv4/ip_forward # -> 1

iptables -A INPUT -j LOG
Posted by: Guest on August-23-2021

Code answers related to "iptables allow traffic to docker network"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language