Skip to content

Share Internet through the USB Port on Pocketbeagle

On the host computer, there are two interfaces invoved:

  • the USB connection to pocketbeagle, e.g. "enx60640568c683"
  • the other network adapter that has Internet access, e.g. "eno1"

then on the host computer, do the following

$ sudo -i
$ echo "1" > /proc/sys/net/ipv4/ip_forward
$ iptables --table nat --append POSTROUTING --out-interface eno1 -j MASQUERADE
$ iptables --append FORWARD --in-interface enx60640568c683 --out-interface eno1 -j ACCEPT
$ iptables --append FORWARD --in-interface eno1 --out-interface enx60640568c683 -m state --state RELATED,ESTABLISHED -j ACCEPT
$ iptables --append FORWARD --in-interface enx60640568c683 -j ACCEPT

On the pocketbeagle, do the following

$ sudo route add default gw
$ sudo bash -c 'echo "nameserver" >> /etc/resolv.conf'


  • [1]