Now that we boot Debian from a MicroSD card and expand its file system capacity, the final step to complete setting up is to share Internet from my main computer. I got a windows computer, so I will do it from there. Instruction to other platforms should be similar.
If you rather watch a video, I pretty much follow this video, it helps a lot! I really need to thanks the people (in this case a professor) who share their knowledge for the good of everyone!
1. Open Control Panel -> Network and Internet -> Network and Sharing Center
2. One the left side panel, click Change Adapter Settings
3. Now, this should show all the network adapter available on the computer. Here’s mine, the one on the left is the BeagleBone Black, you can tell by the description Linux USB Ethernet. And the one on the right is my Internet source, a wireless adapter.
4. Here, we are going to enable Internet Sharing on Windows’ side by right clicking on your Source Internet Adapter. In my case, Wireless Network Network Connection, then Properties. Click Sharing, check Allow other network user to connect… and then select the BeagleBone network adapter from the drop down menu.
5. So after doing this, Windows will reconfigure the IP address for the BeagleBone, we need to set this back to automatic. Right Click on BeagleBone Network -> Properties -> highlight Internet Protocol Version 4 (TCP/IPv4) -> click Properties -> mark both Obtain IP and DNS server adress automatically.
6. We are all set on the Windows side, now we need to configure the BBB the route the Internet through your main computer. We do this by connect to BBB through SSH like before. Since we need to do this step every time we start up again, we might as well right a script using the nano editor. We will call this file EnableUSBInternet.
Write the following into the script… basically, it route the internet to the pc, who’s address is 192.168.7.1, while the BeagleBone’s IP is 192.168.7.2
echo "Routing Default Gateway to 192.168.7.1" sudo /sbin/route add default gw 192.168.7.1 echo "USB Internet Sharing Enabled!"
Ctrl + X to exit, press Y to save and press Enter to confirm to file name.
7. Use the clear command to clear the terminal for better view. Type in ls -l to list the files available in the current directory.
This pretty much show everything in the current directory. What we concern ourselves here is the EnableUSBInternet file, the left side -rw-r–r– list the permission. Right now, we can write, read, but we can’t execute the file. Therefore, we need to use the following command to change the permission to allow execution.
chmod +x EnableUSBInternet
We can see now that the file is executable with the different color and the “x” permission indicator.
8. Finally, we just need to run this script to set up Internet. Remember to run this script every time during start up to get Internet.
We can confirm that we actually got Internet access by pinging google, do Ctrl+C to exit pinging process.
9. Okay, since it’s annoying having to hand launch this script every time we start up, why not make it automatic? Therefore, we going to make edit to the .bashrc file and have it launch the script whenever we log it.
sudo nano .bashrc
Scroll all the way down and add the following line:
Ctrl+X -> Y -> Enter to save the file. Now, just reboot and it will launch when we log in!
BeagleBone Black Setup Series
- Boot Debian from MicroSD
- Expand Debian File Capacity from MicroSD
- Enable USB Internet Sharing
- Enable On-Board Serial UART Ports