LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-13-2007, 09:12 PM   #1
echo_max
Member
 
Registered: Jun 2005
Location: Thornton, Colorado
Distribution: Debian 4, Ubuntu 9.04
Posts: 38

Rep: Reputation: 15
Webiste down, need some advice


Hello all,

I've got a linux route running iptables. i thought i had it functioning correctly, forwarding the necessary ports for http, ssh and ftp to another box. Evidently my website isn't accessible (neither are any of these other services). I'm not sure whats hanging up the connection in iptables. Below is the commands i pass to iptables to enable port forwarding and forward the ports. I would appreciate it greatly if someone could point out my mistake:

Code:
IPTABLES=/sbin/iptables
ROOTERLAN=eth0
ROOTERWAN=eth1
VEGALANIP=10.6.1.10
ROOTERLANIP=10.6.1.1
LANNET=10.6.1.0/24

...flush tables and set policies...


$IPTABLES -A INPUT -p tcp --dport http -i $ROOTERWAN -j ACCEPT
$IPTABLES -A POSTROUTING -t nat -s $LANNET -o $ROOTERWAN -j MASQUERADE
$IPTABLES -A FORWARD -i $ROOTERWAN -j ACCEPT
$IPTABLES -A FORWARD -p tcp -s $VEGALANIP -i $ROOTERLAN -o $ROOTERWAN -j ACCEPT

#forward http
$IPTABLES -A PREROUTING -t nat -i $ROOTERWAN -p tcp --dport 80 -j DNAT --to $VEGALANIP:80
$IPTABLES -A FORWARD -p tcp --dport 80 -i $ROOTERWAN -d $VEGALANIP -j ACCEPT
Thanks in advance.
 
Old 11-14-2007, 04:18 PM   #2
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 58
does this say 1
cat /proc/sys/net/ipv4/ip_forward
Code:
some examples ...
# export LAN=eth0
# export WAN=eth1

Forward port 2 to ssh on an internal host
# iptables -t nat -A PREROUTING -p tcp --dport 2 -i ${WAN} -j DNAT --to 192.168.0.2:22

FTP forwarding to an internal host
# iptables -t nat -A PREROUTING -p tcp --dport 21 -i ${WAN} -j DNAT --to 192.168.0.56

HTTP forwarding to an internal host
# iptables -t nat -A PREROUTING -p tcp --dport 80 -i ${WAN} -j DNAT --to 192.168.0.56
from the gentoo docs

Last edited by comprookie2000; 11-14-2007 at 04:21 PM.
 
Old 11-18-2007, 04:46 PM   #3
echo_max
Member
 
Registered: Jun 2005
Location: Thornton, Colorado
Distribution: Debian 4, Ubuntu 9.04
Posts: 38

Original Poster
Rep: Reputation: 15
The problem is fixed. Turns out my DynDNS account was expired! a recreated the account and everything is dandy.
 
  


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
webiste hoisting varun_saa Mandriva 2 11-03-2006 04:14 AM
Hello and looking for advice KarlJ General 2 10-16-2006 08:57 AM
Advice.. kemplej Linux - Certification 25 07-20-2004 11:46 AM
Apache: webiste stores mikeshn Linux - Software 3 06-30-2003 09:20 PM
New PC Advice ixion Linux - Hardware 0 06-20-2003 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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