ip_conntrack_max vs ip_conntrack
I'd like to know what some of these proc paremeters mean as well. What we're experiencing is a SYN flood attack that's filling up the connection tables. What I'd like to do is change the timeout to 5 seconds, instead of the default 30 seconds.
Signature · 4 lines
Jiann-Ming Su
"I have to decide between two equally frightening options.
If I wanted to do that,
I'd vote." --DuckmanQuoted 4 lines · Jiann-Ming Su
I'd like to know what some of these proc paremeters mean as well. What we're experiencing is a SYN flood attack that's filling up the connection tables. What I'd like to do is change the timeout to 5 seconds, instead of the default 30 seconds.
in the case of a SYN flood attack--you'd probably be better off utilizing the limit match, rather than mucking with global timeout values.
in any case--the timeout value you would probably be interested in changing in the case of a SYN flood attack would be:
sysctl -w net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_recv=X
where your proposed X=5.
the default i have here for that value is 60 seconds.
-j
Signature · 1 line
Jason Opperisano <[email protected]>
Quoted 4 lines · Jiann-Ming Su
I'd like to know what some of these proc paremeters mean as well. What we're experiencing is a SYN flood attack that's filling up the connection tables. What I'd like to do is change the timeout to 5 seconds, instead of the default 30 seconds.
The ip_conntrack_max parameter is used to set the maximum entries in the conntrack table that the system can have at a time. The ip_conntrack is the file that contains the conntrack table, it lists the IPs and their states.
If you want to limit the SYN flooding you should use the limit match of iptables, or you can use the TCP SYN cookie feature of netfilter. It can be activated in /proc/sys/net/ipv4/tcp_syncookies
For the limit match look at:
iptables -m limit --help
Signature · 12 lines
Jose Maria Lopez Hernandez Director Tecnico de bgSEC [email protected] bgSEC Seguridad y Consultoria de Sistemas Informaticos http://www.bgsec.com ESPAÑA The only people for me are the mad ones -- the ones who are mad to live, mad to talk, mad to be saved, desirous of everything at the same time, the ones who never yawn or say a commonplace thing, but burn, burn, burn like fabulous yellow Roman candles. -- Jack Kerouac, "On the Road"
Quoted 5 lines · Jose Maria Lopez
For the limit match look at:
iptables -m limit --help
There's some good info on what I was looking for at the end of this section:
http://www.iptables.org/documentation/HOWTO//packet-filtering-HOWTO-7.html#ss7.3
Does the limit option work on a per connection basis? Or, does one attacker's syn flood cause everybody to be limited as well?
Signature · 4 lines
Jiann-Ming Su
"I have to decide between two equally frightening options.
If I wanted to do that,
I'd vote." --DuckmanQuoted 7 lines · Jiann-Ming Su
There's some good info on what I was looking for at the end of this section:
http://www.iptables.org/documentation/HOWTO//packet-filtering-HOWTO-7.html#ss7.3
Does the limit option work on a per connection basis? Or, does one attacker's syn flood cause everybody to be limited as well?
the limit match works per-rule. however you define what matches the rule is what will be limited.
-j
Signature · 1 line
Jason Opperisano <[email protected]>
Quoted 5 lines · Jiann-Ming Su
There's some good info on what I was looking for at the end of this section:
http://www.iptables.org/documentation/HOWTO//packet-filtering-HOWTO-7.html#ss7.3
In case someone, like myself, should look through the archives, another good place for info is
http://iptables-tutorial.frozentux.net/iptables-tutorial.html. I'm also including a snapshot of the rules we use to firewall off the dorms at an academic institution. Someone else out there may find this helpful. All IP's have been changed to protect the guilty.
Signature · 4 lines
Jiann-Ming Su
"I have to decide between two equally frightening options.
If I wanted to do that,
I'd vote." --Duckman