Skip to content

Instantly share code, notes, and snippets.

@bunsenmcdubbs
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bunsenmcdubbs/8888980 to your computer and use it in GitHub Desktop.
Save bunsenmcdubbs/8888980 to your computer and use it in GitHub Desktop.
Forwarding network access through a usb tether to the Beaglebone Black. Adapted from http://robotic-controls.com/learn/beaglebone/beaglebone-internet-over-usb-only
#!/bin/bash
# run this on the computer first
ifconfig eth1 192.168.7.1
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
#!/bin/bash
# run this on the beaglebone after running the "server" side script
ifconfig usb0 192.168.7.2
route add default gw 192.168.7.1
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
# getting the time
ntpdate -b -s -u pool.ntp.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment