LinuxQuestions.org
Help answer threads with 0 replies.
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 05-13-2002, 02:20 PM   #1
quickbeam
LQ Newbie
 
Registered: Nov 2001
Location: Pocatello, ID
Distribution: Debian Squeeze
Posts: 6

Rep: Reputation: 0
apache, port-forward and router on same box


I am trying to set up a router to handle all traffic coming into my network. I have an internal Web server running and want all Web traffic to go to it. I also need the router to do masquerading and firewalling. I have a fairly extensive firewall script that does everything but the port forwarding. The rules for port forwarding are included in the script and I have them running but I cannot get Web requests to go through the router and to my internal Web server. I do have apache installed on the router. When apache is running it grabs all port 80 requests (like it should) but when it is disabled I get nothing through the router. Any help would be greatly appreciated!!
 
Old 05-14-2002, 04:41 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
What do your rules look like? For just forwarding one port I use something like this:

iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to 192.168.10.2
 
Old 05-14-2002, 08:54 AM   #3
quickbeam
LQ Newbie
 
Registered: Nov 2001
Location: Pocatello, ID
Distribution: Debian Squeeze
Posts: 6

Original Poster
Rep: Reputation: 0
Here is the line for the prerouting in my firewall script.

$IPTABLES -A PREROUTING -t nat -i $EXTERNALIF -p tcp -d $MYADDR --dport 80 -j DNAT --to 192.168.2.5:80

($IPTABLES is the call to iptables, $EXTERNALIF is eth0, $MYADDR is the public firewall ip address).

I have only tried to see if this works from inside my network (i.e. I have not tried from someone else's network). Could there be something else that is preventing me from getting through the router?

Thanks!
 
  


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
Apache: Forward request to another box? MasterC Linux - Networking 10 10-26-2007 04:27 PM
struggling to port forward apache 1.3 dynamicsamurai Linux - Networking 1 06-15-2005 01:40 AM
apache bringing up router login box kola Linux - Networking 0 12-18-2004 03:31 AM
A way to forward an IP/Port to another system's IP/Port astroboy5714 Linux - Networking 6 01-26-2004 05:45 PM
Forward port port 80 to lan web server dulaus Linux - Networking 9 10-04-2002 03:45 AM


All times are GMT -5. The time now is 04:37 PM.

Main Menu
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