2

I have a Raspberry Pi 3 with an external WiFi antenna wlan1 set up as an independent IoT access point without Internet connection following this tutorial, using hostap and isc-dhcp server. I omitted the Network Access Translation part. The AP worked well up to the point when I tried connecting wlan0 to my router at home for accessing the Internet via the GUI.

My /etc/network/interfaces looks like this

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 static
    address 192.168.42.1
    netmask 255.255.255.0

I setup the daemon

sudo service hostapd start
sudo service isc-dhcp-server start 

and

sudo update-rc.d hostapd enable
sudo update-rc.d isc-dhcp-server enable  

and this all worked before I started messing with wlan0.... But now on boot when hovering over the GUI it says "wlan1: Disassociated from Pi3AP" and sudo service hostapd status prints

Loaded: loaded (/etc/init.d/hostapd)
Active: active (exited) since ... 31 mins ago
Process: 571 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS)

The command

sudo service isc-dhcp-server status

returns an error

raspberrypi dhcpd[778]: receive_packet failed on wlan1: Network is down

When I run

sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf

all works again but nothing on reboot. Can someone spot at where the error lies? Somehow the network GUI and/or the two wlan interfaces seem to be interfering with each other.

migrated from stackoverflow.com Feb 20 '17 at 3:27

This question came from our site for professional and enthusiast programmers.

  • 1
    try to add denyinterfaces wlan1 to /ect/dhcpcd.conf. That should stop dhcpcd tying to do anything on wlan1 – Mero Feb 28 '17 at 11:56
  • @Mero Wouldn't the line iface wlan1 inet static already prevent that? – Dmitry Grigoryev Feb 28 '17 at 16:49
  • @DmitryGrigoryev As far as I know, no. dhcpcd will keep try to obtain ip address. – Mero Feb 28 '17 at 17:24
  • @Mero But then, what's the purpose of iface wlan1 inet dhcp? – Dmitry Grigoryev Feb 28 '17 at 17:32
  • 2
    @DmitryGrigoryev This might answer your question. raspberrypi.stackexchange.com/questions/39785/…. So I believe dhcpcd start after networking and by default it will take over all interfaces. In order to stop that happening, you need to tell dhcpcd to do not do anything on that interface – Mero Feb 28 '17 at 17:44

Your Answer

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

Browse other questions tagged or ask your own question.