I have (among other network devices) a RPi
Linux rpi2 4.1.10+ #821 PREEMPT Sat Oct 10 00:12:23 BST 2015 armv6l GNU/Linux
It is connected via WiFi to an access point (like the other devices). A static network configuration works (connection to the AP and TCP/IP traffic).
I now wanted to move it to DHCP by modifying in /etc/network/interfaces
the wlan0
stanza from
auto wlan0
iface wlan0 inet static
address 10.10.10.5
netmask 255.255.255.0
gateway 10.10.10.254
wpa-essid "MYSSID"
wpa-psk "mypassword"
to
auto wlan0
iface wlan0 inet dhcp
wpa-essid "MYSSID"
wpa-psk "mypassword"
The interface connects to the AP (which is visible though iwconfig
) but does not get any IP.
- No request is visible on the server (which runs
dnsmasq
so I can se all the logs - which include the ones from other devices). - other devices on the same AP get addresses without problems
- a
tcpdump
does not show any DHCP requests
What could block the RPi to request an IP address?
Answer (summarizing the answer to the question and my further comments): the lack of a client (which I must have removed when reconfiguring the device many times). Installing isc-dhcp-client
fixed the issue.
dhcpcd
will still run, and allocate IP address from the DHCP server, the result being indeterminate. The second will not rundhcpcd
(it will in fact but on detecting DHCP will disable itself as you would see from the logs). Neither is the recommended was of starting a WiFi network. – Milliways Mar 22 '16 at 03:47dhcpcd
will still run, and allocate IP address from the DHCP server" -- to which interface? If an interface is declared as static it will not have a DHCP client run against it (whether this isdhcpcd
ordhclient
). As for the second - it does run the DHCP client as I am getting IP addresses from my DHCP server (as soon as I installed the client which was, as I mentioned, missing). maybe it would be worthwhile to make an answer with the correct way to configure wifi - I would be glad to switch to the right one. – WoJ Mar 22 '16 at 07:19/etc/network/interfaces
doesn't work in current Raspbian - the Foundation even includes a comment in the latest versions of the file.dhcpcd
allocates IP addresses for ALL interfaces it can find. – Milliways Mar 22 '16 at 07:32man
pages, is there a Debian/Ubuntu official doc pointing to this approach? – WoJ Mar 22 '16 at 08:38