LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   run auto script when interface comes up or down on centos (https://www.linuxquestions.org/questions/linux-newbie-8/run-auto-script-when-interface-comes-up-or-down-on-centos-868616/)

bobo0110 03-14-2011 11:38 PM

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,

chrism01 03-15-2011 01:27 AM

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.

bobo0110 03-15-2011 02:15 AM

1 Attachment(s)
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,


All times are GMT -5. The time now is 06:00 PM.