Koozali.org: home of the SME Server

Port Forwarding

Pritpal Singh

Port Forwarding
« on: January 16, 2003, 01:20:45 PM »
I am using E-Smith Server 5.5 in Server and Gateway mode, I have installed Port Forwarding rpm too. I have a question, can I use this module to multiple port forwarding at a time e.g 1720-1750. If yes, how can I do it.

Thanks in advance

Pritpal Singh

Terry Brummell

Re: Port Forwarding
« Reply #1 on: January 16, 2003, 01:37:10 PM »
As far as I know you cannot, you have to forward each port 1 at a time.  It's a pain but it gets the job done.

Terry

TwiLight

Re: Port Forwarding
« Reply #2 on: January 16, 2003, 03:15:24 PM »
THERE IS AN EASIER WAY :P

take excel...

and fill up 1 cel with :

ipmasqadm portfw -a -P tcp -L XXX.XXX.XXX.XXX XXXX -R YYY.YYY.YYY.YYY YYYY -p 10

2nd cel

ipmasqadm portfw -a -P tcp -L XXX.XXX.XXX.XXX XX+1 -R YYY.YYY.YYY.YYY YY+1 -p 10

now make them till the disired point

ipmasqadm portfw -a -P tcp -L 123.435.346.123 80 -R 10.0.0.0 80 -p 10
ipmasqadm portfw -a -P tcp -L 123.435.346.123 81 -R 10.0.0.0 81 -p 10
ipmasqadm portfw -a -P tcp -L 123.435.346.123 82 -R 10.0.0.0 82 -p 10
..

take notepad and copy + paste all cells into it.
save the file as makeports upload it to the server
move it with ssh to a disired location
chmod +x (filename)
./(filename)

and voila... 1 good mpdule till reboot..
if u want it to go trough the list every boot :

add the line :

./root/makeports
to /etc/rc.d/rc.local

reboot the pc or run the script.. look if everything went ALLRIGHT and voila ;) i could make u it easier ;) (except for making the file for u by meself and upload it etc etc etc :P;))
i do advise u to save it somewhere no one else can look... coz info about the internal netword is very handy for crackerz...(not hackerz) it safes them time ;)

TwiLight

just wanted a reaction on my mail ;)
« Reply #3 on: January 16, 2003, 03:16:26 PM »
i filled the checkbox this time ;)

Pritpal Singh

Re: just wanted a reaction on my mail ;)
« Reply #4 on: January 17, 2003, 09:29:18 AM »
Thanks a lot Twilight it worked for me..

Pritpal

Tim

Re: Port Forwarding
« Reply #5 on: January 17, 2003, 10:21:49 PM »
I had SME 5.5 running with a port forwarding web interface installed.  Worked great.

I upgraded to SME 5.6.... now my port forwarding doesn't seem to work.   I would like to keep 5.6, but I need the ability to do port forwarding.  I'm not a linux guru, so the package that allowed me to create TCP/UDP ports via the web admin interface was perfect.

Any suggestions as to why this won't work with 5.6, or suggestions on how to port forwarding for a non linux guru?

Thanks.

Tim

Tim

Re: Port Forwarding
« Reply #6 on: January 17, 2003, 10:35:25 PM »
just checked the email reply box.  I forgot to do that in the reply above.

TwiLight

Re: Port Forwarding
« Reply #7 on: January 18, 2003, 01:21:14 AM »
whaha yes :P

again the following above (excel)

this time use this command

/sbin/iptables -t nat -A PREROUTING -p tcp -i eth0 -d xxx.xxx.xxx.xxx
   --dport 8888 -j DNAT --to 192.168.0.2:80

/sbin/iptables -A FORWARD -p tcp -i eth0 -d 192.168.0.2
      --dport 80 -j ACCEPT

Pritpal Singh

Re: Port Forwarding
« Reply #8 on: January 18, 2003, 08:27:15 AM »
Hey Twilight,

I have one prob. to solve out.. I am trying to install openh323 gatekeeper
on the server, I have installed the C libraries from Myezeserver.com,  I get
the following error when I use the make command..

[root@sme root]# cd pwlib
[root@sme pwlib]# make both
set -e; make -C src/ptlib/unix opt; make -C tools/asnparser opt;
make[1]: Entering directory /root/pwlib/src/ptlib/unix'
g++ -Wall -DP_LINUX -D_REENTRANT -DP_HAS_SEMAPHORES -fPIC -DP_USE_PRAGMA -DP
_SSL -I/usr/include/include -I/usr/include/crypto -DP_PTHREADS -DPHAS_TEMPLA
TES -DPBYTE_ORDER=PLITTLE_ENDIAN -I/root/pwlib/include/ptlib/unix -I/root/pw
lib/include -O3 -DNDEBUG -DPTRACING=1 -c ../../ptclib/asner.cxx -o
/root/pwlib/lib/obj_linux_x86_r/asner.o
In file included from /usr/include/linux/videodev.h:5,
                 from /root/pwlib/include/ptlib/unix/ptlib/videoio.h:106,
                 from /root/pwlib/include/ptlib/video.h:80,
                 from /root/pwlib/include/ptlib/unix/ptlib/video.h:66,
                 from /root/pwlib/include/ptlib.h:267,
                 from ../../ptclib/asner.cxx:274:
/usr/include/linux/version.h:2:2: #else without #if
/usr/include/linux/version.h:4:2: #endif without #if
make[1]: *** [/root/pwlib/lib/obj_linux_x86_r/asner.o] Error 1
make[1]: Leaving directory /root/pwlib/src/ptlib/unix'
make: *** [opt] Error 2
[root@sme pwlib]# exit

Hope that you will be able to help me out..

thanx in advance

Pritpal

Pritpal Singh

Re: Port Forwarding
« Reply #9 on: January 18, 2003, 08:52:59 AM »
Hi Tim,

Try using the Port Opening Contrib.

Hope that it works for u..

Pritpal

Pritpal Singh

Re: Port Forwarding
« Reply #10 on: January 18, 2003, 08:53:49 AM »
Hi Tim,

Try using the Port Opening Contrib. or you can use the method mentioned above by Twilight... It works wonderfully..

Hope that it works for u too..

PritpalTim wrote:
>
> just checked the email reply box.  I forgot to do that in the
> reply above.

rob

Re: Port Forwarding
« Reply #11 on: January 24, 2003, 08:07:55 AM »
ok I have installed a brand new sme 5.6 using a "install" not upgrade

i have a notes server running on a different box on the internal network. On 5.5 i used portforwarding rpm but it appears to not work on 5.6 according to posts I have seen here

I found twiglights helpful suggestion and i need to forward ports 1352 and 80

ipmasqadm portfw -a -P tcp -L 192.168.1.1 80 -R 192.168.0.10 80 -p 10
ipmasqadm portfw -a -P tcp -L 192.168.1.1 1352 -R 192.168.0.10 1352 -p 10

2 questions twilight

a) where is ipmasqadm if i do a "find / -name ipmasqadm" I find nothing if i need to install an rpm i can do that what version would you reccomend

b) you had a second post talking about iptables which appeard to be responding to a missing post do i need to do the iptables stuff as well or is this an alternative solution (ie http://forums.contribs.org/index.php?topic=16192.msg62547#msg62547)

thanks in advance

rob

TwiLight

Re: Port Forwarding
« Reply #12 on: January 24, 2003, 12:35:02 PM »
rob... it is the same for 5.6.. Only u need to use IPTABLES...

iptables are not in 5.5 and lower.. but it is in 5.6 it is new

U can use the same thing for iptables .. just open excel for uge port ranges...
or else just use those 2 simple ports...


so read that post of mine ;)

there is no rpm that i know of.. and why should u build an rpm...

make a text file copy paste ftp chmod and execute it every boot and u have the same thing.. only better :)