Solarian Programmer

My programming ramblings

BeagleBone Black sharing your macOS Internet connection through USB

Posted on December 4, 2018 by Sol

This is a short article about sharing your Internet connection with a BeagleBone Black through USB on macOS Mojave. I assume that you’ve gone through the Getting Started setup and that you’ve installed the latest Debian image on your BBB.

Connect the BBB to your Mac through USB and start the device. Once the device is on, open a Terminal and use ssh to connect to your BBB:

1 ssh debian@beaglebone.local

The default password is temppwd, but I suggest to change it for security reasons. If you want to change it now use:

1 passwd

Next, on macOS, open System Preferences, go to Sharing and check BeagleBoneBlack and Internet Sharing:

BeagleBone Black share internet through USB on macOS

Answer Yes when asked if you want to start sharing the Internet.

Next, on your BBB, ask for an IP with:

1 sudo dhclient usb1

You may need to change the usb1 to another number in the above command.

Now, check if you have access to the Internet, on your BBB, with something like:

1 ping -c 5 www.google.com

This is what I see on my device:

 1 debian@beaglebone:~$ ping -c 5 www.google.com
 2 PING www.google.com (172.217.10.228) 56(84) bytes of data.
 3 64 bytes from lga25s59-in-f4.1e100.net (172.217.10.228): icmp_seq=1 ttl=56 time=22.4 ms
 4 64 bytes from lga25s59-in-f4.1e100.net (172.217.10.228): icmp_seq=2 ttl=56 time=23.3 ms
 5 64 bytes from lga25s59-in-f4.1e100.net (172.217.10.228): icmp_seq=3 ttl=56 time=23.3 ms
 6 64 bytes from lga25s59-in-f4.1e100.net (172.217.10.228): icmp_seq=4 ttl=56 time=30.3 ms
 7 64 bytes from lga25s59-in-f4.1e100.net (172.217.10.228): icmp_seq=5 ttl=56 time=23.3 ms
 8 
 9 --- www.google.com ping statistics ---
10 5 packets transmitted, 5 received, 0% packet loss, time 4008ms
11 rtt min/avg/max/mdev = 22.424/24.567/30.320/2.901 ms
12 debian@beaglebone:~$

If you are not connected to the Internet you should see something like:

1 debian@beaglebone:~$ ping -c 5 www.google.com
2 ping: www.google.com: Temporary failure in name resolution
3 debian@beaglebone:~$

Next time you need to use the Internet on your BBB, connect it to your Mac, login through ssh and repeat the dhclient command:

1 sudo dhclient usb1

Show Comments