iptables inside container doesn't work - NET_ADMIN also didn't help

0

Hi Folks,
I have a container with fail2ban on it. On my development computer when I add this to docker-compose:
Code:

    cap_add:
     - NET_ADMIN
     - NET_RAW

I can see rules are added to iptables both inside container and outside it and it works properly. When I try the same configuration on EC2 instance, i can see those rules inside container, but not on the host system. What's wrong?
Thanks in advance.

aario
已提问 5 年前647 查看次数
1 回答
0

Decided to give up with the idea and as the alternative, mount log files of the container into equivalent place on the host system. So a standard fail2ban installation would read those log files and set the host system IP tables accordingly. This worked well.

aario
已回答 5 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则