LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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


Reply
  Search this Thread
Old 03-15-2011, 04:09 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?

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:	18
Size:	27.5 KB
ID:	6410  
 
Old 03-15-2011, 04:31 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Try this from the centos documentation page: Section 13.3-Interface Control Scripts. All of section 13 might be of interest to you.

Specifically:
Quote:
ifup-aliases Configures IP aliases from interface configuration files when more than one IP address is associated with an interface.

Last edited by Noway2; 03-15-2011 at 04:32 AM. Reason: added ifup-aliases quote
 
  


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
run auto script when interface comes up or down on centos bobo0110 Linux - Newbie 2 03-15-2011 02:15 AM
how to auto run script in startup struggled_newbie Linux - Newbie 2 03-13-2011 10:31 PM
auto run script muleypr Linux - General 16 10-30-2006 06:14 AM
Getting firewall script to auto-run at startup lrt2003 Linux - Newbie 2 04-25-2004 02:28 AM
Auto Run A Cgi Script f117bomb Linux - General 1 11-25-2001 01:18 AM

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

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