Share your knowledge at the LQ Wiki.
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 04-06-2008, 12:06 AM   #1
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Rep: Reputation: 31
iptables to redirect ip

Hello, I'm running a web server on port 80 (IP is and have 2 computers connected viw wifi (, I want all the computers to hit the webserver before they get access to the internet, in other words if wants to get to he'll be redirected to the webpage.

Whats the best and easiest way to do this, IPtables seems most feasible but I've no idea how

Old 04-06-2008, 01:53 AM   #2
Senior Member
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
The only way you can enforce the redirection (i.e. w/o the cooperation of the requesting computer) is to have your wireless router (or whatever is between these computers and the Internet) to do the redirection. I'm guessing that's not an option for you, but if it is, post back.

There are two ways for the requesting computers to do the redirection. One (which will work the same way on any OS) is to set up the browser(s) to use as a proxy. One drawback to this solution is any user can change his own settings and defeat this.

The other option is to have the firewall redirect. This method will, of course, depend on the OS the computer is running. If the computer is running Linux, I believe the following rule will work.

iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination

Last edited by blackhole54; 04-06-2008 at 01:55 AM. Reason: spelling


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
iptables redirect sanjibgupta Linux - Networking 3 05-18-2007 03:16 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 slack Linux - Networking 0 06-17-2002 04:04 AM
iptables redirect bhartnett Linux - Networking 1 09-26-2001 09:11 PM > Forums > Linux Forums > Linux - Networking

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