From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Largent Subject: Re: Port forwarding how ?? Date: Wed, 15 Jan 2003 12:41:04 -0500 Sender: linux-admin-owner@vger.kernel.org Message-ID: <3E259D30.7090604@imagelinks.com> References: <5.1.1.6.0.20030114154114.01cd7190@mustang> <5.1.1.6.0.20030114154114.01cd7190@mustang> <5.1.1.6.0.20030115070152.01ca5178@mustang> <1042650405.903.10.camel@marvin.bl.gozostudios.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1042650405.903.10.camel@marvin.bl.gozostudios.com> List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Sasa Ugrenovic Cc: linux-admin@vger.kernel.org assuming: eth0 = 192.168.0.1 eth1 = 192.168.0.13 and all tables are DENY by default iptables -A INPUT -i eth0 -p tcp -d 192.168.0.1 --dport 17015 -j ACCEPT iptables -A INPUT -i eth1 -p tcp --dport 17015 -j ACCEPT iptables -A PREROUTING -i eth0 -p tcp -m tcp --dport 27015 -j DNAT --to-destination 192.168.0.13:27015 iptables -A POSTROUTING -s 192.168.0.13 -o eth0 -p tcp -m tcp --sport 27015 -j SNAT --to-source 192.168.0.1:27015 iptables -A FORWARD -i eth0 -d 192.168.0.13 --dport 27015 -j ACCEPT iptables -A FORWARD -i eth1 --dport 27015 -j ACCEPT iptables -A FORWARD -i eth0 -m state --state INVALID,NEW -j DROP Just a quick throw together but I think should work. Sasa Ugrenovic wrote: > Hi,sorry for sending mail before this to you Scott. > > Let's forget the e-mails that I and you send before this one. > > This is what I need to have. > > 192.168.0.13 - Server located in LAN ( behind NAT and firewall ). - > rh8.0 > > 192.168.0.1 - NAT,Firewall server. - rh 7.3 > > I have Counter Strike server located on 192.168.0.13, 27015 port. > > Now,no one on the internet can see that server, they can see only NAT > server, 192.168.0.1. > > Now, i need to, when connecting on nat server 192.168.0.1:27015 UDP to > redirect connection to internal 192.168.0.13:27015 server. > > My routes are configured correctly ... > > > > -- Jeff Largent ImageLinks, Inc. Sr System Admin Melbourne, Fl 32935 (321) 253-0011 fax:(321) 253-5559