akerl wrote:
I rate limit connections to SSH with the following ruleset:
Code:
# cat /etc/iptables/iptables.rules
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
COMMIT
Those firewall rules have served me well over the years.
- Les
I believe I understand most iptables implementations, but yours don't seem like it gonna work.
You accept ICMP. Good
You accept connections to the loopback interface. Good
You do conn-tracking of existing or related connections, Good
You drop everything else. -> wait a minute, what happens if your net connection/session flakes out or you terminal craps out and you try to reconnect?
I don't get how this ruleset would help anybody unless they have console access and is using the box as a personal desktop. - Please enlighten me.