How to use dnsmasq.conf.add

Discussion in 'Asuswrt-Merlin' started by tjfriese, Nov 29, 2012.

  1. tjfriese

    tjfriese New Around Here

    Joined:
    Nov 29, 2012
    Messages:
    3
    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
     
  2. Log in / Register to remove this ad

  3. RMerlin

    RMerlin Part of the Furniture

    Joined:
    Apr 14, 2012
    Messages:
    14,667
    Location:
    Canada
    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.

    Just make sure the file is executable:

    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.
     
  4. tjfriese

    tjfriese New Around Here

    Joined:
    Nov 29, 2012
    Messages:
    3
     
  5. tjfriese

    tjfriese New Around Here

    Joined:
    Nov 29, 2012
    Messages:
    3
    And yes I have updated my dnsmaq.conf.add to have "server=" lines instead of what I had above.
     
  6. roastchickens

    roastchickens New Around Here

    Joined:
    Jun 5, 2015
    Messages:
    2
    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
     
  7. vfrvulcan

    vfrvulcan New Around Here

    Joined:
    Jan 22, 2014
    Messages:
    3
    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
     
  8. RMerlin

    RMerlin Part of the Furniture

    Joined:
    Apr 14, 2012
    Messages:
    14,667
    Location:
    Canada
    nat-start needs to start with a shebang since it's a shell script:

    Code:
    #!/bin/sh
    
     
  9. vfrvulcan

    vfrvulcan New Around Here

    Joined:
    Jan 22, 2014
    Messages:
    3
    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...
     

Share This Page