Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a Ubuntu 12.04 VM (VirtualBox) with two adapters, which are bridged to the cabled LAN (eth0) and Wireless LAN (eth2). Both of them are configured as DHCP. Since the host will always be connected via either the LAN or the Wireless adapter (i.e. one of the two will always be disconnected), one of the two adapters in Ubuntu will always be without IP, because it won't be able to query the DHCP server. In such case, I would like to trigger an ifconfig eth(x) down when the interface doesn't have an IP address.

I've read that it's possible to run scripts related to the network adapters, but I'm not really sure how to do so.

Thanks in advance for the answers.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.