LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-15-2011, 12:38 AM   #1
bobo0110
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
run auto script when interface comes up or down on centos


Hi all !!!

i have a centos box with interfaces eth0 and lo:0.
i want to write a script to stop or start lo:0 automatically when eth0 comes down or up.
is there any way to do that?

thanks,
 
Old 03-15-2011, 02:27 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,415

Rep: Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785
As a rule, lo:0 (ie localhost) is always up. Is there any reason you'd want it down? It's the i/f that the system uses to talk to itself.
 
Old 03-15-2011, 03:15 AM   #3
bobo0110
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Actually, I have a load balancing model using 2 LVS servers for failover (see attached figure)
Each LVS has one real i/f eth0 & one virtual i/f lo:0 assigned virtual ip
Sometimes eth0 in one of 2 LVS servers down, the incoming requests don't come the other server automatically.
The main reason is the router keeps holding MAC of server (has eth0 down) not the one of other server if i/f lo:0 is up (i really don't know why)

So needing a auto script in this case is very helpful

thanks,
Attached Thumbnails
Click image for larger version

Name:	hc-ha-lb-eg.png
Views:	14
Size:	27.5 KB
ID:	6408  

Last edited by bobo0110; 03-15-2011 at 03:26 AM.
 
  


Reply


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
how to auto run script in startup struggled_newbie Linux - Newbie 2 03-13-2011 11:31 PM
auto run script muleypr Linux - General 16 10-30-2006 07:14 AM
auto run bash script when logged in linuxmandrake Fedora 1 06-11-2005 09:22 PM
Getting firewall script to auto-run at startup lrt2003 Linux - Newbie 2 04-25-2004 03:28 AM
Auto Run A Cgi Script f117bomb Linux - General 1 11-25-2001 02:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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