This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Automatically setup routing and DNS for a PiZero connected over a USB-network | |
# NOTE: Before running this script for the first time, you need to run the | |
# following two commands on your Linux PC | |
# sudo sysctl -w net.ipv4.ip_forward=1 | |
# sudo iptables -t nat -A POSTROUTING -s 169.254.0.0/16 -o eth0 -j MASQUERADE | |
# (replace eth0 in the second command with your internet-facing network device, | |
# e.g. wlan0 on a laptop) | |
# The Avahi-discovered hostname |