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 - 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 01-18-2010, 05:10 PM   #1
guylux
LQ Newbie
 
Registered: Jan 2010
Posts: 2

Rep: Reputation: 0
Unhappy port fowarding on linux


I am trying to route a security video server wich is inside my network to the internet.
my network is two interface eth0 (internet network xxx.xxx.xxx.198 and internal network 192.168.5.1

I am trying to see an web server on 192.168.5.184
Can somebody help.

Newbi lost in route..
 
Old 01-19-2010, 09:58 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
You need to setup NAT on the router between the host and the internet. eg: forward port xyz to port xyz on whatever internal machine.

If memory serves me something like this (as root):

Code:
iptables -t nat -A PREROUTING -p tcp -i eth0 -d xxx.xxx.xxx.198 --dport 80 -j DNAT --to 192.168.5.184:80
iptables -A FORWARD -p tcp -i eth0 -d 192.168.5.184 --dport 80 -j ACCEPT

Last edited by rweaver; 01-19-2010 at 10:03 AM.
 
Old 01-19-2010, 11:55 AM   #3
guylux
LQ Newbie
 
Registered: Jan 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Talking

Quote:
Originally Posted by rweaver View Post
You need to setup NAT on the router between the host and the internet. eg: forward port xyz to port xyz on whatever internal machine.

If memory serves me something like this (as root):

Code:
iptables -t nat -A PREROUTING -p tcp -i eth0 -d xxx.xxx.xxx.198 --dport 80 -j DNAT --to 192.168.5.184:80
iptables -A FORWARD -p tcp -i eth0 -d 192.168.5.184 --dport 80 -j ACCEPT
Fantastic it work perfectly .
Thaks a lot

Guy
 
  


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
help port fowarding bailey239 Linux - Networking 9 07-22-2007 03:08 PM
port fowarding georgel12 Linux - Networking 2 05-16-2006 06:38 PM
Port Fowarding zaicheke *BSD 9 10-25-2004 06:05 PM
Fowarding port 80 ? Drogo Linux - Networking 13 05-28-2003 03:16 AM
Port Fowarding. Arisen Sun Linux - Security 1 05-23-2003 06:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:59 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
Open Source Consulting | Domain Registration