LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-09-2010, 01:22 PM   #1
scream
Member
 
Registered: Feb 2008
Distribution: Oracle Linux
Posts: 32

Rep: Reputation: 0
link failover


i have a centos gw server where i have 3 nic card. eth0 for LAN, eth1 for ISP1 and eth2 for ISP2. my plan is to use ISP2 when ISP1 is down. i made following script:


#!/bin/bash
myHost="67.147.160.76"
while true
do
ifconfig eth1 up
ifconfig eth2 down
count=$(ping -c1 $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
if [ $count -eq 0 ]; then
# 100% failed
ifconfig eth1 down
ifconfig eth2 up
else
ifconfig eth2 down
ifconfig eth1 up

fi

sleep 1000
done
_____________________________

the script is working but when it enables eth2 my users cannot browse net.

please help me.
 
Old 09-09-2010, 02:07 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,853

Rep: Reputation: 161Reputation: 161
The script should change default gateway after eth2 is up.
 
Old 09-09-2010, 02:37 PM   #3
scream
Member
 
Registered: Feb 2008
Distribution: Oracle Linux
Posts: 32

Original Poster
Rep: Reputation: 0
i have configured default gw for each eth in its ifcfg-ethx file. can you please explain little.
 
Old 09-12-2010, 08:52 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,853

Rep: Reputation: 161Reputation: 161
If you configure default gateway for each Ethernet interface, that means there are multi-default gateway in the system. What default gateway is available when eth2 is up.
 
  


Reply



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
Failover wasamzy Linux - Server 11 09-25-2010 04:56 AM
link failover & load balancing in linux keifer Linux - Networking 2 06-11-2010 04:27 AM
Failover vkmgeek Linux - Networking 5 04-05-2008 03:10 PM
IP failover sanjibgupta Linux - Networking 6 05-04-2007 04:01 AM
Link failover trigger. xonner Linux - Networking 1 02-02-2006 07:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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