Solução:
auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet dhcp wpa-ssid "myssid" wpa-psk "mypasswd"
As diferenças entre auto
e allow-hotplug
são bem explicadas em Boa explicação detalhada da /etc/network/interfaces
sintaxe :
auto interface
– Start the interface(s) at boot. That’s why thelo
interface uses this kind of linking configuration.
allow-hotplug interface
– Start the interface when a "hotplug" event is detected. In the real world, this is used in the same situations asauto
but the difference is that it will wait for an event like "being detected by udev hotplug api" or "cable linked".