Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-07-2014, 04:54 PM   #1
LQ Newbie
Registered: Feb 2014
Distribution: Ubuntu
Posts: 3

Rep: Reputation: Disabled
shutting down an interface when another interface goes down

Hi. I want to be able to shutdown eth2 if eth1 were to lose its network connectivity. This could be due to a shutting down of the upstream switch or unplugged cable or something else.

Is it possible to do this? What are some options?

Old 11-07-2014, 07:56 PM   #2
Ser Olmy
Senior Member
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
If the loss of connectivity generates an event of some kind, you could probably create a udev rule to tie that event to any action you like.
Old 11-17-2014, 05:48 PM   #3
LQ Newbie
Registered: Nov 2014
Location: Montreal, Qc, CA
Distribution: CentOs 6, 7
Posts: 8

Rep: Reputation: Disabled
The question is
How fast do you need to shutdown the other interface ?

A command like this in a script from a cron job go do it but you must not be in a hurry
RES=`ping -c 1 your_running_interface | grep '1 received' | awk '{print $4" "$5}'`
if [ "x$RES" == "x" ]; then
ifdown you_interface_to_shutdown

I would be careful about the consequences from shutting down the other interface.


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
Interface error Auto_eth0 unable to configure an interface or delete auto_interface James0806 Linux - Newbie 1 08-30-2014 12:32 PM
ATT Uverse DHCP Not Assigning to Red Interface Interface on Smoothwall barleykorn Linux - Networking 2 02-14-2010 05:12 PM
ERROR: The interface does not exist (UBUNTU) interface eth0 not configured anshulbhatt Linux - Networking 2 11-20-2008 12:23 PM
Automatic script for shutting down interface RajaRC Linux - Networking 0 11-02-2004 11:23 PM
shutting down interface eth0: system hangs anup_clemson Linux - Networking 1 09-21-2003 05:04 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration