i have been trying to find out how to properly enable firewall for docker and encountered an interesting beheviour of unbound container:
- installing mailcow - health check passes. i am able to dig through @127.0.0.1 in the container
- enforcing iptables rules:
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -m multiport --dport 22,443 -j ACCEPT
iptables -P INPUT DROP
iptables -I DOCKER-USER -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I DOCKER-USER 2 -i eth0 -p tcp -m multiport --dport 25,110,143,465,587,993,995,4190 -j ACCEPT
iptables -I DOCKER-USER 3 -i eth0 -j DROP - unbound does not pass health check, unable to dig
- rolling back iptable rules:
iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -F DOCKER-USER
iptables -A DOCKER-USER -j RETURN - unbound does not pass health check, unable to dig
can someone explain why this happens?