I finaly found how to setup the network to use both or alternatively Eth0 and Wifi without any reconfiguration.
With my settings I can :
- Boot the PI without any wifi dongle nor cable, then plug the cable (plugin the wifi dongle reboots the PI)
- Boot the PI with both cable and wifi dongle
- Boot the PI only with one or them, usually wifi.
The main trick is to DO NOT set eth0 in auto !!
otherwise booting only with the wifi dongle will not work.
Personally I use static adresses but dhcp will do it if you wish.
If you prefer dhcp just replace static by dhcp (2 times) and remove all the lines
All the configuration is done in /etc/network/interfaces only ( no wpa- things )
Here is my /etc/network/interfaces :
Run the test :
Code: Select all
iface lo inet loopback
iface eth0 inet static
iface wlan0 inet static
wpa-ssid <name of your access point without quotes>
wpa-psk <the wifi password without quotes>
- Reboot the machine and execute ifconfig to check the IPs. As Eth0 is NOT auto you will not see any address, and the system will use the wifi one.
- Try to plug and unplug the cable and do various ping ...
This worked perfectly for me.