How can i use interface pre-up/post-up/pre-down/post-down in ClearOS (CentOS-based)?
I need to execute some commands before and after my interface get up and get down. How 开发者_如何学Ccan i do it in the ClearOS (it is based on CentOS), where there are not these options?
I think what you are looking for here is the /sbin/ifup-pre-local
, /sbin/ifup-local
, /sbin/ifdown-pre-local
and /sbin/ifdown-local
.
All scripts take the device as the first argument. The /sbin/ifup-pre-local
also takes a second optional argument which could "boot" when the interfaces are being brought up on boot.
精彩评论