PDA

View Full Version : How To Forward port using IPcop linux


akhairiah
September 8th, 2003, Monday September 8, 2003 09:00:17 AM
rite now i am using IPcop linux so i dunno how to foward it n little bit confuse what the type of ip that should i use to forwad the port :confused:n by the way my external ip is changing every time it is shutdown n i've read the documentation n still confuse it

Stream
September 8th, 2003, Monday September 8, 2003 02:41:15 PM
Correct me if i'm wrong, but I think linux uses IPCHAINS to do firewalling/routing so you need to find a howto on that. just use your 1337 google skillz for ipchains +howto

Your IP changing every time is'nt a big consern, as it's registered with WON every time you start it, and when ppl search for a server they will see your server with correct IP. It can be a problem to bookmark your server tho, but if you're hosting it of a ADSL line it probably won't be many ppl bookmarking it.

Btw, having a router or box *permanently* connected to your line will prevent the from IP changing often, if at all.

akhairiah
September 9th, 2003, Tuesday September 9, 2003 03:27:49 AM
ok now i foward the port but is this correct the host computer ip is 192.168.100.2 then i type it in the box to forward it n then the TCP n UDP is :-

TCP/UDP 7002

UDP 27010

UDP 27015

UDP 27011


i wonder is this correct somebody plz help me...:confused:

Falcor
September 9th, 2003, Tuesday September 9, 2003 10:48:02 AM
stream: ipchains is outdated and doesnt even come with never versions of redhat, not sure about other distros. it has been replaced with a better tool called iptables

akhairiah: heres the iptables command to forward udp port 27015 to 192.168.0.2 (the way i do it w/ my linux router)

iptables -t nat -A PREROUTING -p udp --dport 27015 -i eth1 -j DNAT --to 192.168.0.2

any packet coming in through the eth1 interface on udp port 27015 will have its destination (hence DNAT) changed to 192.168.0.2... obviously you will need to change the incoming interface and the ip address to fit your setup.

this command can be added to /etc/rc.local file from what i've been told, but i install it as a run level 3 service
intructions here: http://www.justlinux.com/nhf/Booting_Your_OS/SysVinit.html

Stream
September 9th, 2003, Tuesday September 9, 2003 02:29:27 PM
Falcor: Just remembered the good'ol chains from my days with slackware 7 or something. Migrated to FreeBSD two years ago :)

If someone wants the IPFILTER version (for freebsd, not linux) here it is:

rdr fxp0 0.0.0.0/0 port 27015 -> 192.168.0.3 port 27015 udp

(put that in /etc/ipnat.rules)
you will also need to let that port trough in your firewall in ipf.rules, like allowing any to any if you want it quick'n'dirty.

See? Alot easier than iptables :) j/k

akhairiah
September 12th, 2003, Friday September 12, 2003 06:13:31 AM
But still i dont see my server at gametiger emm btw if anyone got a screenshot on howto forward the port for linux ipcop plzz post at the this forum thanxx to the sender very2 much

Falcor
September 12th, 2003, Friday September 12, 2003 07:56:44 AM
forget about irccop, just type the commands that i gave you into the rc.local file or make a service

edit: also, get someone else to check your server, when i forward shit though my linux box, i have to use the internal ip if i'm on the lan... it can oly be seen via the external ip if they are outside

akhairiah
September 15th, 2003, Monday September 15, 2003 04:16:40 AM
nvm, i already change the router to D-link router its ok btw with D-link it works thanx.........:D