Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   Run commands automatically when bringing up/down network interfaces? (http://www.linux-archive.org/centos/575746-run-commands-automatically-when-bringing-up-down-network-interfaces.html)

Warren Young 09-14-2011 09:14 PM

Run commands automatically when bringing up/down network interfaces?
 
On 9/14/2011 1:26 PM, Edward Morbius wrote:
> I'm looking for a capability similar to Debian/Ubuntu's pre/post up/down
> network commands capability.

If you look in /etc/sysconfig/network-scripts/ifup, you'll see that it
will call /sbin/ifup-pre-local if it exists, before bringing up the
network interface.

That script also calls .../network-scripts/ifup-post after bringing up
the network interface, which in turn will call /sbin/ifup-local, if it
exists, as its last step.

Neither is interface-specific, but they get the interface name passed to
them, so if you needed to do something different for different
interfaces, you could.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Frank Cox 09-14-2011 09:27 PM

Run commands automatically when bringing up/down network interfaces?
 
On Wed, 14 Sep 2011 12:26:10 -0700
Edward Morbius wrote:

> I'm looking for a capability similar to Debian/Ubuntu's pre/post up/down
> network commands capability.

If you're using networkmanager you can create a script in
in /etc/NetworkManager/dispatcher.d/ to do pretty much anything you want it to
do.

--
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
www.creekfm.com - FIFTY THOUSAND WATTS of POW WOW POWER!
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


All times are GMT. The time now is 10:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.