Entware snmpd

I’m setting up a router which as the option of using entware to extend the functionality. This is great, as I want to have snmpd running on the network device for monitoring and such.

After setting up entware, I installed the snmpd package.

opkg install snmpd

Easy-peasy. Well…not really. No sample config or start scripts are included in the package. Not a huge deal. Just needed to bodge some in place.

For a snmpd.conf let’s do this:

com2sec local default [PASSWORD]
group localgroup v2c local
access localgroup "" any noauth exact all all none
view all included .1 80
syslocation Vancouver, BC
dontLogTCPWrappersConnects yes

For a init script, let’s using this hacky snmpd script.


### Custom user script for snmpd
### This script auto called after system boots
### First param is:
###  "start" (call at start entware),
###  "stop" (call before stop entware),
### Include you custom rules for iptables below:

case "$1" in
        # start snmpd daemon
        if [ -f /opt/var/run/snmpd.pid ];
                echo "snmpd running...`cat /opt/var/run/snmpd.pid`"
                /opt/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /opt/var/run/snmpd.pid -c /opt/etc/snmp/snmpd.conf
                echo "snmpd started"

        # stop snmpd
        kill `pgrep snmpd`
        rm /opt/var/run/snmpd.pid
        echo "snmpd stopped"
        # status snmpd
        if [ -f /opt/var/run/snmpd.pid ];
                echo "snmpd running...`cat /opt/var/run/snmpd.pid`"
                echo "snmpd stopped"
        echo "Usage: $0 {start|stop|status}"
        exit 1

As you can see in the start script, it uses a snmp user and group. So we should create those.

# adduser -s /bin/false -D -u 1161 snmp


Blocking Web Ads

While wandering through the Interwebs, I happened across a interesting post on blocking your ads with Bind9 and an IP blacklist here.  The instructions looked pretty simple, and, being a geek technical professional, I had a Bind sever running at home. I gave it a go and thought nothing more of it.

The next day I got a small start, when I saw a whole bunch of 404s on the web server running on that host. It shouldn’t be contactable from the Interwho. A moment passes and I realize it’s the lookups for the blacklist hosts hitting my web server. What the heck? I am running AdBlock Plus. I guess some are still slipping through the cracks. Quite a few it seems!

Seeing the value in running this all over the place, I figured I’d whip up a Docker container for deploying this quickly and simply.  Grab the docker image thusly:

docker pull  matt604/docker-ad-blocking-dns

or the Dockerfile, et al. are here