Alternate DHCP Gateway

Discussion in 'Tomato Firmware' started by dylanjustice, Dec 18, 2009.

  1. dylanjustice

    dylanjustice Addicted to LI Member

    I have two internet connections, one with cable, one with DSL. The cable is intended for data, and the DSL (which has lower throughput, but also much lower jitter), for VOIP desktop phones. I want to keep them both on the same LAN, so I can set the DSL up as a failover internet connection.

    Right now, however, I just want to have all of my VOIP phones use the DSL connection as their gateway. So I need to set up DHCP so that for a subset of MAC addresses, it specifies a different gateway.

    Can anyone suggest some search terms, or point me in the direction of some appropriate documentation?
  2. mstombs

    mstombs Network Guru Member

  3. acollado

    acollado LI Guru Member

    You'll have to use dhcp-option commands under DNSmasq.

    Something like:

    #To map certain a MAC address prefix to a particular network ID do this:

    #Then do this to map that ID to a particular gateway (say

    #Then for the rest (the clients should prefer but use if the first is unavailable):

    Check here:

    At least that's my guess....

    Then again I realized, how are both DSL and Cable connected to the router? Do you have dual WAN ports setup? If so you might need some static routes and higher metrics setup in place of or in addition to the DHCP client commands.
  4. dylanjustice

    dylanjustice Addicted to LI Member

    Awesome info, thanks so much! Just an FYI to posterity: default route appears to be set by dhcp-option=3. dhcp-option=4 is used to specify the timeserver.
  5. dylanjustice

    dylanjustice Addicted to LI Member

    Say, as long as I've got you thinking about this... do you happen to know if any of the dnsmasq options would let me create a network-id to represent all VOIP devices, regardless of MAC? E.g., would phones report a distinct subscriber-id or DHCP option number or something that would allow me to catch *all* phones without having to key in a big list of unique MACs?
  6. acollado

    acollado LI Guru Member

    Thanks for catching that... my mistake in typing.
  7. acollado

    acollado LI Guru Member

    There is this, but I've never tried it so your mileage my vary:

    Map from a vendor-class string to a network id tag. Most DHCP
    clients provide a "vendor class" which represents, in some
    sense, the type of host. This option maps vendor classes to
    tags, so that DHCP options may be selectively delivered to dif-
    ferent classes of hosts. For example dhcp-vendorclass=print-
    ers,Hewlett-Packard JetDirect will allow options to be set only
    for HP printers like so: --dhcp-option=printers,3,
    The vendor-class string is substring matched against the vendor-
    class supplied by the client, to allow fuzzy matching.

    I did the MAC option because if you only specify the first 6 characters of the MAC you can wildcard the rest and get everything made by that maker in that group of MAC addresses.
  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