What's new

How to use dnsmasq.conf.add

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

tjfriese

New Around Here
Hello,

I have the following in a dnsmasq.conf.add file on my desktop:

server/netflix.com/184.169.139.227
server/theplatform.com/184.169.139.227

Three questions:

1) How do I get this onto my RT-N16? I have already set up JFFS in the admin settings. I have tried Putty SFTP but was unable to connect.

2) Do I need to modify permissions for the .add file once I have it on the RT-N16?

3) Can I disable JFFS once I have the file on the RT-N16? I would need to re-enable it if I ever needed to modify the file, I guess.

Thanks,

Tim
 
Hello,

I have the following in a dnsmasq.conf.add file on my desktop:

server/netflix.com/184.169.139.227
server/theplatform.com/184.169.139.227

Three questions:

1) How do I get this onto my RT-N16? I have already set up JFFS in the admin settings. I have tried Putty SFTP but was unable to connect.

Simplest way if you aren't very skilled at using Linux is to put them on a USB disk, then while connected through telnet you can copy them in their final location.

2) Do I need to modify permissions for the .add file once I have it on the RT-N16?
Just make sure the file is executable:

chmod a+rx /jffs/configs/dnsmasq.conf.add

3) Can I disable JFFS once I have the file on the RT-N16? I would need to re-enable it if I ever needed to modify the file, I guess.

No. The idea of JFFS is to create a partition stored inside the router's flash storage to put scripts in. If you disable JFFS, it will disable the partition, meaning the firmware will no longer be able to access your config file at boot time to merge it with the main config file.
 
Simplest way if you aren't very skilled at using Linux is to put them on a USB disk, then while connected through telnet you can copy them in their final location.

I never thought about using the USB. I figured I would have to FTP it in somehow. Thanks!
 
I was adding stuff to the /jffs/configs/dnsmasq.conf.add - but it wasn't updating the /etc/dnsmasq.conf file.. This was on Merlin 378.53

Anyway, if you see this in /tmp/syslog.log:
Jun 6 10:26:59 custom config: Found /jffs/configs/dnsmasq.conf.add, but custom configs are disabled!

You will need to change the nvram setting.

prompt# nvram set jffs2_scripts=1

----
At this point you can restart dnsmasq, and it should work

prompt# service restart_dnsmasq
 
Hmm, can't seem to get it working here. Admittedly first time playing with SSH/VI etc

Updated to 378.54.2, SSH'd in and created nat-start as per first post along with dnsmasq.conf.add

Rebooted several times, tried nvram set jffs2_scripts=1, confirmed jffs scripts enabled in admin/system.

Syslog shows warning: interface vlan4 does not currently exist

tmp/etc/dnsmasq.conf is being updated with /jffs/configs/dnsmasq.conf.add as it shows the following:

Code:
pid-file=/var/run/dnsmasq.pid
user=nobody
bind-dynamic
interface=br0
interface=ppp1*
no-dhcp-interface=ppp1*
resolv-file=/tmp/resolv.conf
servers-file=/tmp/resolv.dnsmasq
no-poll
no-negcache
cache-size=1500
min-port=4096
no-dhcp-interface=br0
interface=vlan4
dhcp-range=vlan4,192.168.124.10,192.168.124.100,255.255.255.0,86400s
dhcp-option=vlan4,3,192.168.124.1
dhcp-option=vlan4,6,192.168.124.1,0.0.0.0

~

/jffs/nat-start is
Code:
#
# lan ports 1-3 assigned to vlan1
robocfg vlan 1 ports "1 2 3 8t"
# port 4 to vlan4
robocfg vlan 4 ports "4 8t"
#
vconfig add eth0 4
#
ifconfig vlan4 192.168.124.1 netmask 255.255.255.0 up
#
iptables -I FORWARD -i vlan4 -m state --state NEW -j ACCEPT
iptables -I FORWARD -i vlan4 -o br0 -m state --state NEW -j DROP
iptables -I FORWARD -i br0 -o vlan4 -m state --state NEW -j DROP
iptables -I INPUT -i vlan4 -j ACCEPT
~
~
~
~

and /jffs/configs/dnsmasq.conf.add is

Code:
interface=vlan4
dhcp-range=vlan4,192.168.124.10,192.168.124.100,255.255.255.0,86400s
dhcp-option=vlan4,3,192.168.124.1
dhcp-option=vlan4,6,192.168.124.1,0.0.0.0

~
~
~
~

Robocfg show output doesn't show vlan4
Code:
admin@RT-N66U:/jffs/configs# robocfg show
Switch: enabled gigabit
Port 0:  100FD enabled stp: none vlan: 2 jumbo: off mac: a0:f3:e4:34:0c:96
Port 1: 1000FD enabled stp: none vlan: 1 jumbo: off mac: f4:6d:04:13:bc:a3
Port 2:  100FD enabled stp: none vlan: 1 jumbo: off mac: 00:1b:67:08:71:4f
Port 3:   DOWN enabled stp: none vlan: 1 jumbo: off mac: 00:00:00:00:00:00
Port 4:  100FD enabled stp: none vlan: 1 jumbo: off mac: 00:1b:38:f5:f8:95
Port 8: 1000FD enabled stp: none vlan: 1 jumbo: off mac: 74:d0:2b:d2:7d:f8
VLANs: BCM53115 enabled mac_check mac_hash
   1: vlan1: 1 2 3 4 8t
   2: vlan2: 0 8u
admin@RT-N66U:/jffs/configs#

BTW, lapdog connected directly into LAN port 4 gets DHCP from VLAN1

Any ideas what I'm doing wrong?

All help appreciated.

Aaron
 
nat-start needs to start with a shebang since it's a shell script:

Code:
#!/bin/sh
 
nat-start needs to start with a shebang since it's a shell script:

Code:
#!/bin/sh
Thanks Merlin,

That'll teach me to look at something new at 3AM! I did actually mean to post my message to the thread about VLANs - http://www.snbforums.com/threads/use-lan-port-4-as-private-network.14983/page-2

Just got up and had another look, the shebang was already there, another reboot and still not working.

Guess I'll have another poke at it tonight. One thing that bugs me is when I copy text and paste it into VI using Putty several characters are missing from the beginning and I have to insert them manually, I wonder if some corruption is getting in there...
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top