"ifdown eth0" not working. Intelligent WAN failov

8 posts / 0 new
Last post
gohar
"ifdown eth0" not working. Intelligent WAN failov

Hey all,

I'm trying to create custom script on vyatta to serve my purpose of shutting down the LAN interface {configured with VRRP with Primary router} when the script senses any Internet outage.

That'll help me shift traffic from primary router to secondary using VRRP.

The problem is when I issue the command ifdown etho it doesn't work !!
please see and help.

Output from CLI;

Quote:
SEC-vRouter:~# ifdown eth0
ifdown: interface eth0 not configured
SEC-vRouter:~#

SCRIPT: Ping multiple internet destinations and when no response from all of them for atleast 5 sec then shutdown VRRP interface and bring up secondary WAN.

I'll place the script and how-to here after I've it successfully deployed. Please help.

Docent
"ifdown eth0" not working. Intelligent WAN failov

Try ip link:

ip link set eth0 down

Regards,
Docent

stig
"ifdown eth0" not working. Intelligent WAN failov

Docent wrote:
Try ip link:

ip link set eth0 down

Regards,
Docent

Or to do it via the vyatta cli:

vyatta@r1:~$ configure 
[edit]
vyatta@r1# set interfaces ethernet eth0 disable
[edit]
vyatta@r1# commit
[edit]
vyatta@r1# exit
Warning: configuration changes have not been saved.
exit
vyatta@r1:~$ show interfaces 
Interface    IP Address         State       Link   Description                  
eth0         -                  admin down  down                                
eth1         172.16.117.2/24    up          up     vmnet1                       
eth1         2001:172::2/64     up          up     vmnet1                       
eth2         -                  up          up                                  
eth3         -                  up          up                                  
gre0         -                  admin down  down                                
lo           127.0.0.1/8        up          up                                  
lo           ::1/128            up          up                                  
tun0         20.0.0.2/24        up          up                   
gohar
"ifdown eth0" not working. Intelligent WAN failov

Docent wrote:
Try ip link:

ip link set eth0 down

Regards,
Docent

I'll definitely be trying this thing-if it works on root/bash.

stig- is there a way to issue vyatta cli commands as you mentioned from the debian(linux) interface?
Like when my script is processed by root and knows the linux commands and just in the middle of my script I want to issue vyatta command e.g

Quote:
root@r1# set interfaces ethernet eth0 disable
gohar
Failover design diagram

This is the physical design/topology:

to achieve this functionality as we are discussing here, is there any built-in feature for this? like Clustering? I've question regarding use of clustering for the purpose.

For reference let me rewrite the script algorithm

Algorithm:
1- Monitor multiple Internet sites per 3-5 seconds.
2- If all of the monitored sites don't respond for 2-3 seconds then ifdown-eth0.
3- else goto step-1

stig
Re: Failover design diagram

gohar wrote:
This is the physical design/topology:

to achieve this functionality as we are discussing here, is there any built-in feature for this? like Clustering? I've question regarding use of clustering for the purpose.

For reference let me rewrite the script algorithm

Algorithm:
1- Monitor multiple Internet sites per 3-5 seconds.
2- If all of the monitored sites don't respond for 2-3 seconds then ifdown-eth0.
3- else goto step-1

Couldn't you just run vrrp on eth1 and create a sync-group to make them failover together?

As for your question about scripting vyatta cli commands see [url]http://www.vyatta.org/node/2875#comment-11672] or if you're running the subscription version it's even easier to use the remote api to configure things.

gohar
"ifdown eth0" not working. Intelligent WAN failov

Thanks for directing me to the relevant post- thank you much much :)

So- I really considered using VRRP sync groups and adding eth1 into it BUT two things:

1- For eth1 in my design to be part of sync group i'd need to plug-out the eth1 from my WAN router-Pri and same for secondary router and place in an additional switch, configure VRRP locally on it and add it to the group.

INTERNET-----WAN-ROUTER-PRI-----{eth-1}[Vyatta Router Pri]{eth0} VRRP ----- LAN
\
\\
\\\--------------WAN-ROUTER-Sec-----{eth1}[Vyatta Router Sec]{eth0} VRRP----- LAN

As you can see my physical connections + WAN IP schemes don't allow me to add VRRP sync groups.

2- Even if I use VRRP sync groups I won't me monitoring any INTERNET hosts but my local interfaces and any internet outage on WAN router Pri won't do me any good.!

3- Using Clustering option: Clustering do monitor internal as well as external IP sources (internet hosts) but the tutorial where I learned it from made me think that in case of any timeout from any single source will force the backup node to take over. is it so?

gohar
"ifdown eth0" not working. Intelligent WAN failov

Docent wrote:
Try ip link:

ip link set eth0 down

Regards,
Docent

Thanks alot- this line really worked. I wonder whats wrong with ifconfig! Anyways nice one.

stig- please continue discussion.