DHCP, static DNS, DNSmask and static leases

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
boris03
DD-WRT User


Joined: 17 Jan 2019
Posts: 148

PostPosted: Fri Feb 07, 2020 16:22    Post subject: DHCP, static DNS, DNSmask and static leases Reply with quote
I am on the way to use the DD-WRT DHCP Server instead DHCP currently served by my Internet router.

1. I can see the settings for this on the main Setup page.
Confusing is the flag for use DNSmask for DNS and additionally under Service>Service I can see a DNSmask flag as well. What is this - is it for using DNSmask for DHCP instead the standard DHCP?

2. Concerning the static DNS entries, when I use static DNS entries under DHCP settings will my devices use these DNS entries or will they use the DNS from the primary router, which I unfortunately cannot change (stupid router)

3. And one last thing. Today I am using fixed IPs set directly in some devices (e.g. Tasmota switches).
With DD-WRT I could use static leases instead.
What is the preferrable method?
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Sun Feb 09, 2020 11:38    Post subject: Re: DHCP, static DNS, DNSmask and static leases Reply with quote
boris03 wrote:
I am on the way to use the DD-WRT DHCP Server instead DHCP currently served by my Internet router.

1. I can see the settings for this on the main Setup page.
Confusing is the flag for use DNSmask for DNS and additionally under Service>Service I can see a DNSmask flag as well. What is this - is it for using DNSmask for DHCP instead the standard DHCP?

2. Concerning the static DNS entries, when I use static DNS entries under DHCP settings will my devices use these DNS entries or will they use the DNS from the primary router, which I unfortunately cannot change (stupid router)

3. And one last thing. Today I am using fixed IPs set directly in some devices (e.g. Tasmota switches).
With DD-WRT I could use static leases instead.
What is the preferrable method?


DNSMasq is in newer builds always used for DHCP.

You should disable the DHCP server on your primary router if you have done that then it will not hand out static leases. You can not have two DHCP servers in one subnet.

Static leases give you a clear view of what static addresses are in use so you have one central point of administration, on larger networks it is easy to loose track about what leases are in use if you use static IP addresses on the client itself, but it should both work.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
boris03
DD-WRT User


Joined: 17 Jan 2019
Posts: 148

PostPosted: Thu Feb 13, 2020 17:05    Post subject: Reply with quote
Edit Solved now.
This is strange you just need to have only one line in the GUI open when 2 lines (see attachment) are open you cannot enter and save - that´s strange!!

Thanks a lot,

OK, DHCP server is up and running on DD-WRT and deactivated on my primary router.

Now I am trying to set some static leases but I cannot get this entered correctly
I do enter a valid MAC of a device I can see connected within the DHCP range e.g. 192.168.2.124
I do enter any host name e.g. test
I do enter a valid and free IP 192.168.2.20
and SAVE.

What happens now is that the MAC remains in its field rest of the fields are empty - what is that, any idea? Sad

File with settings added
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2029

PostPosted: Thu Feb 13, 2020 17:46    Post subject: Reply with quote
Not sure what is causing your problems
but there are different/easier ways.
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316051&highlight=static+leases

https://forum.dd-wrt.com/forum/viewtopic.php?t=314757

This method makes it simpler to reconfig after a reset also.
boris03
DD-WRT User


Joined: 17 Jan 2019
Posts: 148

PostPosted: Thu Feb 20, 2020 11:22    Post subject: Reply with quote
OK,could save all my static leases in the GUI, all OK and working generally.
One thing is surprising me I am not getting a full list of all the clients in DHCP neither in active clients nor in LAN or WIFI overview.
Can I get a full list somewhere in DD-WRT?

I do have the ISP router "before" the DD-WRT router and two further routers "behind" DD-WRT.
All devices connecing are getting the IP from DD-WRT but I can´t see these listed in DD-WRT, that isn´t OK, right?

I have tried to set some Tasmota devices gateway pointing to DD-WRT insted the ISP, but tis doesn´t change a thing besides the DNS is getting taken from the DD-WRT router now. BTW is it recommended to change the gateway for the clients?

Is this comment from eibgrad a kind of a solution?
How can I add such in the GUI, just a further entry there?

"unless I add a dhcp-host directive that associates a name to its MAC address (NOT as a static lease!), those names never appears in the Active Client list"

copied from this comment:
"dhcp-host directives usually define static leases for DHCP. Those static leases should be *outside* the scope of the DHCP server's IP pool (dhcp-range option). So unless NOTHING is using the DHCP pool, then I suppose all your devices should be listed in Active Clients. But at least for me, I have lots of DHCP clients from the pool, and unless I add a dhcp-host directive that associates a name to its MAC address (NOT as a static lease!), those names never appears in the Active Client list.

IOW, we have two different types of dhcp-host directives here. Ones that define static leases, and others that just associate names to MAC addresses. A subtle but important difference."
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2029

PostPosted: Fri Feb 21, 2020 0:53    Post subject: Reply with quote
boris03 wrote:
OK,could save all my static leases in the GUI, all OK and working generally.
One thing is surprising me I am not getting a full list of all the clients in DHCP neither in active clients nor in LAN or WIFI overview.
Can I get a full list somewhere in DD-WRT?

I believe from command line
cat /tmp/dnsmasq.conf
will show all configured devices and
cat /tmp/dnsmasq.leases
will show connected devices if that is what you are looking for.
boris03
DD-WRT User


Joined: 17 Jan 2019
Posts: 148

PostPosted: Fri Feb 21, 2020 9:34    Post subject: Reply with quote
OK Thanks.
I will try when back home again. Currently I cannot access my DD-WRT router via OpenVPN connection (don´t ask me why cause I think this was working before, need to ask egc:-))
But these commands you are mentioning will display the table content in the command window, it won´t change the standard GUI output, right?

And will it display the devices connected via the other routers as well? e.g. 192.168.2.11 is a device connected via another router, DHCP address is from DD-WRT but it isn´t displayed on the DD-WRT GUI, this is what is stupid and I am looking for a solution.
Even FING isn´t displaying all connected devices and IPs when connected on the DD-WRT router.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6410
Location: UK, London, just across the river..

PostPosted: Fri Feb 21, 2020 11:06    Post subject: Reply with quote
boris03 do we know anything about your router model / current build running....yet ??
first adding static leases via GUI works well havent seen a build with your complains...
do keep in mind MAC addresses are in this format AA:BB:CC:DD:EE:FF
than the name must not contain special symbols or space
than must be the IP, usually in the router range 192.128.1.100 for example
do you run the other routers in WAP mode or NAT mode....
In WAP mode all devices will get IP from the same DHCP
while in NAT mode you'd need a rules to permit and get those names...

finally, there ware some old builds with buggy GUI where LAN and WIFI statistics ware broken ....that's why, its important to know router model/current build number....

by any chance are you on 40559 ??

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
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