Pocket NC Raspberry Pi Wifi Bridge

The primary UI the Pocket NC presents is a web interface accessible over a virtual USB based ethernet port.  I wanted to be able to run mine not immediately near an ethernet jack, but also didn’t want to have to tote a laptop over every time to check on it.  I had plenty of raspberry pi’s lying around, so rigged one up as a wifi bridge.

First, I found a random case to print from thingiverse, the TurboPi:

turbopi

Then I gave it a fixed IP address on my wifi network and set up IP forwarding with NAT.

iptables -A POSTROUTING -o eth1 -j MASQUERADE

Then, I saved that config:

iptables-save > /etc/iptables.ipv4.nat

And restored them in /etc/rc.local

iptables-restore < /etc/iptables.ipv4.nat

Finally, I enabled forwarding in /etc/sysctl.conf

net.ipv4.ip_forward=1

Finally, I added a route on my desktop with the raspberry pi’s address as the gateway.  Now I can transparently access the PocketNC from anywhere!

dsc_0154
Raspberry Pi forwarding network traffic to the Pocket NC