-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"iptables: No chain/target/match by that name" #36
Comments
Sorry about that, thanks for the info 👍 |
@crazy-max can you please help me here? I am not sure whether this is the right place to post this but I am trying to resolve the issue for fail2ban docker container still allowing banned IP's. I tried setting Chain to DOCKER-USER but it's failing with the following error: 2021-10-25 21:52:14,022 fail2ban.utils [1]: ERROR b64f6650 -- exec: iptables -w -N f2b-npm-docker Chain INPUT (policy ACCEPT 0 packets, 0 bytes) Chain FORWARD (policy DROP 0 packets, 0 bytes) Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) Chain DOCKER (3 references) Chain DOCKER-ISOLATION-STAGE-1 (1 references) Chain DOCKER-USER (1 references) Chain DOCKER-ISOLATION-STAGE-2 (3 references) Warning: iptables-legacy tables present, use iptables-legacy to see themI am running my fail2ban, nginx proxy manager inside docker. This is my fail2ban configuration : version: "3.7" [npm-docker] |
I'm having similar issues, is there any update? |
@valvanet , I am able to resolve this, You need to check the IPtables chain in order to set the chain, check if your docker containers are associated with DOCKER-USER chain or FORWARD chain or INPUT chain, based on that you need to provide the chain. |
I did the following things to finally able to get fail2ban work for me : NginxProxyManager/nginx-proxy-manager#39 (comment) |
Behaviour
Fail2ban tries to ban an IP but the banning does not take affect on the host machine and a "Script error" is seen in the container log; "iptables: No chain/target/match by that name".
Steps to reproduce this issue
I deploy the container using the exact command listed in the readme:
sudo docker run -d --name fail2ban --restart always \ --network host \ --cap-add NET_ADMIN \ --cap-add NET_RAW \ -v $(pwd)/data:/data \ -v /var/log:/var/log:ro \ crazymax/fail2ban:latest
I then set up a
jail.local
file indata/jail.d/
, and restart the fail2ban container.This is the jail:
I then attempt to SSH into the host machine and use the wrong psasword 5+ times, causing fail2ban to ban my address.
If I connect to the container and run the command
fail2ban-client status sshd
it shows this output:Expected behaviour
When I try to SSH into my host machine with the correct password, I should get immediately rejected.
Actual behaviour
I SSH into the machine as normal and nothing stops my connection.
Configuration
Running on Debian 10
Docker info
Logs
(further down in the log, after the above message)
Note
I am running the default version of Docker with no edited settings.
Here is my
sudo iptables -L
output: https://pastebin.com/uw7mVyPr.The text was updated successfully, but these errors were encountered: