1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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 Addicted to LI 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:
    dhcp-mac=IPphones,aa:bb:cc:*.*.*

    #Then do this to map that ID to a particular gateway (say 192.168.1.2):
    dhcp-option=IPphones,4,192.168.1.2

    #Then for the rest (the clients should prefer 192.168.1.1 but use 192.168.1.2 if the first is unavailable):
    dhcp-option=4,192.168.1.1,192.168.1.2

    Check here:
    http://man.cx/DNSMASQ(8)
    http://www.networksorcery.com/enp/protocol/bootp/options.htm

    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 Addicted to LI Member

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

    acollado Addicted to LI Member

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

    dhcp-vendorclass=<network-id>,<vendor-class>
    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,192.168.4.4
    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.
     

Share This Page