Click to See Complete Forum and Search --> : forwarding ports


Linux
11-28-2000, 09:35 PM
How can i forward ports??? I am using RH 7 and port i want to forward is 5820 which is on internal machine that gets internet from RH 7. How do i configure Linux to forward ports so when I access port 5820 from internet it will go to internal ip 10.x.x.x port 5820. Port forwarding should be enabled in RH 7 kernel. That is what i heard.

ThanX

A_Lawn_GNOME
11-29-2000, 02:09 AM
I never learned ipchains in detail but there is a howto at www.linuxdoc.org (http://www.linuxdoc.org) and www.linux.com (http://www.linux.com) (????) had an ipchains intro that should give you the basic idea.

X_console
11-29-2000, 04:17 AM
Read up on ipmasqadm:

ipmasqadm portfw -h

Linux
11-29-2000, 10:22 AM
I have done these commands:
ipmasqadm portf -f
ipmasqadm portf -a -P tcp -l 24.x.x.x 5200 -R 10.x.x.x 5200

Only thing I am not sure of is when I loaded the module:
depmod ip_masq_portfw.o
this command gave me some output like vendor device etc. How can I check if it was loaded with this command?

When i loaded ftp module it did not give me any output.

ThanX

X_console
11-29-2000, 01:20 PM
Some modules will give you output when you load it. For instance, loading your NIC module. The only way I can think of to find out how it was loaded would be to look at the bootup scripts.

DrDrake
11-29-2000, 01:21 PM
Try doing a modprobe ip_masq_portfw
(no .o)

And see how it goes

Linux
11-29-2000, 02:37 PM
modprobe ip_masq_portfw works and I found I way to check if it is loaded and it is. Right now I ports are forwarded to my internal win machine, but it looks like I can not access those services. It tries to connect, it knows that port is open but it tells me service unavailable or can not connect. I shell investigate more and most likely ask for help again. One service that I provide from internal win machine is mp3 streaming usin Winamp and shoutcast ( both software from same company Nullsoft).

I shell never quit until it works 110%.

c_guy
11-30-2000, 01:48 PM
One interesting thing to note about port forwarding is that, you can not from ANY machine on your network, access that server that is running on the internal network. You'll have to go to a friend's house or connect to another isp and test it from there. I have an ftp server that I run on an internal win machine. And it took me a long time to figure out what was wrong, before I realized nothing was, I just could not access it from my network, but from work I can just fine and it works mint. Of course this is well documented in the man for port forward, but who really reads the documentation anyways?.. http://www.linuxnewbie.org/ubb/smile.gif

Good luck and have fun

{c}guy

Linux
12-01-2000, 12:57 AM
True, true. Only test you can do is to specify ip and port of machine that is providing service. At least you will know if service is configured properly. You still won't know if Linux is forwarding that port. My MP3 streaming is working now. It was much easier to set up MP3 stremaing on Win machine and that is why i needed port forwarding.