General discussion

Locked

Port Forwarding and IPChains

By jm ·
I have a Linux-Mandrake 7.1 server that I want to use as a firewall. Part of this firewall is to forward port 80 and 21 to an NT web server on my private LAN. I cannot find any good answer on how to do this. Can someone provide the syntax for loading the correct program and the proper IPChains commands to make this happen ? Here are sample ip addresses to use: Linux server public ip address = 62.130.119.3. Linux server private LAN IP = 192.168.1.1. My NT server is 192.168.1.2. All subnet masks are 255.255.255.0.

Thanks for your help !
David

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Port Forwarding and IPChains

by zbrain75 In reply to Port Forwarding and IPCha ...

It sounds like you want to use your linux box to perform network address translation. A form of this is IP masquerading which allows your computer to act on behalf of all computers behind your firewall when requesting service. But no outside computer can see through your firewall and initiate contact unless you set your firewall rules using ipchains to allow it.

The following URL tells how to set up IP masquerading for Redhat. Your system should be similar.
http://ctdp.tripod.com/os/linux/usersguide/index.html
Item 51 talks about IP masquarading and Item 52 addresses how to use ipchains.

You will want to use the firewall script program and modify it for your system. You can use the one at the above website or get it from the IP-Masquerade howto. In any event be sure to strip all carriage returns from it since they can prevent proper operation.

Collapse -

Port Forwarding and IPChains

by jm In reply to Port Forwarding and IPCha ...

The question was auto-closed by TechRepublic

Collapse -

Port Forwarding and IPChains

by Michael Koloberdin In reply to Port Forwarding and IPCha ...

Make sure your kernel is compiled with IP masquerading and port forwarding options.
Download and install the "ipmasqadm" program from http://juanjox.kernelnotes.org/ipmasqadm-0.4.2-2.i386.rpm
Now you may issue commands like the following:
ipmasqadm portfw -a -P tcp -L 62.130.119.3 80 -R 192.168.1.2 80
ipmasqadm portfw -a -P tcp -L 62.130.119.3 21 -R 192.168.1.2 21
ipmasqadm portfw -a -P tcp -L 62.130.119.3 20 -R 192.168.1.2 20
(the last one - ftp-data port, is also needed for ftp function)

Collapse -

Port Forwarding and IPChains

by jm In reply to Port Forwarding and IPCha ...

The question was auto-closed by TechRepublic

Collapse -

Port Forwarding and IPChains

by jm In reply to Port Forwarding and IPCha ...

This question was auto closed due to inactivity

Back to Linux Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums