LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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-25-2001, 07:48 AM   #1
bhartnett
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
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

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

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

#iptables -A FORWARD -s 192.168.0.0/24 -d 192.168.0.1 -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 192.168.0.2
#iptables -t nat -A PREROUTING -i eth0 -s 0.0.0.0/0 -p tcp --dport 80 -j REDIRECT --to-destination 192.168.0.2

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.

Thanks,

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

Rep: Reputation: 56
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.
 
  


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


All times are GMT -5. The time now is 03:53 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