lixuewei / rt-n56u

Automatically exported from code.google.com/p/rt-n56u
0 stars 0 forks source link

How to overwriite dnsmasq,conf default cache-size ? #1205

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Edit /etc/dnsmasq.conf, change cache-size value to 2000 using winscp.
Reboot router and value defaulted to 1000.

What is the expected output? What do you see instead?
I expect to see cache-size=2000

What version of the product are you using? On what operating system?
FW: 3.0.3.8-080

Original issue reported on code.google.com by leandro.ong@gmail.com on 4 Apr 2014 at 2:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
either rebuild the firmware with the value you need or make sed replace the 
value on boot by creating a startup script:

sed -i 's/cache-size=1000/cache-size=2000/g' /etc/dnsmasq.conf
killall dnsmasq
sleep 2 #will probably work without this
/usr/sbin/dnsmasq

I never tested the above though so be careful and be prepared to assign static 
ip to your machine to accaess the reouter and recover/adjust the script. 

Original comment by moonman...@gmail.com on 4 Apr 2014 at 4:52

GoogleCodeExporter commented 9 years ago
Also try the custom dnsmasq.conf under Advanced Setting -> LAN -> DHCP Server 
-> scroll down to "Custom Configuration File "dnsmasq.conf"", but I think it 
only allows adding parameters, but not changing them. Don't know for sure and 
don't feel like digging through the code ;)

Original comment by moonman...@gmail.com on 4 Apr 2014 at 5:01

GoogleCodeExporter commented 9 years ago
1. 2nd method fail due to no duplicate allowed.
2. 1st method worked.

Thanks 

Original comment by leandro.ong@gmail.com on 4 Apr 2014 at 6:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Method 1 is not a perm solution. If you have watchdog setup or when you make 
changes to the DHCP sever settings via WebUI, it will revert back to the 
hardcoded 1024 value. Looks like only rebuilding firmware is a perm solution - 
or have this parameter moved to the custom dnsmasq.conf file in the next build?

Original comment by bfg1...@gmail.com on 14 Jan 2015 at 12:31

GoogleCodeExporter commented 9 years ago
You can add sed script to /etc/storage/post_wan_script.sh (up action), or 
rebuild the firmware without cache-size option and move it to custom config. Or 
sed expression can be like:
sed -i '/cache-size=/d' "/etc/dnsmasq.conf"

Original comment by d...@soulblader.com on 14 Jan 2015 at 8:17

GoogleCodeExporter commented 9 years ago
Issue 1398 has been merged into this issue.

Original comment by d...@soulblader.com on 14 Jan 2015 at 8:17