LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-26-2003, 02:05 PM   #1
lambmt
Member
 
Registered: Sep 2003
Distribution: RedHat 9
Posts: 44

Rep: Reputation: 15
Web Server on private IP


I have my NAT set up and a web server inside the nat and i want to set it up so the nat forwards the web packets (port 80) to an address inside my internal network any help on that? .... RH9...
 
Old 09-26-2003, 05:23 PM   #2
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
If everything else is good the a line like this will do it


iptables -t nat -A PREROUTING -p tcp -d my_external_ip_address -dport 80 -j DNAT --to-destination my_web_server_internal_ip

or swap

-d my_external_ip_address

for

-i eth0

or whatever card is the external one
 
Old 09-26-2003, 09:19 PM   #3
lambmt
Member
 
Registered: Sep 2003
Distribution: RedHat 9
Posts: 44

Original Poster
Rep: Reputation: 15
thanks will try it out and get back to ya!
 
Old 09-29-2003, 02:55 PM   #4
lambmt
Member
 
Registered: Sep 2003
Distribution: RedHat 9
Posts: 44

Original Poster
Rep: Reputation: 15
iptables -t nat -A PREROUTING -p tcp -d my_external_ip_address -dport 80 -j DNAT --to-destination my_web_server_internal_ip

i did this and got:

iptables v1.2.7a: multiple -d flags not allowed
Try `iptables -h' or 'iptables --help' for more information.
 
Old 09-29-2003, 03:40 PM   #5
lambmt
Member
 
Registered: Sep 2003
Distribution: RedHat 9
Posts: 44

Original Poster
Rep: Reputation: 15
got it the correct syntax is:

iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to 192.168.0.8

if that helps ne one other than me !
 
  


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
DNS Server (bind9) works on the private network but not in the public one! wjleon Linux - Networking 26 01-24-2009 09:14 PM
How to install a VPS / where to find it (Virtual Private Server) McNadia Linux - Software 1 01-05-2005 04:52 AM
Linux private server warren65 Linux - Newbie 7 09-28-2004 01:16 PM
can we configure a Linux server with mail server,file server and web server kumarx Linux - Newbie 5 09-09-2004 07:21 AM
Private ftp server.. Lowe Linux - Software 2 09-04-2004 09:13 PM


All times are GMT -5. The time now is 01:46 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration