I was using Wlan0 but in the middle I do not know where I messed up wlan0 wasn't starting automatically instead my pi3 was trying to connect through ethernet with LAN cable plugged in, so I unplugged LAN cable it was still not having wlan0 started automatically so I have put this below line in /etc/rc.local

sudo /etc/init.d/networking restart; sudo ifup wlan0

Is it ok to put in /etc/rc.local I am doubting because earlier it used to start automatically without this line in rc.local?

Contents of /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  • What's the content of /etc/network/interfaces ?
    – Domme
    Aug 27, 2016 at 17:04
  • Without commenting on the strategy itself, don't use sudo in /etc/rc.local; it's run by init with privileges. If you wish to test it, then use sudo rc.local instead.
    – goldilocks
    Aug 27, 2016 at 17:08
  • @Domme I have added content of /etc/network/interfaces Aug 28, 2016 at 5:34
  • Try this link : raspberrypi.stackexchange.com/questions/74593/…
    – DRV
    Dec 7, 2019 at 16:18


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.