Skip to contentSkip to conversation

connlimit troubles and questions

DISCUSSION me 2 participants 3 messages Sep 19, 2012

lore
Share & tools
lore

me

author
#0 lore raw

Hi all

Curious about this, but first:

iptables v1.4.15
linux 2.6.30.10-105.2.23 ( fc11 )

I have:
-A FORWARD -p tcp --syn --dport 4800 -m connlimit --connlimit-above 1 -j LOG -A FORWARD -p tcp --syn --dport 4800 -m connlimit --connlimit-above 1 -j REJECT --reject-with tcp-reset

I see some connections limited, but not all. I can look at the end point application to view the inbound connections.

The end point application - users first connect on tcp port 4800, of which the application then gives out an udp port number for data.

I haven't been able to find out how long those first tcp connections stay around. Are they timing out, hence the second connection, or is the udp stuff what is causing me grief?

If they are timing out, how can I keep limiting connections?

I have a range of udp ports that are given out, can I use those somehow?

Thanks!

todh

--
Todd Hackett Chief Bottle Washer
PoBox 1168
Libby, MT 59923
406.293.3843

#1 lore raw
Quoted 3 lines · me

I haven't been able to find out how long those first tcp connections stay around. Are they timing out, hence the second connection, or is the udp stuff what is causing me grief?

You can use the conntrack userspace application to view the connection tracking table. This shows the timeout of each connection, which should help you. UDP connections are stateless so will time out fairly quickly.

Quoted 1 line

If they are timing out, how can I keep limiting connections?

Try changing /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout

Quoted 1 line

I have a range of udp ports that are given out, can I use those somehow?

The multipart match should do the trick. See man iptables.

Andy

#2 lore raw
Quoted 1 line · Andrew Beverley

The multipart match should do the trick. See man iptables.

Oops. I meant multiport of course.

Andy