dhcp (from dnsmasq) not working on Stretch, RPI3b hotspot/bridge.  Wifi connnected client gets 169.x.x.x IP addresss

DaveThomasPilot
DaveThomasPilot used Ask the Experts™
on
rpi3b,  Stretch, used this tutorial for setup:

https://thepi.io/how-to-use-your-raspberry-pi-as-a-wireless-access-point/

Except that I added an entry in /etc/dhcpcd.conf to make br0 ip address static (found that in another post):

interface br0
static ip_address=192.168.173.11/24

Open in new window


ifconfig output on rpi:
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.173.11  netmask 255.255.255.0  broadcast 192.168.173.255
        inet6 fe80::a8b1:dbf2:1ff6:c1d9  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:8b:27:c0  txqueuelen 1000  (Ethernet)
        RX packets 684  bytes 112300 (109.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 302  bytes 33198 (32.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.144.35  netmask 255.255.0.0  broadcast 169.254.255.255
        ether b8:27:eb:8b:27:c0  txqueuelen 1000  (Ethernet)
        RX packets 384  bytes 62532 (61.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 631  bytes 97466 (95.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 260  bytes 22236 (21.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 260  bytes 22236 (21.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 169.254.218.79  netmask 255.255.0.0  broadcast 169.254.255.255
        ether b8:27:eb:de:72:95  txqueuelen 1000  (Ethernet)
        RX packets 305  bytes 50334 (49.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 446  bytes 72599 (70.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

From what I've read, this is expected.  br0 has the expected static IP.  

/etc/nework/interfaces:

source-directory /etc/network/interfaces.d

auto br0
iface br0 inet manual
bridge_ports eth0 wlan0

Open in new window


Seems that in Stretch, nothing is to be entered in the /etc/network/interfaces file.  But, while there are no entries for eth0 and wlan0, all tutorials about bridging include the br0 stuff.

I can ssh over an ethernet cable (through a switch) from a windows 10 machine configured with a static ip address on the ethernet adapter.

Also,  I see the wifi hotspot and wifi connect to it from a Windows 10 machine.  But, the IP address for the windows wireless lan adapter is 169.254.193.166.

Getting a bridged AP working is the first step.  Where I want to end up:

4 ethernet connected RPIs (through a switch) (192.168.173.x)
One of these is also wifi hotspot.
wifi connected clients get ip address that can communicate with the rpis
(ideally)  On rpi is a wlan client and used as a gateway by the other pis.

I have this working on Jessie using isc-dhcp-server instead of dnsmasq and routing table instead of a bridge,  

I have to move to stretch, and it seemed that bridging might be simpler and the preferred solution.  But, I'm about ready to punt and try doing it the way I did on Jessie (except avoid used of /etc/network/interfaces and use dhcpcd.conf instead.

Back to the specific problem--it seems like dhcp isn't working.  I think this is dnsmasq issue.  How to debug?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
Just tried configuring the Windows 10 wireless adapter with a static IP on 192.168.173.x subnet.

It seems the bridge is working.  I can ping either of two ethernet interconnected rpis using the wireless interface (and ssh into them).

Just need to figure out why dhcp isn't providing an ip address to the Windows machine.
Changed dnsmasq.conf to use interface br0 for the address range instead of wlan0 (as specified in the tutorial):

interface=br0
  dhcp-range=192.168.173.5,192.168.173.70,255.255.255.0,24h

Open in new window


Now a wifi connected client gets an ip address and I can ssh connect over wifi to the ethernet connected rpis.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
DHCPCD is a Dhcp Client not a server... ==> it is the hard way to get a static address on your br0...
And not mentioning the other interfaces case those to receive an APIPA address (no other DHCP daemons on those networks , which is a good thing).

You could also not use dhcpc.conf and add the address and netmask to the interface spec for br0...

In your case use DNSMASQ as DHCP server ==> that does need to know about the br0 being used.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial