From: Joel Newkirk <netfilter@newkirk.us>
To: eugenio <eugenius@freemail.hu>, netfilter@lists.netfilter.org
Subject: Re: pls help a beginner linux admin - problem with packetfilter setup
Date: Mon, 16 Dec 2002 16:13:53 -0500 [thread overview]
Message-ID: <200212161613.53061.netfilter@newkirk.us> (raw)
In-Reply-To: <NHEFIMOGNFCHOOHNLFFEMEHOCFAA.eugenius@freemail.hu>
On Saturday 07 December 2002 09:38 am, eugenio wrote:
> I need to set packetfiltering on a debian linux firewall to enable a
> network game.
> Necessary firewall settings are descibed here:
> http://support.microsoft.com/default.aspx?scid=KB;en-us;q240429
>
> The system has client computers with 192.168.1.1x fix local IP
> addresses (no DHCP), and a gateway with both internal (192.168.1.1)
> and external (both fixed) IP adresses, w/ two network card of course
> (eth0 - external, eth1 - internal).
>
> Can anyone give me a hint what settings are necessary?
I assume that the network is functional as it stands, and that the client
machines are SNATted to allow internet access already.
If your client computers are only functioning as clients in the game,
this should work:
iptables -A FORWARD -i eth1 -p tcp \
-m multiport --dport 6073,47624 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED \
-j ACCEPT
If you are allowing it only for specific machines, since you have static
local IPs, you can tighten this up as follows:
iptables -A FORWARD -s a.b.c.d -p tcp \
-m multiport --dport 6073,47624 -j ACCEPT
iptables -A FORWARD -s a.b.c.d -m state \
--state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -d a.b.c.d -m state \
--state ESTABLISHED,RELATED -j ACCEPT
This will allow the clients to communicate to the gameserver/host
initially, then allow established and related connections each way.
Just use this trio of rules for each IP that you want to allow. Note
that this will allow est/rel for ALL allowed connections, (but only from
the specified machines in the second version) so if this is undesireable
then you will need to specify each port range explicitly, like:
iptables -A FORWARD -i eth1 -p tcp -m multiport
--dport 6073,47624 -j ACCEPT
iptables -A FORWARD -p tcp --dport 2300:2400 -j ACCEPT
iptables -A FORWARD -p udp --dport 2300:2400 -j ACCEPT
You can tighten up any of these rules by specifying IP's of allowed local
machines, and in some cases you can specify IP's of remote machines,
since some of these games only ever connect to one or a small number of
IP's that handle all gaming communications. However, the state rules
will need to be duplicated for input AND output traffic in this case,
since both are required for the port 2300-2400 (or EST/REL) connections.
Note also that while EST/REL may seem insecure, it is in fact quite a bit
more secure than simply opening up 204 ports permanently. If at all
possible, the second approach, or the initial connections as specified
there with the single EST/REL from the first, is the best answer. If
you get things running this way first, you can log some game traffic and
see if there is a consistent remote IP used, and rewrite rules with that
if desired, which will be about as tight as you can get it, without
manually enabling/disabling all of this on demand when gaming is
desired.
Also, depending upon how the particular game communicates, you may find
it necessary to explicitly open the ports as in the third example, since
some games allow or even rely on communication directly between client
machines, and this would represent a new connection, not related
(state-wise) to the gameserver connection.
Finally if a local machine will function as a host (if even possible,
depends on the game) then you need to allow the reverse of the initial
connection as well, but will also need DNAT to allow internet clients to
connect, and only one server will probably be possible.
j
prev parent reply other threads:[~2002-12-16 21:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-07 14:38 pls help a beginner linux admin - problem with packetfilter setup eugenio
2002-12-16 21:13 ` Joel Newkirk [this message]
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=200212161613.53061.netfilter@newkirk.us \
--to=netfilter@newkirk.us \
--cc=eugenius@freemail.hu \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.