Para definir uma interface preferida, use a diretiva de métrica nas interfaces. Quanto maior o valor, menor a prioridade.
allow-hotplug eth0
iface eth0 inet static
address 192.168.20.2
netmask 255.255.255.0
gateway 192.168.20.1
metric 30
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
metric 10
Em seguida, reinicie o serviço de rede com:
service networking restart
De Referência da Debian - Capítulo 5. Configuração da rede
The ifmetric package enables us to manipulate metrics of routes a posteriori even for DHCP.
The following sets the eth0 interface to be preferred over the wlan0 interface.
Install the ifmetric package.
Add an option line with "metric 0" just below the "iface eth0 inet dhcp" line in "/etc/network/interfaces".
Add an option line with "metric 1" just below the "iface wlan0 inet dhcp" line in "/etc/network/interfaces".
The metric 0 means the highest priority route and is the default one. The larger metric value means lower priority routes. The IP address of the active interface with the lowest metric value becomes the originating one. See ifmetric(8).