Skip to content

Connecting a BeagleBone to the internet

jjtom34 edited this page Dec 10, 2021 · 11 revisions

Connecting a BeagleBone to the internet on Windows

  1. On your computer, open up the network adapter settings page from Control Panel (NOT the windows setting app)
  2. Power on the BeagleBone and connect to your computer
  3. On your computer, note the new device listed in the adapter settings page. This is the BeagleBone's network adapter
  4. On the computer, edit your current network device's (Ethernet/Wifi) properties
    1. Under sharing, check "Allow other users to connect through this computers..."
      1. If already checked, uncheck. Choose the BeagleBone from the dropdown (under "Home networking connection")
    2. Select the BeagleBone network adapter from dropdown
  5. On your computer, edit the BeagleBone's network adapter properties
    1. Under Networking, scroll to "Internet Protocol Version 4 (TCP/IPv4)" and select it. Enter its properties
      1. Select "Use the following IP address". Changer the IP address to 192.168.7.1
      2. Select "Use the following DNS server addresses". Change the Preferred DNS to 1.1.1.1
  6. SSH into the BeagleBone using your SSH client of choice
    1. IP should be 192.168.7.2, user is default to debian and password should be temppwd. If 192.168.7.1 doesn't work, try 192.168.6.1. If that doesn't work ask for help.
  7. On the BeagleBone, type
  8. $ sudo ifconfig usb0 192.168.7.2
  9. $ sudo route add default gw 192.168.7.1
  10. On the BeagleBone try $ ping 1.1.1.1. If this doesn't work, return to step 1, or ask for help.
  11. Now add the DNS server to the BeagleBone
  12. Open /etc/resolv.conf in your favorite editor with sudo and add in nameserver 1.1.1.1
    1. sudo nano /etc/resolv.conf
    2. sudo vim /etc/resolv.conf
  13. On the BeagleBone try $ ping google.com. If this doesn't work, return to step 1, or ask for help.

Connecting a BeagleBone to the internet on Linux

  1. Open terminal

  2. Type: $ sudo su

    1. Be careful of this command in general, it will run everything you do as administrator, for this tutorial you won't be doing anything destructive so it shouldn't cause any issues, but in general try to avoid using this
  3. Type: $ ifconfig to list all current network devices, look for your current active internet connection's name

    1. The WiFi connection's name will typically start with wl.
    2. The ethernet connection's name will typically start with en or eth.
    3. A loopback connection's name will start with lo. This is not the connection you want
    4. The current active connection should have an IP address assigned.
    5. The current active connection's IP address should not start with 127.0.0
  4. Enter $ internet=[active internet connection name] (note - no spaces)

  5. Power on the BeagleBone and connect it to your computer

  6. On your computer, type $ ifconfig again, you will see two more network interfaces.

    1. Look for the BeagleBone's connection in the list, it will probably have an IP of 192.168.7.1
    2. Highlight and right click copy the name of the interface
  7. Enter $ bbbnet=[rightclick to paste the name of interface] (note - no spaces)

  8. Copy and paste the following command, it assumes you are still in sudo su

    1. $ ifconfig $bbbnet 192.168.7.1 && iptables --table nat --append POSTROUTING --out-interface $internet -j MASQUERADE && iptables --append FORWARD --in-interface $bbbnet -j ACCEPT && echo 1 > /proc/sys/net/ipv4/ip_forward && exit
  9. If anything up to this point has failed, reboot your computer and try again from step 1

  10. SSH into the BeagleBone in a new terminal using $ ssh [email protected] with a password of temppwd

    1. If 192.168.7.1 doesn't work you can try 192.168.6.1 if that doesn't work check $ ifconfig for the IP, or ask for help
  11. On the BeagleBone, enter

    1. $ sudo ifconfig usb0 192.168.7.2
    2. $ sudo route add default gw 192.168.7.1
  12. On the BeagleBone try $ ping 1.1.1.1. If this doesn't work, return to step 1, or ask for help.

  13. Now add the DNS server to the BeagleBone

    1. $ sudo vi /etc/resolv.conf
    2. press i to get into insert mode
    3. type nameserver 1.1.1.1
    4. press ESC
    5. :wq
  14. On the BeagleBone try $ ping google.com. If this doesn't work, return to step 1, or ask for help.

Clone this wiki locally