Skip to content

Instantly share code, notes, and snippets.

@strezh
Created January 12, 2015 11:55
Show Gist options
  • Save strezh/9d3e0d1d053d6d0d0ab2 to your computer and use it in GitHub Desktop.
Save strezh/9d3e0d1d053d6d0d0ab2 to your computer and use it in GitHub Desktop.
BBB: share inet to BBB
#!/bin/sh
# On BBB
#ifconfig usb0 192.168.7.2
#route add default gw 192.168.7.1
# and add to /etc/resolv.conf
# nameserver 8.8.8.8
# Share Wi-Fi Inet to BeagleBoneBlack
sudo su
#eth1 is my internet facing interface, eth2 is the BeagleBone USB connection
ifconfig eth2 192.168.7.1
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth2 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment