Stompbox – Howto #4 – Config and Customize

Configuration

By now you should have a login prompt in your serial console. Login as root, no password and run the stompbox config script, /usr/local/bin/initial-setup. The questions are pretty self explanatory. If you don't know the answer to a question, take the default. I don't have a camera or gpsd setup but it still asked me to configure those items. I just hit enter on the defaults to keep going. I do recommend getting a dynDNS account and entering that info. It makes it a lot easier to get to your stompbox from the real world. If you don't want to mess with dynDNS then just enter something and we can disable it later. When the script is done you should reboot the box.

The setup script fails to update /etc/resolv.conf so you'll need to do that before you can get along with much else. Put the box in RW mode (remountrw) and vi /etc/resolv.conf. Change the IP of the nameserver to the local wifi address (127.0.0.1 should work too). If everything went well you now have a working stompbox.

Customization

We should probably turn off the cron jobs that we don't need. Change to the /etc/cron.d directory and look at the files there. Modify the getcam and insert a # in the first column of the first line to disable it. I suggest leaving the gettime script as is. The next place to look is in /etc/ppp/ip-up.d. If you don't use dynDNS then insert an exit command at the top of the file. You could also delete the file but may regret that later when you find out how cool dynDNS is. Do the same for gpsd if you don't have it installed.

apt-get

Fortunately there is enough of the apt-get package and data files on the stompbox image to install some packages. Whatever you do, do NOT run apt-get update. The current updates include dependencies for a new glib package that won't leave you with much (if any) free disk space.

Removing Packages

Execute dpkg -l to get a list of what's installed. If you see anything that you don't want or don't need then you can remove it with apt-get remove package-name or dpkg -P packagename. I removedabout half a dozen packages to make room for the openvpn and dnsMasq, one of which was dns-cache.

dnsMasq

I prefer dnsmasq because it will read a dhcp leases file and resolve the names given by the clients. This way the names anton, skeeto, deb, and dog all resolv to the dynamically assigned IP for those machine. To configure dnsmasq, open up /etc/dnsmasq.conf then find and change the following two lines:

resolv-file=/etc/ppp/resolv.conf|
dhcp-leasefile=/rw/var/lib/dhcp/dhcpd.leases

The rest of the config file should work as-is.

openvpn

Verizon hads out a different dynamic IP every time you connect. This can be especially annoying when you've got half a dozen shells open on a remote box when you drive out of range for a bit. To solve this problem I installed openvpn on my web server and router and make any "permanent" tcp connections via the tunnel.

I can ssh directly through the tunnel to the web server when I am working. Since IM is also prone to problems during reconnects, gaim is configured to proxy off a private squid cache on the other side of the tunnel. Regular traffic is not routed through the tunnel but if you're really worried about Verizon snooping your packets it could easil be done.
I won't get into how to configure openvpn at this time as there are a lot of good howtos on the net. Getting it installed on the stompbox took a little work but ultimately I used apt-get to install openvpn after finding a deb of one of the dependencies on the web. I'll try sometime to reproduce my steps if anyone else is interested in how to make it work.

bwm

bwm is a handy realtime bandwidth monitor that runs in a terminal. To get it is as simple as running 'apt-get install bwm'. Run 'bwm' for a nice text table on screen with the receive, transmit, and combined bandwidth for each interface.

PPP Checker

Neither of my evdo cards behave well on the fringe of the network and frequently quits responding to AT commands. Fixing it is as simple as using cardctl to eject and insert the card so I wrote a little script to do that if pppd fails to make a call.

#!/bin/bash
# - /usr/local/bin/checkppp.sh
if tail -n10 /var/log/messages | grep 'Connect script failed' > /dev/null ; then
/usr/bin/logger 'Resetting EVDO card'
/sbin/cardctl eject
/sbin/cardctl insert
fi

Then toss an entry in cron to make it run every minute:

# cat /etc/cron.d/checkppp
* * * * * root /usr/local/bin/checkppp.sh

Be careful if you copy the script above as wordpress does abhorable things to the quotes and apostrophes.

Finished

If all went well you should now have a fully workable appliance that connects you to the internet wherever you go. Part 5 is coming soon with some cool ideas that I'd like to try and I'll wrap it all up later this weekend with a list of sources, links, and my opinions what's good and bad about evdo.


Part 1 - Before You Start
Part 2 - Getting The Hardware
Part 3 - First Boot
Part 4 - Config and Customize
Part 5 - Future Plans
Part 6 - Summary

2 thoughts on “Stompbox – Howto #4 – Config and Customize

  1. Hi,

    I have a newbie question…is it possible to plug in an ip camera to the box (as opposed to using wireless)?

    Are the ethernet ports brought up at boot?

    Does this make sense?

    Thanks,

    Mike

  2. Both of the ports are active and have dhcpd listening on them. Until recently I had me computer plugged directly into one of the ports.

    As long as the camera is smart enough to ask for an IP address it should get one and be on the network.

Leave a Reply

Your email address will not be published. Required fields are marked *