Click to See Complete Forum and Search --> : Ipchains port forwarding localy


yogee
07-06-2001, 01:17 AM
When i installed redhat 7.1, i used the firewall tool it had to add some ports that i needed to open. I now have these in my ipchains file and need help with what im suposed to do now. I basicaly need to open a bunch for a game server and forward them to a local machine with an ip of 192.168.0.**
This game server is windows 2000 pro and will (once i figure it out) be on the network. I now have 2 windows ME system running thru the redhat server and on the net without using DHCP.

This is what i have in there for each port ive opened:
-A input -s 0/0 -d 0/0 ***** -p udp -j ACCEPT
Where ***** is the port number.


To run from a machine with a private IP address behind a Linux firewall, you need to use a combination of IP masquerading and IP autoforwarding. The following rules for the default ** client port range can be used:

ipfwadm -F -a accept -m -S a.a.a.a/m.m.m.m -D 0.0.0.0/0
ipautofw -A -r udp 32766 32809 -h a.a.a.a -v -u

Where a.a.a.a is the address of the machine behind the firewall, and m.m.m.m is the netmask. If you run a server behind the firewall, clients should connect to the IP address of the firewall.


Thanks for any help.

ZeBuL0N
07-06-2001, 07:46 AM
see this page, if contains the ref on how to use Linux as a internet gateway, it also contains the IP Forwarding and firewalling, this I think may help you out.
http://www.coastnet.com/~pramsey/linux/

*note its for RH 6.2, but I have 7.1 and it works just fine...

yogee
07-06-2001, 11:40 AM
Im pretty sure (will look into it) that Ipmasquerade is all installed with redhat 7.1. I have the local network running with this added to my ipchains:
-P forward DENY
-A forward -i eth1 -s 192.168.0.0/255.255.255.0 -j MASQ

This along with inputting all the gateway info into the windows ME boxes gets them online. The win2k box has not been added to the network yet.


The how-to-doc.
Once you have the RPM, install it, and then add the following lines to your /etc/rc.d/rc.local file:

/usr/sbin/ipmasqadm portfw -f
/usr/sbin/ipmasqadm portfw -a -P tcp -L x.x.x.x 80 -R 192.168.1.x 80

Isnt this suposed to be done in the ipchains firewall?
ipfwadm -F -a accept -m -S a.a.a.a/m.m.m.m -D 0.0.0.0/0
ipautofw -A -r udp 32766 32809 -h a.a.a.a -v -u