A
A
Alexander Nazarov2019-09-19 18:04:45
iptables
Alexander Nazarov, 2019-09-19 18:04:45

How to block incoming ip per port?

How can I block incoming ip per port? It is to block, not to discard.
For example, I have such a rule, it writes logs with ip addresses entering the port, so they need to be banned immediately.
But I do not understand how to do it, tell me if anyone knows?

sudo iptables -t filter -A FORWARD -s 192.168.0.0/16 -m tcp -p tcp --dport 25 -j LOG --log-prefix "iptables: "

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question