Internet acces for PocketBeagle2

Hi,

I want to allow my PB2 to have an Internet access. I followed the documentation from https://docs.beagleboard.org/pocketbeagle-2.pdf (p 13 and 14) but it does not work. Looks like the packets arrives from the PB2 but are not sent by the PC. Is there a missing/wrong iptables config?

Thx by advance

which image are you using?

is your pc a Linux or Windows box ? Version?

Hi,

I use Ubuntu Linux 22. I’ve tried with 2 BB images: 2025.01 and 2025.09.

Regard

my linux box is also 22.04, so we are on the same version there

new install for pb2

Debian Bookworm Minimal Image 2025-06-30
Linux BeagleBone 6.12.24-ti-arm64-r43 #1 SMP PREEMPT_RT Wed Jun 25 00:21:23 UTC 2025 aarch64 GNU/Linux

works,

however a few things,

in pc-internet.sh

make sure you get the two interfaces correct

in my case

sudo iptables --table nat --append POSTROUTING --out-interface eno1 -j MASQUERADE
sudo iptables --append FORWARD --in-interface enxb0d5cccd8ab9 -j ACCEPT

eno1 is the interface to my router

enxb0d5cccd8ab9 is the interface to the PB2

in pb2-internet.sh

the double quotes seem to be something else,

seems to be a copy paste issue from the pdf file you pointed to.

also tested Debian 13 Trixie, it did not work for me

1 Like

OK I will test with 2025-06-30.

What double quotes are you talking about?

i see two sets,

if [ ”x${USB_CONFIGURATION}” = ”x” ] ; then USB0_SUBNET=192.168.7 DNS_NAMESERVER=8.8.8.8 fi /sbin/route add default gw ${USB0_SUBNET}.1 || true ping -c1 ${DNS_NAMESERVER} echo ”nameserver ${DNS_NAMESERVER}” >> /etc/resolv.conf

AFAIK such a syntax is correct, used to avoid script error in the case of empty field.

I’ve downloaded 2025-06-30, Il will test it in a short time.

regards

Still not working. On pb2 I’ ve used the following script:

#!/bin/sh -e

set -x

if ! id | grep -q root; then
echo “must be run as root”
exit
fi

if [ -f /etc/default/bb-boot ] ; then
. /etc/default/bb-boot
fi

if [ “x${USB_CONFIGURATION}” = “x” ] ; then
USB0_SUBNET=192.168.7
DNS_NAMESERVER=8.8.8.8
fi

/sbin/route add default gw ${USB0_SUBNET}.1 || true

ping -c1 ${DNS_NAMESERVER}

echo “nameserver ${DNS_NAMESERVER}” >> /etc/resolv.conf

And so I have:

debian@BeagleBone:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.7.1 0.0.0.0 UG 0 0 0 usb0
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0

But ping still does not work.

On the PC 'I’ve used the following script (I’m connected with Wifi):

sudo sysctl net.ipv4.ip_forward=1
sudo iptables --table nat --append POSTROUTING --out-interface wlp0s20f3 -j MASQUERADE
sudo iptables --append FORWARD --in-interface enx1cba8ca2ed6a -j ACCEPT

1 Like

what does route -n on your host machine output

here is what mine looks like

amf@amf:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.3.1     0.0.0.0         UG    100    0        0 eno1
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eno1
192.168.3.0     0.0.0.0         255.255.255.0   U     100    0        0 eno1

and on PB2

debian@BeagleBone:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.7.0     0.0.0.0         255.255.255.0   U     0      0        0 usb0

FYI, for formatting, use three back ticks

based on what you posted for PB2 route -n, yours is different than what i get

my guess is that some step was missed or the script did not work correctly

I have used several images for the pocketbeagle 2. This tutorial always works for me. I have a usb 2.0 breakout, with a usb wifi. Hope this helps.

Does one need to be connected to Ethernet instead of Wifi to handle such a task?

Seth

P.S. I am still trying over here too. I have gotten the USB0 device, PB2, to become recognized via applications on Windows 11 only for the PB2. I am still learning about ways under Linux (Debian Trixie).

Okay.

So, the Debian or Ubuntu or other Linux distro needs networking. The PB2 needs networking.

Is it possible to set your gw of development desktop to the same DNS server as the PB2? I think this is where the data may conclude.

The reason I am bringing this up:

  • I have another board.
  • This board must communicate similarly but way of Ethernet.
  • Either way, sharing and communication in this instance is similar.

Still trying.

Seth

P.S. So, with this other board, this is what I do: I set the connection down. I install the new IP gateway. I reload the desktop either by way of a reboot or some commands.

I will try this and report back. Nope. No good. Off to networking fundamentals…

Hi,

I found the solution here:

It works fine after changing the network interfaces on the PC side.

2 Likes

Okay. I shall try it. I knew the development desktop needed altering on some port or DNS.

I will look at it.

Seth

I think the PB2 documentation should be updated, what is the way to do that ?

1 Like

gitlab at openbeagle.org

Seth