Current setup are 2 "RaspberriPi 3" models
On the first one I am trying to establish an ad-hoc network with the following commands
ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 essid RPInet
ifconfig wlan0 10.0.0.200 netmask 255.255.255.0
/usr/sbin/dhcpd wlan0
/etc/network/interfaces
auto lo wlan0
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
/etc/default/isc-dhcp-server
INTERFACES="wlan0"
/etc/dhcp/dhcpd.conf
DHCPDARGS=wlan0;
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 10.0.0.255;
option domain-name "RPi-Network";
option routers 10.0.0.1;
authoritative;
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.2 10.0.0.20;
}
On the second RPi I want to use wpa_supplicant and dhclient to obtain a lease from the first one
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/example.conf
/etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet manual
auto lo wlan0
iface lo inet loopback
allow-hotplug wlan0
iface wlan0 inet manual
/etc/wpa_supplicant/example.conf
ctrl_interface=/run/wpa_supplicant
update_config=1
network={
ssid="RPInet"
}
Why is RPI 2 not obtaining an IP address from the DHCP?
Another question: Why is the DHCP not going into active state after using /usr/sbin/dhcp wlan0 ?
The dhcpdiscover and offer in syslog from pi 1 are from itself. the mac address is its own, so why does it send itself requests?
iwconfig wlan0on both Pis? – Shan-Desai Aug 09 '16 at 10:05iwconfigassudo iwconfig wlan0 mode ad-hoc channel 1 essid RPinetthis can majorly solve problems at times.if you want some help I have written a blogpost here
– Shan-Desai Aug 11 '16 at 11:34iwconfig wlan0 channel 1and I configured wpasupplicant on the other one toctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=root update_config=1 ap_scan 2 network={ssid="RPi" scan_freq=2412 scan_ssid=1 key_mgmt=NONE mode=1 priority=1}when starting it and starting wpa_cli it saystrying to associate with SSID "RPi", Association request to the driver failed– wa112 Aug 12 '16 at 09:54iwconfig wlan0 mode ad-hoc iwconfig wlan0 essid RPi and ifconfig wlan0 10.0.0.201 netmask 255.255.255.0 upI can ping the first one on 10.0.0.200 successfully – wa112 Aug 12 '16 at 10:10