A
A
Anton Artyomov2017-07-20 13:26:40
iptables
Anton Artyomov, 2017-07-20 13:26:40

How to inform the user that his IP is banned?

Good. Now Available

-A INPUT -p tcp -m multiport --dports 80,443 -m set --match-set f2b-bruteforce_joomla src -j REJECT --reject-with icmp-port-unreachable

Packets are rejected.
How can you implement this: if the user's IP is banned, then it's not stupid to do a REJECT, but give him a static html page with information that the IP is banned?
If possible, give an example, or links to similar solutions.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
krosh, 2017-07-21
@ArtyomovAnton

Try replacing REJECT with REDIRECT. After applying the rule, their processing stops and, therefore, the packet should not reach the target. In this case, the web server on 8080 must be local, and you can still close access to it to everyone except f2b-bruteforce_joomla.

iptables -t nat -A PREROUTING -i eth1 -p tcp -m multiport --dports 80,443 -m set --match-set f2b-bruteforce_joomla src -j REDIRECT --to-port 8080

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question