[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Run command when bringing interface up or down

peace bwitchu wrote:
Does RHEL 4 have a way of running a command upon
bringing a certain interface up or down?  Debian has
pre-up,post-up,pre-down, and post-down, this is
defined in the interfaces file which is the equivalent
of /etc/sysconfig/network-scripts/ifcfg-ethX.  This is
very convenient for starting wpa on wireless
interfaces etc...

and for setting routes, updating firewalls, sending queued mail (when ppp0 comes up).

Extremely useful, and I don't know of anything like it.
See /usr/share/doc/initscripts-7.93.11.EL/sysconfig.txt which says<<END

  Called when any network device EXCEPT a SLIP device comes
  up.  Calls /etc/sysconfig/network-scripts/ifup-routes to
  bring up static routes that depend on that device.  Calls
  /etc/sysconfig/network-scripts/ifup-aliases to bring up
  aliases for that device.  Sets the hostname if it is not
  already set and a hostname can be found for the IP for that
  device.  Sends SIGIO to any programs that have requested
  notification of network events.

  Could be extended to fix up nameservice configuration, call
  arbitrary scripts, etc, as needed.
/etc/sysconfig/network-scripts/ifup-post.local getting called by /etc/sysconfig/network-scripts/ifup-post would be a handy way to allow local administrators to perform customisations (/etc/sysconfig/network-scripts/ifup-post.d might be handy too), along with corresponding /etc/sysconfig/network-scripts/ifdown-post facilties.

On FC3, I've used DHCP scripts to update BIND's configuration (I run my own nameserver on my laptop) to use the supplied DNS servers as targets for forwarding my requests rather than updating /etc/resolv.conf.



-- spambait
1aaaaaaa computerdatasafe com au  Z1aaaaaaa computerdatasafe com au
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/

do not reply off-list

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]