Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 09-25-2001, 07:48 AM   #1
LQ Newbie
Registered: Sep 2001
Posts: 1

Rep: Reputation: 0
iptables redirect

I'm having problems getting iptables to redirect from my firewall to my web server. I have two NIC cards. eth0 for the internet and eth1 for my LAN. my kernel is 2.4.9 and I have all of the netfiltering options for IPv4 and IPv6 built into it.

I have tried these rules in all sorts of combos.

iptables -P INPUT ACCEPT

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth1 -s -d -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 80 -j DNAT --to-destination

#iptables -A FORWARD -s -d -i eth1 -o eth0 -p tcp --dport 80 -j ACCEPT
#iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 80 -j DNAT --to-destination
#iptables -t nat -A PREROUTING -i eth0 -s -p tcp --dport 80 -j REDIRECT --to-destination

When I connect to it from the internet it I have a long wait for the first connection (I generally reconnect) and then it gives me a "The page cannot be displayed message". When I connect to the server from my LAN I get the web page. I would appreciate any input on this.


Brett Hartnett
Old 09-26-2001, 09:11 PM   #2
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
I have this line

iptables -A tcp_packets -p TCP -s 0/0 --dport 80 -j allowed

and this one

iptables -A INPUT -p TCP -i eth0 -j tcp_packets

hope it helps

Last edited by DavidPhillips; 09-26-2001 at 09:14 PM.


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
Some sort of redirect with iptables? zooper Linux - Networking 2 09-22-2005 02:11 AM
iptables redirect patvrs Linux - Networking 15 08-02-2005 08:31 AM
iptables redirect _ben_deb_ Linux - Networking 7 11-13-2004 05:06 AM
IPTABLES redirect question yuzuohong Linux - Networking 3 01-01-2003 09:30 PM
iptables redirect slack Linux - Networking 0 06-17-2002 04:04 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration