Skip to content

Instantly share code, notes, and snippets.

@julianduque

julianduque/bbb.sh

Last active Aug 29, 2015
Embed
What would you like to do?
Share internet with BeagleBone Black
#!/bin/bash
# bbb.sh -- Share Internet with the BeagleBone Black
# using my Linux HOST as a router
bbbAddr="192.168.7.2"
hostAddr="192.168.7.1"
# Configure IP forwarding on HOST
echo "Setting up Routing"
sudo iptables -A POSTROUTING -t nat -j MASQUERADE
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
echo "Configuring Router"
ssh root@$bbbAddr "/sbin/route add default gw $hostAddr"
# Add Google DNS Servers
echo "Configuring DNS"
ssh root@$bbbAddr "echo nameserver 8.8.8.8 > /etc/resolv.conf"
ssh root@$bbbAddr "echo nameserver 8.8.4.4 >> /etc/resolv.conf"
# Set date
echo "Setting Date"
ssh root@$bbbAddr "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
You can’t perform that action at this time.