Overview
One of the systems I am currently developing involves connecting a lot of Pis (>40) to a network and then interfacing with them simultaneously from a single host machine on the network using Java RMI to do some complex automation and distributed computing.
All of the Pis are configured to run completely headless but there are two main operational paradigms:
- Development: the Pi is sitting on my desk and connected to the network via the Ethernet network adapter; the advantage here is largely speed for VNC and live debugging.
- Deployment: the Pi is in the lab and connected the network via a wireless USB network adapter
Question
I'd like to configure the Pi to preferentially use the Ethernet network adapter and to only use the wireless adapter when no Ethernet connection is available automagically on boot. In loose psuedocode:
if(eth0 is available)
{
disable wlan0
}
else if( wlan0 is available)
{
disable eth0
}
I don't really require any sort of hotswap functionality but if it's easily achieved it could be convenient.
I've been messing around in /etc/network/interfaces but I'm a little scrubby with Linux and cant seem to achieve the desired functionality. Any help is greatly appreciated!