-
-
Save deadprogram/eea3aabcee1c39dffd7b to your computer and use it in GitHub Desktop.
connect to your beaglebone black using the usb->ethernet and forward the internet from your host computer to the beaglebone black
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 | |
# | |
# run this script on your linux host computer to connect to the bbb and forward your internet. | |
# be sure to replace "enp0s20u1" with the appropriate usb device for your bbb, which can be found | |
# by doing an "ifconfig" on your host computer. | |
# | |
sudo -- sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward' | |
sudo iptables -A POSTROUTING -t nat -j MASQUERADE | |
sudo ifconfig enp0s20u1 192.168.7.1 255.255.255.0 | |
ssh [email protected] |
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 | |
# | |
# run this script on your bbb to use the internet forwarded from your host linux computer | |
# | |
ROUTE=`route | grep 0.0.0.0 | wc -l` | |
if [ $ROUTE -eq 0 ] | |
then | |
sudo -- sh -c 'echo "nameserver 8.8.8.8" >> /etc/resolv.conf' | |
sudo /sbin/route add default gw 192.168.7.1 | |
sudo ntpdate ntp.ubuntu.com | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment