Results 1 to 6 of 6

Thread: problem with edited dnsmasq.conf

  1. #1

    problem with edited dnsmasq.conf

    Ok I "rtfm", I "utfs", still I can't explain the following.

    I didn't tune Olegs firmware much, cept adding a cronjob. crontab file
    is /var/spool/cron/crontabs/admin. This I added to the /usr/local/.files and saved/commited/enabled flashfs. Works like charme.

    Now I discovered that I don't like the maximum lease time of 86400secs or 24hours my PCs get, even those that have manually assigned IP adress via MAC address. So I checked the net and discovered that dnsmasq also accepts hours (e.g. 168h for a week) or minutes or the word "infinite". hey cool, sounds like what I want. So I edited dnsmasq.conf to set infinite lease time. Restarted dnsmasq, renewed my ip, it works. Great. Now how to save dnsmasq permanently? Of course the same way I did with crontab file, I thought. Added "/etc/dnsmasq.conf" to /usr/local/.files, flashfs save/commit, output says it's saved. Reboot ... WTF it's back to old setting. Strange enough ... if I manually do a "flashfs load", dnsmasq.conf is overwritten and the changes I made are there like they should be.

    So why is the crontab file loaded correctly from flashfs at boot time, and dnsmasq.conf is not, though it is in there.

  2. #2
    Join Date
    Dec 2003
    Location
    Russian Federation
    Posts
    8,356
    Use static DHCP feature.

  3. #3
    Thats what I meant with "manually assigned IP adress via MAC address" ... I have entered the MAC adresses of each PC and assigned a IP. Still I only get a lease time of 24hours. And the problem I have with that is, that when the 24hours passed, the PCs renew the IP and lose internet connection for a few seconds. But hey , I know how to solve the 24hour problem, what I really wanted to know is why is dnsmasq.conf not loaded properly from flashfs while another file is loaded fine?

    by the way .. I use your 6c-pre firmware Oleg ... could that be a bug only in this version?


    Update: I found another trick to solve the problem ... I simply did

    nvram set dhcp_lease=infinite

    After this even the webinterface shows infinite

    But still my question remains, why was the file not loaded? One idea I have is, that it is loaded, but afetrwards overwritten with settings from nvram. If so, can this be changed (so "flashfs load" is executed after the nvram settings are written to files)?
    And another question Oleg: Can you include the possibility to enter values like "24h" or "infinite" as lease time in the webinterface? I think that would make a lot of sense
    Last edited by TheEagle; 10-11-2005 at 16:14.

  4. #4
    You could also do it like this:

    First, store your modified dnsmasq.conf in /usr/local/etc
    Then, and i suppose you already have a post-boot script, add the following lines to post-boot:

    Code:
    cp /usr/local/etc/dnsmasq.conf /tmp/etc/dnsmasq.conf
    killall -9 dnsmasq
    dnsmasq
    Of course don't forget the flashfs save and flashfs commit ...

    This works for me !

    Greetz

  5. #5
    Join Date
    Dec 2003
    Location
    Russian Federation
    Posts
    8,356
    In fact /usr/local/etc/dnsmasq.conf is appended to the /etc/dnsmasq.conf, when the former is get automatically generated on boot and overwrites existing file (this is not a bug, this is by design).

  6. #6
    Quote Originally Posted by Oleg
    In fact /usr/local/etc/dnsmasq.conf is appended to the /etc/dnsmasq.conf, when the former is get automatically generated on boot and overwrites existing file (this is not a bug, this is by design).
    Thats what I wanted to know, thx oleg. Still it would be a really good idea, to have the ability to enter more values in the lease time field. Maybe I'll try to do that myself when I have the time. If I have success, I'll let you know.

    oh and cu112, thx for the info, too. But in the end I like my nvram solution a lil better, since it's only one command that I have to do once after flashing the firmware.

Similar Threads

  1. dnsmasq as authoritative nameserver
    By ghaspias in forum WL-500g Q&A
    Replies: 0
    Last Post: 03-11-2005, 01:05
  2. dnsmasq acting as DNS server?
    By frank_c_bauer in forum WL-500g Q&A
    Replies: 5
    Last Post: 03-11-2005, 00:37
  3. 1.7.5.6-2 /init/rc.dnsmasq
    By mdounin in forum WL-500g Custom Development
    Replies: 1
    Last Post: 02-05-2004, 19:54
  4. Dnsmasq, could this be a problem/security risk ?
    By peteredhair in forum WL-500g Custom Development
    Replies: 2
    Last Post: 13-04-2004, 22:42
  5. New firmware - dnsmasq
    By Oleg in forum WL-500g Custom Development
    Replies: 6
    Last Post: 20-03-2004, 10:23

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •