LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-07-2006, 08:39 AM   #1
Braynid
Member
 
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 192.168.0.1
On my Windows computer i have the ip 192.168.0.10, the linux is setup to be a 'router' with
Code:
iptables -P FORWARD ACCEPT
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:
Code:
iptables -t nat -A PREROUTING -p tcp -d 192.168.0.1 --dport 4899 -j DNAT --to 192.168.0.10:4899
that did now worked so i tried
Code:
iptables -t nat -A PREROUTING -p tcp -d 82.76.84.224 --dport 4899 -j DNAT --to 192.168.0.10:4899
So what am i doing wrong?
Thanks!
 
Old 06-08-2006, 03:19 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
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:
http://www.hackorama.com/network/portfwd.shtml

Cool

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

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

Last edited by Braynid; 06-08-2006 at 11:14 AM.
 
  


Reply


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


All times are GMT -5. The time now is 12:08 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration