tip: auto network configuration on host

Thomas Karpiniec tk at 1.21jiggawatts.net
Fri Jun 25 23:39:39 EDT 2010

Hi folks,

I have a tip here which is totally not ground-breaking but might save
some time. If you're running debian or a similiar distro on your host
PC you can put the following in /etc/network/interfaces

allow-hotplug usb0
iface usb0 inet static
      up echo "1" > /proc/sys/net/ipv4/ip_forward; \
           /sbin/iptables -t nat -F; \
           /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

and when you plug in the USB cable you'll automatically get an IP and
set up masquerading for internet access. Make sure you choose the
appropriate IP -- is the usual one for openwrt/the
official image.

Then on your nano you just need to make sure the gateway gets set. On
Jlime I put "route add default gw" in
/etc/muffinman-extras/final.sh. On openwrt, "option gateway" in /etc/config/network should do it.

I hope that helps someone. :)


More information about the discussion mailing list