Actions

EmSys

Beaglebone Black - Internet Over USB

From EdWiki

Revision as of 15:15, 5 December 2020 by Jshankar (Talk | contribs) (Created page with "__NOTOC__ * Beaglebone board can communicate to the internet over USB cable by sharing your PC's internet connection * You need not use a separate Ethernet cable to connect yo...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  • Beaglebone board can communicate to the internet over USB cable by sharing your PC's internet connection
  • You need not use a separate Ethernet cable to connect your board to internet
  • The required drivers are enabled by default in the kernel and loaded when Linux boots on the BBB.
  • But you must enable internet sharing on your HOST

Target Settings

  1. Add name server address in: /etc/resolv.conf
    nameserver 8.8.8.8
    nameserver 8.8.4.4
  2. Add name server address in: /etc/network/interfaces
    iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.252
    network 192.168.7.0
    gateway 192.178.7.1
    dns-nameservers 8.8.8.8
    dns-nameservers 8.8.4.4
  3. Add default gateway address by running the below command
    sudo route add default gw 192.168.7.1 (Using PC as default gateway)
    Run the above command every time you reboot your BBB

HOST machine

  • create usb.sh script file and add the following lines and save it
    iptables --table nat --append POSTROUTING --out-interface wlp3s0 -j MASQUERADE
    iptables --append FORWARD --in-interface wlp3s0 -j ACCEPT
    echo 1 > /proc/sys/net/ipv4/ip_forward

Run this script file every time you reboot/start your Host