From: "Taylor, Grant" <gtaylor@riverviewtech.net>
To: netfilter@lists.netfilter.org
Subject: Re: udp connection tracking
Date: Tue, 17 May 2005 11:53:41 -0500 [thread overview]
Message-ID: <428A2195.8090308@riverviewtech.net> (raw)
In-Reply-To: <005b01c55af6$1db40980$3c01a8c0@ts.communitytrust.ca>
> 1.) first the client will choose any random port over 1064 to use for the
> outgoing connection, lets use 1379 for this example.
> 2.) the client will send a udp packet from port 1379 to the listening port
> on the server which is always 5739.
> 3.) the server receives the packet, then chooses a random available port of
> its own, lets use 1184 for this example.
> 4.) the server sends a single udp packet with a src port of 1184 to the dst
> port 1379 of the client.
> 5.) after this single packet described in step 4, all the traffic between
> the client and server happen between ports 2222 and 5739.
This is an interesting problem.
> Now, my problem is when i want to connect as a client, i have no way of
> knowing what port the server will choose to send that single packet (step 4
> above). I also can't guess what port my client will use (step 1 above). All
> the other packets are fine because i can always expect a src or dst port
> with 5739. This single packet is causing all my connection attempts to
> fail.
What? Is your psyche not working? :P
> Is there anything i can try besides forwarding all udp traffic to the
> client?
Maybe....
I think that you might be able to do something with the recent match extension. Seeing as how I don't have the WSWE8 game I can't test this for you. But the idea behind it is to add the destination (IP) address of your initial packet to the server on UDP port 5379 to a recent set named WSWE8. Subsequently any inbound UDP traffic will be checked against the recent set named WSWE8 to see if the source address is that of the server that you sent to less than 60 seconds ago.
iptables -t filter -A FORWARD -i ${LAN} -o ${INet} -p udp --sport 1024:65535 --dport 5379 -m recent --set --name WSWE8 --rdest -j ACCEPT
iptables -t filter -A FORWARD -i ${INet} -o ${LAN} -p udp -m recent --rcheck --seconds 60 --name WSWE8 --rsource -j ACCEPT
Seeing as how this one packet is the one that is troubling you I think you should fairly easily be able to integrate these rules in to your existing firewall. Give these rules a try and see if they work for you. If they do work for you (A - please let me know) try replacing the "--rcheck" parameter in the 2nd rule with "--remove" as this will remove the source IP from the WSWE8 recent set thus preventing any one else from doing any funny business with you. :)
Grant. . . .
next prev parent reply other threads:[~2005-05-17 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-17 15:35 udp connection tracking Steve Melo
2005-05-17 16:53 ` Taylor, Grant [this message]
2005-05-17 19:09 ` Steve Melo
2005-05-17 19:50 ` Taylor, Grant
2005-05-18 13:49 ` Steve Melo
2005-05-18 14:17 ` Taylor, Grant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=428A2195.8090308@riverviewtech.net \
--to=gtaylor@riverviewtech.net \
--cc=netfilter@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox