Ethan Miller

Unless otherwise noted, all work licensed under : Creative Commons License

Virtual State of Jefferson Tech

Apr 20 2010, 10:55PM

My collaboration with Ethan Ham, Virtual State of Jefferson will be going up in Ashland at the Schneider Museum of Art next month. I wanted to describe a little about the tech work involved because I had fun, and it might be useful to others. The piece is a router running dd-wrt with an iptables rule that sends all traffic through a proxy. The proxy server is running squid, as well as nginx. Squid is configured with a redirect_program that does the following for each request: The whole setup was heavily influenced by the upside-down-ternet, but since I prefer to work in Python, I used this script as my starting point. The toughest part was probably figuring out the right iptable rule to stick on the router, here is the script I ended up with:


LAN_IP=`nvram get lan_ipaddr`
LAN_NET=$LAN_IP/`nvram get lan_netmask`

if [ "$1" = "delete" ]; then

cmd="iptables -t nat -$ACTION PREROUTING -s $LAN_NET -p tcp -m tcp --dport 80 -j DNAT --to-destination $PROXY_IP:$PROXY_PORT"
echo $cmd
It's fun using sys-admin skills for an art project :D

Tags : networking nginx proxy regex

blog comments powered by Disqus