CloudOne
Posts: 10
Joined: Thu Feb 14, 2019 4:06 pm

I can't see any client in dnsmasq.leases

Wed May 22, 2019 5:55 pm

I'm using a Rpi 3 with a bridge using hostapd, dnsmasq and bridge-utils. I would like to get the IP from /var/lib/misc/dnsmasq.leases but the problem is that it shows nothing. The hotspot works fine, I can connect to the Internet via the actual rpi and an external device like a mobile phone.

These are my conf files:

/etc/dhcpcd.conf

Code: Select all

interface wlan0
    static ip_address=192.168.0.10/24
    denyinterfaces eth0
    denyinterfaces wlan0

/etc/network/interfaces

Code: Select all

source-directory /etc/network/interfaces.d
    auto br0
    iface br0 inet manual
    bridge_ports eth0 wlan0
/etc/dnsmasq.conf

Code: Select all

  interface=wlan0
    dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h

/etc/hostapd/hostapd.conf

Code: Select all

interface=wlan0
    bridge=br0
    hw_mode=g
    channel=7
    wmm_enabled=0
    macaddr_acl=0
    auth_algs=1
    ignore_broadcast_ssid=0
    wpa=2
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=TKIP
    rsn_pairwise=CCMP
    ssid=node1
    wpa_passphrase=mypassword
$ brctl show

Code: Select all

bridge name	bridge id STP enabled	interfaces
    br0	8000.b827eb8691b6	    no		                eth0
	        	        		wlan0
I also use the "Network settings" of Linux Mint 19 and it perfectly creates a hotspot where the clients are well-displayed on dnsmasq.leases. The difference is that in Linux Mint I don't have a bridge but the rpi has.

epoch1970
Posts: 3049
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: I can't see any client in dnsmasq.leases

Wed May 22, 2019 6:20 pm

Your config is wrong on multiple accounts it seems.

I understand you want to bridge wlan0 and eth0 and run a single network off them. If so:
1.a- In /etc/network/interfaces, change "iface br0 inet manual" to "iface br0 inet static" and define the network parameters of the interface there,
then at the top of /etc/dhcpcd.conf, add "denyinterfaces eth0 wlan0 br0" and remove the "interface wlan0" block.
or
1.b- In /etc/dhcpcd.conf, add "denyinterfaces eth0 wlan0" at the top of the file and replace the "interface wlan0" block with the following:

Code: Select all

interface br0
    static ip_address=192.168.0.10/24
2. Make dnsmasq listen on br0 instead of wlan0, serve addresses on the network that br0 uses, within a range that does not clash with static addresses like the .10 used for br0

Code: Select all

interface=br0
    dhcp-range=192.168.0.20,192.168.0.50,255.255.255.0,24h
eth0 and wlan0 are bridge member interfaces, they must have no IP configuration of their own. br0 must have a static IP configuration because the machine runs a DHCP server.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

CloudOne
Posts: 10
Joined: Thu Feb 14, 2019 4:06 pm

Re: I can't see any client in dnsmasq.leases

Wed May 22, 2019 9:29 pm

I tried to do what you've told me, in the first solution I stop having internet on the rpi but I have on the devices connected and the second one hasn't worked for me. Apart from that I'm trying to make an isolated ap but without success, because I realised that all the clients connected to the network are been showed. The idea is to send information like ip, mac to a web server, I only want to send the information of known devices connected to that isolated ap not all the others.

epoch1970
Posts: 3049
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: I can't see any client in dnsmasq.leases

Wed May 22, 2019 10:17 pm

CloudOne wrote:
Wed May 22, 2019 9:29 pm
in the first solution I stop having internet on the rpi but I have on the devices connected
How do you expect to connect the rpi to Internet? wifi, usb cable...
Apart from that I'm trying to make an isolated ap but without success, because I realised that all the clients connected to the network are been showed. The idea is to send information like ip, mac to a web server, I only want to send the information of known devices connected to that isolated ap not all the others.
You came asking for a network setup...
What/where is this web server? What are you trying to achieve?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Networking and servers”