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

Command line DHCP configuration

Discussion in 'Tomato Firmware' started by wolfish, Dec 31, 2008.

  1. wolfish

    wolfish Addicted to LI Member

    Hello there,

    I'm having a dickens of a time trying to configure the DHCP address range via the cli.

    I've tried:

    -modifying the /etc/dnsmasq.conf file, but apparantly that exists only temporarily in ram

    -modifying the /etc/dnsmasq.conf file, then running a service dnsmasq restart, but the file reverts to how it was before

    -I've tried configuring with service dnsmasq --dhcp-range=192.168.1.100,192.168.1.149,255.255.255.0,1440m; but that does nothing

    There has to be a way to configure this. Am I messing with the right service? What am i missing?

    Thanks in advance!
     
  2. fyellin

    fyellin LI Guru Member

    You need to change the variables nvram variables dhcp_start and dhcp_num if you want your change to survive a reboot. For example, in my setup which is 192.168.100.100-126, dhcp_start is "100" and dhcp_num is "27".

    After changing the variables, you'll need to restart dhcp if you want the change to take effect immediately.
     
  3. wolfish

    wolfish Addicted to LI Member

    Excellent, thanks for the reply. I'll give that a try.
     
  4. wolfish

    wolfish Addicted to LI Member

    Worked just fine, thanks!

    # nvram set dhcp_start=50
    # nvram set dhcp_num=21
    # nvram commit
    Commit... done.
    # rc restart
     
  5. Clovenhoof

    Clovenhoof Addicted to LI Member

    I'm having problems with DHCP option 3 - default gateway.

    - nvram variable lan_gateway contains the value I want.
    - before I also tried to edit dnsmasq.conf and restart dnsmasq service, but it reverted to the original

    Everything seems OK, but clients still getting the wrong "default gateway" setting, not the one is set in the nvram.

    When I change another option (lease time) through nvram, and commit the change, clients take the new lease setting when renew their IP.
    dnsmasq version 2.45, tomato verision v1.21.8005

    Any ideas are appreciated in advance!
     
  6. jan.n

    jan.n Addicted to LI Member

    Any particular reason for not updating to 1.25?
     
  7. Clovenhoof

    Clovenhoof Addicted to LI Member

    Any particular reason it doesn't work under 1.21? :)
    The reason is that otherwise it works perfectly for me, so I wouldn't like to touch it if it is not necessary.
     
  8. jan.n

    jan.n Addicted to LI Member

    Just today I read that 1.21 was not really stable and quickly updated to 1.22. Did not go through the changelogs but I expect security fixes as (not only) busybox had some vulnerabilities...
     
  9. Clovenhoof

    Clovenhoof Addicted to LI Member

    The result is the same after upgrading to Tomato 1.25 and using its dnsmasq...
     

Share This Page