LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-14-2004, 09:43 PM   #1
supertrout
LQ Newbie
 
Registered: Sep 2003
Location: The milky way galaxy
Distribution: Debian
Posts: 11

Rep: Reputation: 0
Forwarding ONE port to remote machine


What I am trying to do is forward port 1944 requests that come to my machine to another machine, that isnt in my network (I would assume it works about the same for both tho, if at all) And here is why. I am trying to use my server for a webhosting end of a deal, while the other person hosts the other end on port 1944.. which if helps..is a MUSH server.

iptables -t nat -A PREROUTING -p tcp --dport 1944 -i eth0 -j DNAT --to <destination>:1944

Happened to be something that I found somewhere.. but saddly it didnt work for some reason, at least from inside my network.

So, any other ideas?..hehe thanks
 
Old 12-14-2004, 09:52 PM   #2
bdogg
Member
 
Registered: Sep 2004
Location: Salt Lake City, UT
Distribution: Debian Sarge
Posts: 93

Rep: Reputation: 15
If your default policy for IPTABLES -P FORWARD is DROP then you are going to need to add a rule that will accept them

before you run that IPTABLES line to forward that port in your nat table, you want to run this line

iptables -A FORWARD -p tcp -i eth0 --dport 1944 -j ACCEPT

That will first tell your iptables to accept forwarding requests for packets that come in on port 1944. If your default policy is drop, they are being dropped before your nat table has a chance to get them.
 
Old 12-14-2004, 10:02 PM   #3
supertrout
LQ Newbie
 
Registered: Sep 2003
Location: The milky way galaxy
Distribution: Debian
Posts: 11

Original Poster
Rep: Reputation: 0
That doesnt appear to work..hmm

On another note... it now works... I screwed up some stuff and had to wipe clean stuff.. and redo other things.. but it now works.. and thanks you helped ALOT and saved me hours of "how can I do that!" work

Last edited by supertrout; 12-14-2004 at 10:10 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote Port Forwarding Question juxstapose Linux - Networking 1 08-01-2004 12:32 PM
Port forwarding to RH 9.0 machine not working Jeeves79 Linux - Networking 3 05-29-2004 03:11 PM
Port forwarding to internal machine zamzara Linux - Networking 8 12-01-2002 12:21 AM
port forwarding to win 2k machine. Morphey Linux - Security 2 04-13-2002 01:07 AM
port forwarding to win 2k machine. Morphey Linux - Networking 0 03-30-2002 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration