Running Ubuntu Server 12.04 (no GUI). What would be the best way to make kernel bring a network interface up only if it is physically plugged in? So, if it doesn't exist, just move on with initializing other interfaces (if any) and continue to the login screen, without "waiting for network configuration" delay.
E.g, I have a wireless USB key wlan9 (in /etc/network/interfaces):
auto wlan9
iface wlan9 inet dhcp
wpa-ssid myssd
wpa-psk mykey
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
I tried allow-hotplug instead of auto, in which case the interface doesn't get initialized automatically during the boot, and I have to do it manually with ifup wlan9. This is not exactly what I'm looking for.
Thank you.
Best Answer
Also for server: use NetworkManager
Install it:
Unfortunately, this will pull in a lot of dependencies.
Bring down the interface currently configured the traditional way.
Disable any manual settings in
/etc/network/interfaces
by removing all lines concerning that interface.Add a connection setting for your wireless connection in
/etc/NetworkManager/system-connections/
(make up a name):uuid
use the commanduuidgen
to generate a random one.mac-address
use the MAC address of your wireless adapter (useifconfig -a wlan9
to find out). This binds this configuration file to only this adapter - if it's not present it would not use it for another adapter, nor would it wait for the adapter to be present.Restart NetworkManager or reboot.