I'm trying to setup iptables rules for a docker container. I'm using nsenter to execute the iptables command inside of the container's network namespace:
# log access to port 8080
PID=$(docker inspect --format "{{.State.Pid}}" $ID)
/home/ubuntu/nsenter -n -t $PID iptables -A OUTPUT -o eth0 -p tcp -m tcp --dport 8080 -j LOG
This approach works perfectly except for LOG
rules. Those don't seem to log anywhere. Note that the same rule applied to the host system works and logs to /var/log/kern.log
.
Where can I find the output of those log rules? Is this a known issue/limitation of network namespaces?
NFLOG
instead but it still won't work