DD-WRT DHCP - Specify other gateway?

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
jeg0522
DD-WRT Novice


Joined: 29 Dec 2008
Posts: 22

PostPosted: Thu Jan 08, 2009 18:55    Post subject: DD-WRT DHCP - Specify other gateway? Reply with quote
I'm currently using DD-WRT V24 VPN on a Linksys WRT54GL. The router's IP address is 192.168.0.200. How do I go about having the router provide DHCP leases that specify a gateway of 192.168.0.1 (the domain controller) rather than using the router's own address of 192.168.0.200 as the gateway?
Sponsor
soulstace
DD-WRT Guru


Joined: 04 Aug 2007
Posts: 6427

PostPosted: Thu Jan 08, 2009 18:57    Post subject: Reply with quote
http://www.dd-wrt.com/wiki/index.php/DNSMasq_as_DHCP_server#Assign_an_alternate_Gateway
jeg0522
DD-WRT Novice


Joined: 29 Dec 2008
Posts: 22

PostPosted: Thu Jan 08, 2009 19:27    Post subject: Reply with quote
I did the following:

Added dhcp-option=3,192.168.0.1 to "Additional DHCPd Options".
Applied changes.
Deleted my laptop's current DHCP lease. A new lease was issued immediately.

Default Gateway still shows up as 192.168.0.200. I also tried the same in the "Additional DNSMasq Options" with no luck. Any recommendations?
soulstace
DD-WRT Guru


Joined: 04 Aug 2007
Posts: 6427

PostPosted: Thu Jan 08, 2009 20:37    Post subject: Reply with quote
Did you renew the laptop's DHCP lease from the laptop itself?

This is to be used with DNSMasq. If you are using DHCPd, it might not work.
jeg0522
DD-WRT Novice


Joined: 29 Dec 2008
Posts: 22

PostPosted: Thu Jan 08, 2009 21:02    Post subject: Reply with quote
Yep, the laptop is a windows-based machine. ipconfig /release, ipconfig /renew results in the same gateway of 192.168.0.200.

Would I be better off disabling DHCPd and writing a dnsmasq.conf? That seems more daunting, of course, but it might be a more foolproof method?

I'll take a look at the DNSMasq settings again. If you know of anything else to check, please let me know and thanks so much.
jeg0522
DD-WRT Novice


Joined: 29 Dec 2008
Posts: 22

PostPosted: Thu Jan 08, 2009 21:12    Post subject: Reply with quote
I found the problem. There's this little checkbox in Setup > Basic, "Use DNSMasq for DHCP". I set up the dhcp-option=3,x.x.x.x parameter in the "Additional Options for DNSMasq", checked the "Use DNSMasq for DHCP" setting and boom. It's off to the races.

Thanks for pointing me in the right direction.
fboender
DD-WRT Novice


Joined: 09 Aug 2012
Posts: 2

PostPosted: Thu Aug 09, 2012 11:08    Post subject: Reply with quote
No matter what I tried, I could not get this to work on DD-WRT v24-sp2 mini. The alternative syntax, however, did work.

In the "Additional DNSMasq Options" input box, put:

Code:
dhcp-option=option:router,192.168.1.10



(Note that there is a *return/enter* at the end of that line. I don't think it matters, but for the sake of completeness, I thought I'd mention it).
YoyoJones
DD-WRT Novice


Joined: 18 May 2015
Posts: 2

PostPosted: Sun Jun 07, 2015 12:33    Post subject: Reply with quote
Just in case I ever need to find the same solution I will cross-post my solution here, as this post is the highest ranking result on Google.

My solution was a little different for my router TP-Link C9 - running SVN revision 26866. Here are the details - http://www.dd-wrt.com/phpBB2/viewtopic.php?p=966744#966744

Admin - please delete as you see fit.
malbers15
DD-WRT User


Joined: 28 Jan 2012
Posts: 80

PostPosted: Tue May 15, 2018 18:20    Post subject: Reply with quote
There appears to be a different way of doing things for alternate gateway assignment on newer builds:
https://www.dd-wrt.com/phpBB2/viewtopic.php?p=1128534#1128534


Either:
dhcp-option=br0,3,w.x.y.z
or
dhcp-option=br0,option:router,w.x.y.z


I am assuming br0 is the lan interface. I think the wiki needs to be updated or a bug logged because this no longer appears correct:
dhcp-option=lan,3,w.x.y.z
from:
https://www.dd-wrt.com/wiki/index.php/DNSMasq_as_DHCP_server#Assign_an_alternate_Gateway
malbers15
DD-WRT User


Joined: 28 Jan 2012
Posts: 80

PostPosted: Tue May 29, 2018 19:20    Post subject: Reply with quote
Wiki has been updated, please see the following post:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1128535#1128535
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware 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 can attach files in this forum
You can download files in this forum