2

I'm connect to raspberry Pi2 via eth0 (ssh) and I need to configure wlan0 so that when I unplug the cable from eth0 wlan0 automatically turn on. How can I do? Is there a possibility to have eth0 and wlan0 switched on at the same time?

  • This question is a general networking question, rather than being a Raspberry Pi specific problem. Personally I'd look to have them both switched on but to use route metrics to prioritise traffic over the wired link if available. – joan Jul 9 '15 at 12:40
4

Read /etc/network/interfaces, for wider information type man interfaces, check the stanzas you have, if you see :

for eth0

auto eth0
allow-hotplug eth0
iface eth0 inet manual #or dhcp or static

and for wlan0

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp #again or manual or static
        #network details here

allow-hotplug means that :start the interface name(eth0,wlan0,wlan1,...) when kernel detects a hotplug event from the interface

auto wlan0 || eth0 means that : start that interface upon the starting of the system iface wlan0 || eth0 line defines the network configuration mode

You can also get the interfaces up or down by simply typing :

sudo ifup eth0 || sudo ifup wlan0 || sudo ifdown wlan0 || sudo ifdown eth0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.