What's new

Asuswrt-Merlin dnsmasq.conf.add - Help needed

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

an39511

New Around Here
I am running on ASUS RT-AC68U with Asuswrt-Merlin v384.11.2
Most of my devices are given their IP address through the router's DHCP service and given the same IP which was entered on the DHCP Server page.

I have one device which can only get it's IP address assigned via a DHCP server because there is no manual configuration option. Even though this device in on my local LAN I want to assign it to use a different gateway.

I have created the/jffs/configs/dnsmasq.conf.add and added to following;
dhcp-option=lan1,3,192.168.1.3
dhcp-range=lan1,192.168.1.6,192.168.1.6

After restarting dnsmasq server it adds the above two lines to the end of /etc/dnsmasq.conf

This setting seems to work. Devices that are plugged into the LAN get their IP and the gateway to the router Asus router as normal. The special device gets its IP and assigned to a secondary gateway that is connected to the local LAN. All great.

The problem is this; If I connect a device via WiFi and I haven't preassigned it a IP address, the DHCP server assigns that device with an address designated in the pool, BUT, instead of assigning it to use the router's gateway, it is assigning the alternate gateway which is not what I want. I don't know why its doing this for wireless devices only. Physical lan connections work normally. Is there something I am missing in the configuration?

Screenshot-2019-06-02-13-25-25.png
 
I’m not 100% confident in my advice here, but I think you need to add a dhcp-host line with a set:lan1 tag for the special device. I’m not sure if you’re just relying on luck that the special device is being assigned .6 and the unique gateway without an explicit dhcp-host MAC mapping.

Still thinking about the main question you asked... Magic 8 Ball says ask again later :(
 
I’m not 100% confident in my advice here, but I think you need to add a dhcp-host line with a set:lan1 tag for the special device. I’m not sure if you’re just relying on luck that the special device is being assigned .6 and the unique gateway without an explicit dhcp-host MAC mapping.

Still thinking about the main question you asked... Magic 8 Ball says ask again later :(

Thanks for your reply,

I cut out (censored) the part of the dnsmasq.conf that contains all dhcp-hosts info but I have numerous dhcp-host entries in that file including the one for 192.168.1.6. I didn't want to post all my device's MAC addresses.

I know just enough to be dangerous. There is just so much to know about it. I was very happy that I even got it to work in the first place. I had been running that configuration for nearly a week and didn't discover the problem until I booted up an old windows laptop that hadn't been pre-assigned in the DHCP table. Never noticed that it was using the secondary gateway until the next day when it gobbled up over a GB of cellular data, which is the second gateway.

Like I said, I know enough to get myself into trouble. I know there is a lot of routing involved, such as one for the LAN, another for WiFi, still another for VPN. But all that is way over my head but I had thought if the setup works perfectly for any wired connection, why not for WiFi? And to repeat myself, WiFi devices work as expected as long as I have pre-defined them in the DHCP table ie. dhcp-host. It only messes up when the DHCP assigns an IP from the pool of addresses.
 
I know there is a lot of routing involved, such as one for the LAN, another for WiFi,...
There isn't. The WiFi interfaces are part of the LAN (br0) unless you're using guest networks. Are you using guest networks?
 
There isn't. The WiFi interfaces are part of the LAN (br0) unless you're using guest networks. Are you using guest networks?

No guest networks. The only thing I have setup is a one OpenVPN server used for when I'm away and need local access.
 
Thanks for your reply,

I cut out (censored) the part of the dnsmasq.conf that contains all dhcp-hosts info but I have numerous dhcp-host entries in that file including the one for 192.168.1.6. I didn't want to post all my device's MAC addresses.

I know just enough to be dangerous. There is just so much to know about it. I was very happy that I even got it to work in the first place. I had been running that configuration for nearly a week and didn't discover the problem until I booted up an old windows laptop that hadn't been pre-assigned in the DHCP table. Never noticed that it was using the secondary gateway until the next day when it gobbled up over a GB of cellular data, which is the second gateway.

Like I said, I know enough to get myself into trouble. I know there is a lot of routing involved, such as one for the LAN, another for WiFi, still another for VPN. But all that is way over my head but I had thought if the setup works perfectly for any wired connection, why not for WiFi? And to repeat myself, WiFi devices work as expected as long as I have pre-defined them in the DHCP table ie. dhcp-host. It only messes up when the DHCP assigns an IP from the pool of addresses.
What if you not bother with a separate range statement and instead use a tag on a dhcp-host line? Remove the assignment from the GUI first, and replace the MAC with the real MAC.
Code:
dhcp-host=00:11:22:33:44:55,192.168.1.6,set:red
dhcp-option=tag:red,3,192.168.1.3
Is the router 192.168.1.2?
 
What if you not bother with a separate range statement and instead use a tag on a dhcp-host line? Remove the assignment from the GUI first, and replace the MAC with the real MAC.
Code:
dhcp-host=00:11:22:33:44:55,192.168.1.6,set:red
dhcp-option=tag:red,3,192.168.1.3
Is the router 192.168.1.2?

Sounds like your suggestion is a good idea. At least it seems like a cleaner way to do it. I didn't realize those extra options would work in dhcp-host.

Yes, the router is 192.168.1.2 and the other gateway is 192.168.1.3

I'll give it a try and see how it works, thanks!
 
What if you not bother with a separate range statement and instead use a tag on a dhcp-host line? Remove the assignment from the GUI first, and replace the MAC with the real MAC.
Code:
dhcp-host=00:11:22:33:44:55,192.168.1.6,set:red
dhcp-option=tag:red,3,192.168.1.3
Is the router 192.168.1.2?

Your suggestion works. Thank you very much for your help on this. Regular IP assignments now work giving out the gateway of the router as it should, both on WiFi and lan cable when there is no pre-assigned DHCP entry.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top