Setting different DNS servers for a range of DHCP clients

Discussion in 'Tomato Firmware' started by nbayer, Jul 27, 2012.

  1. nbayer

    nbayer Serious Server Member

    Ok, I know this is a linksys board but this is tomato related and I'm hoping someone here can help me out. I'm running tomato usb on an asus n-16. This is posted over at the tomato usb boards as well but I think these are more active. Here is original post:

    What I'm trying to to is assign all non static DHCP clients to opendns servers, they have some filtering enabled and the point is to set up a first line of defense for kids in my house. The computers for adults have static DHCP leases and I want them to use the normal DNS servers from my ISP. From other posts I've read this should be possible using the custom dnsmasq config section. So here is my setup:

    DHCP range in the GUI is -, this works fine
    I have about a half dozen clients set up with static DHCP leases in the area, this works fine
    This is what I have in my dnsmasq custom config:

    dhcp-option=net:red, 6,,

    I have also tried "dhcp-range=set:red,," and a few other variations and that didn't work either.

    the dhcp-option line works fine, those are the opendns servers and if I set a computer to the tag red using mac address then it will get those servers when it renews it's lease, for example if I add a specific mac address like this:

    dhcp-mac=red, XX:XX:XX:XX:XX:XX

    So the question is how do I assign the range of - to the tag red? This seems to work for other people but I'm not sure if they are using a newer version of dnsmasq or something.

    I'm running this build of tomato on an asus n-16:
    Tomato Firmware v1.28.9054 MIPSR2-beta K26 USB vpn3.6
    PBandJ likes this.
  2. i would also like to know how to do this
    At the moment I'm using smartDNS to get around the geographical limitations on video streaming to my country, however my browsing speed seems considerably slowed down.

    Id like to set the ip for my TV to use the SmartDNS, and every other device to use my ISP DNS. Is this possible with tomato?
  3. koitsu

    koitsu Network Guru Member

    Have you tried replacing the word net: with tag: instead? The dnsmasq documentation does state that net: is legacy but should behave the same as tag:, but whether or not that's true is unknown.

    Also, does the behaviour change if you remove the whitespace between your commas? The documentation does not state that whitespace is permitted there; I'm just trying to rule out parser errors/oddities which could explain the situation.

    Finally, have you tried using dhcp-option-force instead of dhcp-option? Just an idea, although I don't think it's necessary in this case (because the requesting DHCP client should almost certainly be asking for the DNS server list (option number 6)).

    Otherwise based on your syntax/etc., I would classify this as a bug. This syntax SHOULD work for you, and if it doesn't, you may need to run dnsmasq in some kind of debug/verbose mode to see what all is going on:

    Finally, I would advise trying one of the later/newer Toastman builds if you can. dnsmasq has been updated in one of the more recent builds (which build has the upgrade is listed in the changelog).

    If you can't get it to work, I would strongly recommend you engage the author of dnsmasq (see bottom of page) and bring him into this thread or Email him for advice/help. Just because Tomato/TomatoUSB uses dnsmasq doesn't necessarily make this a TomatoUSB problem, if you understand what I mean.

    P.S. -- The documentation doesn't indicate dhcp-mac=<tagname>,<macaddr> would actually work at all. It seems you would have to use dhcp-mac=set:<tagname>,<macaddr> to set the tag; dhcp-mac has nothing in it (that I can see) which would benefit from matching a tag. So possibly this was just a typo of sorts in your post.
  4. theboyk

    theboyk Networkin' Nut Member

    Did anyone ever get this working? I just updated the version of Tomato (Shibby, Tomato Firmware 1.28.0000 MIPSR2-114 K26 USB AIO) last night in the hopes that the updates to dnsmasq would fix this issue, but no go. dhcp-range just isn't working. If I tag a machine via MAC address, it works fine, but I won't know all the MAC addresses connecting to the network, so I really need to do this via an IP range. But, nothing I do works.

    Anyone been successful with this?
  5. shadowken

    shadowken Networkin' Nut Member

    @ theboyk
    Just disable the DHCP server in Basic > Network .

    Sent from my GT-I9300 using Tapatalk
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice