No IP from static lease after adding a line dnsmasq [solved]

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
ray_308
DD-WRT Novice


Joined: 09 Jan 2020
Posts: 17
Location: Heemskerk, The Netherlands

PostPosted: Thu Jan 16, 2020 19:53    Post subject: No IP from static lease after adding a line dnsmasq [solved] Reply with quote
Router: WRT3200ACM
Firmware: SS-WRT v3.0-r41954

Setup -> Basic Setup -> Network Setup
Only 26 clients can connect, the other clients are served through static lease.

Static and dhcp leases are in the same network (10.0.1.x. 255.255.255.0) static from 1 to 174, dhcp pool from 175 to 200.

Static lease under Service -> Service is working fine.
When the client is unknown, it gets an IP from the dhcp pool.
So far so good.

When I make a change tot the “additional Dnsmasq Options” something funny is happening;

I’m adding the following rules to additional Dnsmasq Options;

dhcp-host=XX:XX:XX:XX:XX:XX,set:cloudflareDNS
dhcp-option=6,10.0.1.174
dhcp-option=tag:cloudflareDNS,option:dns-server,1.1.1.1,1.0.0.1

So al clients from static and dhcp pool get the DNS address 10.0.1.174, only one device with the correct MAC address gets the DNS address 1.1.1.1 and 1.0.0.1.

The client with the corresponding MAC adres is getting the right DNS settings, BUT is getting an IP address from the dhcp pool and NOT from the static lease list.

When I add an # in front of the dhcp-host line, the client is getting an IP from the static lease and off course not the correct DNS settings.

I’m clueless what I’m doing wrong, any ideas?


Last edited by ray_308 on Fri Jan 17, 2020 20:50; edited 1 time in total
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6870
Location: Romerike, Norway

PostPosted: Thu Jan 16, 2020 20:15    Post subject: Reply with quote
You have to set the static IP address on the dhcp-host

--dhcp-host=[<hwaddr>][,id:<client_id>|*][,set:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]
Specify per host parameters for the DHCP server. This allows a machine with a particular hardware address to be always allocated the same hostname, IP address and lease time. A hostname specified like this overrides any supplied by the DHCP client on the machine. It is also allowable to omit the hardware address and include the hostname, in which case the IP address and lease times will apply to any machine claiming that name. For example --dhcp-host=00:20:e0:3b:13:af,wap,infinite tells dnsmasq to give the machine with hardware address 00:20:e0:3b:13:af the name wap, and an infinite DHCP lease. --dhcp-host=lap,192.168.0.199 tells dnsmasq to always allocate the machine lap the IP address 192.168.0.199.
ray_308
DD-WRT Novice


Joined: 09 Jan 2020
Posts: 17
Location: Heemskerk, The Netherlands

PostPosted: Thu Jan 16, 2020 21:11    Post subject: Reply with quote
I removed the static lease from the list at services -> services and add the client to the dhcp-host like this;

dhcp-host=DC:56:E7:89:xx:xx,notebook-raymond,infinite
dhcp-host=notebook-raymond,10.0.1.120
dhcp-host=DC:56:E7:89:xx:xx,set:cloudflareDNS
dhcp-option=6,10.0.1.174
dhcp-option=tag:cloudflareDNS,option:dns-server,1.1.1.1,1.0.0.1

The client whit MAC DC:56:E7:89:xx:xx is getting the right dns settings, but still an IP address from the dhcp pool instead of the dhcp-host option (10.0.1.120).

I think that I'm doing something wrong, but can't find out what..

_________________
I'm not a complete idiot, some parts are missing.
ray_308
DD-WRT Novice


Joined: 09 Jan 2020
Posts: 17
Location: Heemskerk, The Netherlands

PostPosted: Fri Jan 17, 2020 20:49    Post subject: Reply with quote
solved

see https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=322797&highlight=

_________________
I'm not a complete idiot, some parts are missing.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum