DHCP reservation on multiple subnets? I think its possible

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


Joined: 24 Jul 2021
Posts: 117

PostPosted: Fri May 09, 2025 22:58    Post subject: DHCP reservation on multiple subnets? I think its possible Reply with quote
currently i have several reservations on dhcp using the format

Code:
dhcp-host=BB:BB:1D:57:B8:BB,JoNS23,192.168.0.20,1440m


in the dnsmasq additional options.

What I am trying to do is assign a diffrent ip based on subnet as I have several different segments on my network.

So if I am logged onto Wap 1 the subnet is 192.168.0.20 and wap2 is 192.168.2.20

right now I am doing several subnets with their own dhcp servers but ultimately gonna likely change to a primary that gives them out correctly.

So is there a way to have the MAC address do subnet 1 for Wap 1 and subnet 2 for wap 2 on the dhcp list? I know there is a way to set known and unknown, but playing around with it I was not able to find a way to accomplish this.

Or is this all a bad idea? right now I have the reservations on the individual subnet routers so if it goes to router one it gets 0.20 and if it goes to router 2 it gets 1.20...
Sponsor
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2150
Location: WV, USA

PostPosted: Sat May 10, 2025 3:01    Post subject: Reply with quote
Yes, you can do this. Just create all your dhcp servers on one router and edit the dhcp additional options for each device regardless of subnet. It works. I am set up like this and it works well. Here's an example:
Code:
dhcp-host=xx:xx:xx:xx:xx:xx,DafangCamera,192.168.254.120,infinite
dhcp-host=xx:xx:xx:xx:xx:xx,Yeelight-RtLamp,10.1.0.202,infinite
dhcp-host=xx:xx:xx:xx:xx:xx,Roku-55LRoom,10.2.0.51,infinite



Selection_009.png
 Description:
 Filesize:  19.74 KB
 Viewed:  1870689 Time(s)

Selection_009.png



_________________
- Linksys EA8500: I-Gateway, WAP/VAP 5ghz only. Features: VLANs, Samba, WG, Entware - r60xxx
- Linksys EA8500: 802.11s Secondary w/VLAN Trunk over 5ghz - r60xxx
- Linksys MX4300: 802.11s Primary w/VLAN Trunk over 5ghz. 2.4ghz WAP/VAP only - r60xxx
- Linksys MX4300: (WAP/VAP (7)) Multiple VLANs over single trunk port. Entware/Samba r60xxx
- Linksys MR7350: WDS Station for extended Ethernet r60xxx
- Linksys MR7500, MX8500: None in production. Just testing. r60xxx
- OSes: Fedora 40, 10 RPis (2,3,4,5), 23 ESP8266s: Straight from Amiga to Linux in '95, never having owned a Windows PC.
- Forum member #248
Per Yngve Berg
DD-WRT Guru


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

PostPosted: Sat May 10, 2025 8:41    Post subject: Reply with quote
Does the Router have an Interface to the sub-net where 192.168.0.20 is located?

If not, you must have a DHCP Forwarder set up.
sanjonny
DD-WRT User


Joined: 24 Jul 2021
Posts: 117

PostPosted: Tue May 13, 2025 22:57    Post subject: Reply with quote
lexridge wrote:
Yes, you can do this. Just create all your dhcp servers on one router and edit the dhcp additional options for each device regardless of subnet. It works. I am set up like this and it works well. Here's an example:
Code:
dhcp-host=xx:xx:xx:xx:xx:xx,DafangCamera,192.168.254.120,infinite
dhcp-host=xx:xx:xx:xx:xx:xx,Yeelight-RtLamp,10.1.0.202,infinite
dhcp-host=xx:xx:xx:xx:xx:xx,Roku-55LRoom,10.2.0.51,infinite


Thanks Lex, I had not gotten to this part yet but this did let me know how I can setup the bridges and such and probably how I will end up setting up two of the routes I have been wondering about but I want to see if its possible to have say the roku be 10.2.0.51 if its on the media WAP but 10.2.0.51 if I happen to log it in via the IOT network using your example or 192.168.0.20 vs 192.168.1.20 in my example

Why would I want that? I know, most likely long term I wouldnt but its one of those I got into thinking about this and tinkering and was mostly thinking about say a laptop which is currently assigned by a dhcp server depending on which wap it goes to....all of which might be eliminated as I convert my network, but if I did want it to be assigned this different subnet number, could i and how would I? I think in the end I will end up mirroring your setup

Also Berg makes a great point, I will prob need to do dhcp forwarding if I do this this way.
sanjonny
DD-WRT User


Joined: 24 Jul 2021
Posts: 117

PostPosted: Tue May 13, 2025 23:03    Post subject: Reply with quote
Per Yngve Berg wrote:
Does the Router have an Interface to the sub-net where 192.168.0.20 is located?

If not, you must have a DHCP Forwarder set up.


As currently designed, each sub has its own dhcp server as per the example here...

I am likely gonna change the whole way that works so it all goes to a main dhcp server and maybe eliminate some of the subroutes, but again, if I didnt, how could I make this work...so currently yes there is an interface with a static route that I would probably have to set up a forwarder...as it stands...but can it give out the separate IPs via which WAP/subnet I am on?
sanjonny
DD-WRT User


Joined: 24 Jul 2021
Posts: 117

PostPosted: Tue May 27, 2025 12:31    Post subject: Reply with quote
So my current use case is trying to have the different ip based on network because I want to be able to access the devices back for lan remote control and such.

I have say a firetv device that i have in use for local access say 192.168.2.22, I have setup a separate SSID on the same WAP to have use my VPN so I appear to be in london and currently it comes out at 192.168.6.22 because that routes thru the subnet of the VAP. I havnt been able to figure out how to have it assign the different ip via subnet with just the one dhcp server to use the mac id and be the correct version. I need the same ip so I can use my remote control app on the device when it is on the london setup, but dont know how to set this up in the proper dhcp additional options. Its very similar to the example lex has provided, but i cannot get the syntax right to have the mac choose based on subnet so far.

How it is currently done is the the WAP assignes a different subnet and locally has the dhcp reservation, but I am trying to instead have one dhcp server that can handle the use case (or multiple and forwarding, whichever way skins the cat :} to accomplish what I am doing.

Code:
#how to choose
#if on regular WAP
dhcp-host=xx:xx:xx:xx:xx:xx,DafangCamera,192.168.2.120,infinite
#if on london vpn via the VAP (same WAP but different subnet) on 192.168.6.0/24, so it will use the VPN
dhcp-host=xx:xx:xx:xx:xx:xx,DafangCamera2,192.168.6.120,infinite

I will post later some examples I have tried that dont seem to work but in essense looking for
sanjonny
DD-WRT User


Joined: 24 Jul 2021
Posts: 117

PostPosted: Wed Jun 11, 2025 11:01    Post subject: Reply with quote
So I have main router setup and everything works fine including a bunch of other stuff i hve hidden or reset and have not applied. Router A works fine and has a WAP that gets the dhcp leases just fine on the bridged interface. Problem is when we add router B,,it also will get the regular bridged on its wap.. which I am trying to have be the same for roaming purpose.

Lets call the routers router 5 and 7 and the WAP jonny1 and the vap jonny3


Main router 5.....
But then I am trying to have a wap....jonny1 added to each router to allow a device to roam on the bridged wap. so login to jonny1 just works on either router.

secondary router 7
this router connected via switch to router 5 and has a wap running jonny1 that is roaming with the jonny 1 on router 5. All works well and they can all get a ip assignment via the dhcp.

The second channel I want on both routers is for the VPN so on both run a VAP, unbridged...britainjon lets call it. SO I set a vap on the primary and set an multi dhcp server at 192,168.2.0/24 for my roaming VAP on router 1 and that will get the assignment oaky.
The problem i have is router 2 vap, I cannot get the call for the dhcp back to the router one dhcp pool. I can put a mult server on the router 2 and give it an address, but there might be collisions. What I think I need is to bridge the vaps to pull from the one pool, but everything I have tried has not worked..
If I try setting mult dchp for the wireless access on both, they will both work, but wont be sharing the same pool, because they are not bridged.
I have tried to bridge them by creating a bridge and bridging it to lan 1.1 and wan, but that doesnt seem to work, and other variations.

Note that when doing the same thing with vlans, it all works fine, but Im trying to set it up without vlans for obvious reasons. It seems to me I should not have to do anything, just like it being on a switch, it should just work, but I guess beause it isnt bridged, the second router signal cannot pull the dhcp address without intervention...here is the setup so far

Too make it easy...WAP jonny1 should is linked to the router via wire to the wan port and is gets its dhcp just fine from the dhcp server.

Router 2 is bridged and has one WAP also bridged ssid jonny1 that gets its infor from jonny



Screenshot_20250611_033212_Chrome.jpg
 Description:
 Filesize:  157.54 KB
 Viewed:  1870304 Time(s)

Screenshot_20250611_033212_Chrome.jpg



Screenshot_20250611_033233_Chrome.jpg
 Description:
 Filesize:  152.77 KB
 Viewed:  1870304 Time(s)

Screenshot_20250611_033233_Chrome.jpg


sanjonny
DD-WRT User


Joined: 24 Jul 2021
Posts: 117

PostPosted: Fri Jun 13, 2025 23:43    Post subject: Reply with quote
Well something I did locked up when posting so it didnt get all my screen shots up and I havent been able to get back on to follow up until now.

I have read all the guides, but cannot figure out what I am missing. If I bridge from another router, how do I get that bridge reflected in the primary router? Thats what I think is going wrong, because if I do anything with multiple dhcp servers, it works on the primary but cant get route on the secondary. I have completely reconfigured everything over the last few weeks but cant turn it on because I cant get the dhcp solved so any help would be greatly appreciated. Or tell me what I am doing wrong.
sanjonny
DD-WRT User


Joined: 24 Jul 2021
Posts: 117

PostPosted: Fri Jun 13, 2025 23:59    Post subject: Reply with quote
router one. pay attention to jonny2 and jonny vap 1...this all works fine. sorry for some reason it seems i hate to do separate messages..attached is dhcp server and wireless and VAP settings


Screenshot_20250613_165705_Chrome.jpg
 Description:
 Filesize:  139.25 KB
 Viewed:  1870266 Time(s)

Screenshot_20250613_165705_Chrome.jpg



Screenshot_20250613_165301_Chrome.jpg
 Description:
 Filesize:  311.34 KB
 Viewed:  1870266 Time(s)

Screenshot_20250613_165301_Chrome.jpg


sanjonny
DD-WRT User


Joined: 24 Jul 2021
Posts: 117

PostPosted: Sat Jun 14, 2025 0:05    Post subject: Reply with quote
router 2...again, only the VAP, jonny1 is what I am trying to get to get dhcp from 1st router...so I have not set a dhcp server here, but I obvously want it on the .2.0/24 subnet

Pretty sure I have tried it with net and ap isolation on and off but any advise is greatly appreciated. I am trying to be able to roam on this segment bewteen the two routers for the iot devices that yes do move...some of them anyway



Screenshot_20250613_170027_Chrome.jpg
 Description:
 Filesize:  149.38 KB
 Viewed:  1870265 Time(s)

Screenshot_20250613_170027_Chrome.jpg


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