LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-05-2002, 11:58 AM   #1
MrGreg
Member
 
Registered: Apr 2001
Location: Hamilton
Distribution: RedHat 7.2, 9.0
Posts: 52

Rep: Reputation: 15
[MS Direct Play DNAT SNAT]


Greetings Group,
My little network uses a Linux gateway running iptables. I have successfully created a PREROUTING and FORWARD chain to allow MS Direct Play server to funtion on a Win box within the network. This box is able to connect to and run games through the MS Game Zone.

Here is the script which works for one box using the zone:

#!/bin/sh
# Script named "opengame" to open gaming ports for the zone.msn.com
# MS Direct Play Server
#
echo "opening wifey's game ports and exposing my precious system to an
_abnormally permiscuous state of vulnerability" _ _ _ _ _ _ _ #Keith
iptables -t nat -I PREROUTING -p tcp --dport 2300:2400 -i ppp0 -j DNAT --to
_192.168.1.20
iptables -t nat -I PREROUTING -p udp --dport 2300:2400 -i ppp0 -j DNAT --to
_192.168.1.20
iptables -t nat -I PREROUTING -p udp --dport 28800:29100 -i ppp0 -j DNAT --to
_192.168.1.20
iptables -t nat -I PREROUTING -p tcp --dport 47624 -i ppp0 -j DNAT --to
_192.168.1.20
iptables -t nat -I PREROUTING -p udp --dport 47624 -i ppp0 -j DNAT --to
_192.168.1.20
#
# Forwarding
iptables -I FORWARD -p tcp -d 192.168.1.20 --dport 2300:2400 -j ACCEPT
iptables -I FORWARD -p udp -d 192.168.1.20 --dport 2300:2400 -j ACCEPT
iptables -I FORWARD -p udp -d 192.168.1.20 --dport 28800:29100 -j ACCEPT
iptables -I FORWARD -p tcp -d 192.168.1.20 --dport 47624 -j ACCEPT
iptables -I FORWARD -p udp -d 192.168.1.20 --dport 47624 -j ACCEPT
#
sleep 2
ehco "done"

I would like to enable another Win box (192.168.1.19) that can use the zone and also engage in play with the other Win box (192.168.1.20). Any suggestions would be greatly appreciated.

farmer6re9
 
Old 06-06-2002, 03:06 PM   #2
jrmann1999
Member
 
Registered: Feb 2001
Location: Texas
Distribution: Slackware, Mandrake, LFS
Posts: 306

Rep: Reputation: 30
You have run into the eternal problem with DNAT/SNAT. It's great for single host routes, but when you want to route multiple clients across and have them be able to talk to each other you run into issues. The basic problem is that you are setting up essentially static routes which can't be overcome. Connection Tracking helps in this regard but you'd probably have to develop some module from scratch(similar to ip_conntrack_ftp) and that can become a beast.
 
Old 06-09-2002, 06:58 PM   #3
MrGreg
Member
 
Registered: Apr 2001
Location: Hamilton
Distribution: RedHat 7.2, 9.0
Posts: 52

Original Poster
Rep: Reputation: 15
jrmann1999,

I certainly appreciate the reply. Just as I suspected, a gnarly beast to tame. It also seems that since one of the Win Boxen is predominately running Linux, that when it's booted temporarily into Win, my gateway stills sees it's MAC address as the Linux Boxes NIC, and does not resolve properly with my DNS. If I knew where to look, and how to flush the old routes properly I might yet be able to tame the beast into submission.

Thanks again,

farmer6re9
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MASQUERADE vs. DNAT/SNAT Palula Linux - Networking 9 08-12-2005 10:23 AM
SNAT help cranium2004 Linux - Networking 0 05-09-2005 03:38 AM
IPTables: DNAT, SNAT and Masquerading tarballed Linux - Security 3 12-10-2004 03:45 PM
Best way to ALOT of files in a direct to other direct? packman Linux - General 2 10-21-2002 07:31 PM
IPTables - DNAT, SNAT, port forwarding FunkFlex Linux - Security 2 01-15-2002 07:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration