Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


Closed Thread
  Search this Thread
Old 12-13-2012, 09:44 AM   #1
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
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,839

Rep: Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600
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
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
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
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

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 10:19 PM.

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