LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Closed Thread
 
Search this Thread
Old 12-13-2012, 09:44 AM   #1
teky68
LQ Newbie
 
Registered: Jan 2007
Posts: 6

Rep: Reputation: 0
3 nics on and 2 different ISP's.


I have 3 nics and 2 different ISP's. I need to be able to send a heartbeat to my primary isp, and when that fails it will bring down nic1 and bring up nic2 for the secondary isp to work. Also, when the primary comes back up, it takes down nic2 and brings up nic1. I am looking for a bash script that does this for me.

Nic0 is on the internal network
Nic1 is on the primary isp
nic2 is on the secondary isp

Last edited by teky68; 12-14-2012 at 07:40 AM.
 
Old 12-13-2012, 11:06 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,601

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
If you bring nic1 down you will never known when the primary comes back up.

What you should be looking for is to ping the ISP via nic1 and if that fails then set your default gateway to the gateway on nic2, leaving a static route to your first ISP via nic1.

Then you can continue to ping your primary isp and change the routing back as necessary.
 
Old 12-13-2012, 12:35 PM   #3
teky68
LQ Newbie
 
Registered: Jan 2007
Posts: 6

Original Poster
Rep: Reputation: 0
I am looking for a bash script that does this for me.
 
Old 12-15-2012, 04:49 PM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed in favor of http://www.linuxquestions.org/questi...sp-4175441433/.
 
  


Closed Thread


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
I have 3 nics on squid and need a script to switch nics teky68 Linux - Newbie 2 12-15-2012 04:48 PM
One Box ISP Solution To Run An ISP swamprat Linux - Software 1 05-08-2008 07:25 PM
Intel D845GLLY + Multiple Intel Pro 100 NICs + kernel 2.6.x = NICs don't work egable Linux - Hardware 0 02-04-2005 03:30 PM
Changing ISP, apt-get can not see new ISP proxy linx win Debian 0 01-05-2005 04:41 AM
Need Help with Realying via ISP to ISP's Network papasan Linux - Networking 2 12-14-2003 09:42 AM


All times are GMT -5. The time now is 06:28 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration