LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 08: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 06:40 AM.
 
Old 12-13-2012, 10:06 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
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, 11:35 AM   #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, 03:49 PM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:55 AM.

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
Open Source Consulting | Domain Registration