Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 08-28-2007, 07:56 AM   #1
Registered: Nov 2006
Location: India
Distribution: CentOS, Redhat, Ubuntu
Posts: 30

Rep: Reputation: 15
portforwarding with iptables

i have two webservers running my Lan. letus say server1 & server 2
i have forwarded port 80 to my server1 with iptables.
here my question is if my server1 down then server2 should take the requests.
how can i add this with iptables???
Old 08-28-2007, 12:49 PM   #2
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
You'd need a program that periodically checks if server1 is up, and executes the appropriate iptables rule (changing the port forward toward server2) if it finds that it is down. If you search LQ you'll probably find several examples of ping scripts that will execute stuff conditionally. I actually remember one specific script posted by gbonvehi a couple years ago as a possible solution for someone's very similar needs.

Last edited by win32sux; 08-28-2007 at 12:55 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
Iptables portforwarding with dns IHIHUG Linux - Security 19 07-04-2006 09:40 AM
Very Stupid Question about Iptables & Portforwarding kemplej Linux - Networking 20 07-27-2004 02:37 PM
IPTABLES and PortForwarding ComFox Linux - Networking 1 09-09-2002 04:37 PM
iptables and portforwarding gseven1 Linux - Networking 1 02-22-2002 10:20 AM
Portforwarding with Iptables toxic Linux - Security 2 02-14-2002 11:52 PM > Forums > Linux Forums > Linux - Security

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