Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-07-2006, 09:39 AM   #1
Registered: May 2006
Location: Romania
Distribution: CentOS
Posts: 140

Rep: Reputation: 15
port forwarding

Hello again,
I now have the following problem. First my configuration is: Ubuntu RC 6.06 server with:
eth0 the 'internet' connection
eth1 the lan with the ip
On my Windows computer i have the ip, the linux is setup to be a 'router' with
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
Due to the fact that i'm away most of the time i need to be able to connect to both my computers, on the linux machine i use ssh, and for the windown i what to use a popular program Remote Administrator (radmin) that uses port 4899 (this can be changed). So what i want to do is to be able to access on port 4899 the windows PC trough my linux. I tried port forwarding with some commands found on this forum:
iptables -t nat -A PREROUTING -p tcp -d --dport 4899 -j DNAT --to
that did now worked so i tried
iptables -t nat -A PREROUTING -p tcp -d --dport 4899 -j DNAT --to
So what am i doing wrong?
Old 06-08-2006, 04:19 AM   #2
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
You may need to specify the device "-i eth1".

Oh, just found the article I was hunting for, check this out for more info on port fowarding in linux:


Last edited by MasterC; 06-08-2006 at 04:21 AM.
Old 06-08-2006, 11:21 AM   #3
Registered: May 2006
Location: Romania
Distribution: CentOS
Posts: 140

Original Poster
Rep: Reputation: 15
Ok so this did the trick:
iptables -t nat -A PREROUTING -p tcp -i eth0 -d --dport 4899 -j DNAT --to

Last edited by Braynid; 06-08-2006 at 12:14 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 08:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 01:08 PM
Port 80 forwarding to port 22 with iptables zahoo Linux - Networking 3 02-22-2005 08:22 AM
port forwarding biscristi Linux - Software 1 03-10-2004 04:01 PM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 11:37 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:36 AM.

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