Beaglebone via Ubuntu to internet not working

I am able to SSH into the Beaglebone from Ubuntu.

However Beaglebone can not connect to Internet.

Fire wall?

Any ideas? Thanks

How are you connecting via ssh to the BBB? If you are using the
ethernet over USB connection I don't think that has routing to allow
the BBB to access the internet (the system you're ssh'ing from would
have to have routing set up as well).

If you want the BBB to have direct access to the internet (like the
system you're connecting from) you need to connect the RJ45 port to
your LAN.

... sorry if you know all this already! :slight_smile:

How do you have your Beaglebone connected for networking; USB to a PC, Ethernet cable, Wi-Fi?

Which Beaglebone do you have?

Have you configured the gateway and such on the BB?

Jon

Beaglebone Black connected to PC over USB. PC running Ubuntu. Same setup works with Windows 10.

Beaglebone IP is 192.168.137.2 . I can SSH into it. OK.

In windows this is called internet connection sharing..

In Ubuntu, you need to also configure it on your ubuntu host..

https://github.com/RobertCNelson/boot-scripts/blob/master/network/doc-debian-setup.md

Regards,

In Ubuntu I tried: sudo ufw allow in 192.168.137.2

ufw is just the firewall..

so you didn't configure any routing.. fix that. :wink:

Regards,

Well I don't know how it works with Windows 10.

Anyway, as per my first reply, the easiest way to get the BBB to be
able to access the internet is to connect it direct to your router
with an RJ45 cable. It will then get assigned an IP of it's own on
the LAN (not an IP on the net unique to the USB connection) and will
also get its DNS and such set up so that it works.

Robert,

The iptables entries on the Ubuntu worked.

However running sudo apt update results in failures apparently for port 80?

Example:

debian@beaglebone:~/cronjobs$ sudo apt update
Err:1 http://repos.rcn-ee.com/debian buster InRelease
Cannot initiate the connection to repos.rcn-ee.com:80 (2600:3c00::f03c:91ff:fe37:6ad5). - connect (101: Network is unreachable) Could not connect to repos.rcn-ee.com:80 (45.33.2.10), connection timed out
Err:2 http://deb.debian.org/debian buster InRelease
Cannot initiate the connection to debian.map.fastlydns.net:80 (2a04:4e42:2f::644). - connect (101: Network is unreachable) Could not connect to debian.map.fastlydns.net:80 (151.101.202.132), connection timed out Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:3b::644). - connect (101: Network is unreachable)
Err:3 http://deb.debian.org/debian buster-updates InRelease
Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:3b::644). - connect (101: Network is unreachable)
Err:4 http://deb.debian.org/debian-security buster/updates InRelease
Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:3b::644). - connect (101: Network is unreachable)
Reading package lists… Done

I can ping the above.

debian@beaglebone:/etc/apt$ ping repos.rcn-ee.com -c3
PING repos.rcn-ee.com (45.33.2.10) 56(84) bytes of data.
64 bytes from li956-10.members.linode.com (45.33.2.10): icmp_seq=1 ttl=51 time=52.9 ms
64 bytes from li956-10.members.linode.com (45.33.2.10): icmp_seq=2 ttl=51 time=52.4 ms
64 bytes from li956-10.members.linode.com (45.33.2.10): icmp_seq=3 ttl=51 time=52.6 ms

Ah Cool, it looks like you have ipv6 too, try the ipv6 version of iptables..

Sorry i'm stuck on a ipv4 provider..

Regards,

After implementing Roberts changes to Ubuntu I get the following:

debian@beaglebone:~$ sudo apt update
Err:1 http://deb.debian.org/debian buster InRelease
Temporary failure resolving ‘deb.debian.org
Err:2 http://repos.rcn-ee.com/debian buster InRelease
Temporary failure resolving ‘repos.rcn-ee.com
Err:3 http://deb.debian.org/debian buster-updates InRelease
Temporary failure resolving ‘deb.debian.org
Err:4 http://deb.debian.org/debian-security buster/updates InRelease
Temporary failure resolving ‘deb.debian.org
Reading package lists… Done
Building dependency tree
Reading state information… Done
All packages are up to date.
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease Temporary failure resolving ‘deb.debian.org
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease Temporary failure resolving ‘deb.debian.org
W: Failed to fetch http://deb.debian.org/debian-security/dists/buster/updates/InRelease Temporary failure resolving ‘deb.debian.org
W: Failed to fetch http://repos.rcn-ee.com/debian/dists/buster/InRelease Temporary failure resolving ‘repos.rcn-ee.com
W: Some index files failed to download. They have been ignored, or old ones used instead.
debian@beaglebone:~$

After implementing Roberts changes to Ubuntu I get the following:

debian@beaglebone:~$ sudo apt update
Err:1 Index of /debian buster InRelease
  Temporary failure resolving 'deb.debian.org'
Err:2 Index of /debian buster InRelease
  Temporary failure resolving 'repos.rcn-ee.com'
Err:3 Index of /debian buster-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Err:4 http://deb.debian.org/debian-security buster/updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease
Temporary failure resolving 'deb.debian.org'
W: Failed to fetch
http://deb.debian.org/debian/dists/buster-updates/InRelease Temporary
failure resolving 'deb.debian.org'
W: Failed to fetch
http://deb.debian.org/debian-security/dists/buster/updates/InRelease
Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://repos.rcn-ee.com/debian/dists/buster/InRelease
Temporary failure resolving 'repos.rcn-ee.com'
W: Some index files failed to download. They have been ignored, or old ones
used instead.
debian@beaglebone:~$

OK, you are missing the DNS. The quick and dirty hack is edit
/etc/resolv.conf to contain just this line:

nameserver 8.8.8.8

Yet again I say.

Get a UTP patch lead and simply connect the BBB direct to your router,
job done.

It is that.

The problem is getting thru the Ubuntu host machine.

Beglebone —> Ubuntu Machine —> Internet

I do not have a router. I have WiFi.

You have to have a router. The public Internet is not Wireless. Somewhere
there is a wire and a router. Unless you are doing this from a park bench or
an Internet Cafe... Or "stealing" your neighbor's WiFi.

What do you have for an ISP? Cable? FIOS? DSL? Municipal Fiber? Or something
else?

*Every* WiFi router *I* have *ever* seen includes a 4-port Etherswitch,

Yes, it is *possible* to use your Ubuntu laptop as a router, but getting it
ALL setup properly is not trivial. Some of it requires some Linux admin
magic. It appears you are not quite there.

Note: the USB Internet provided by the BBB is not really intended for much
more than basic setup.

If it really is impossible to get a hard network connection, you might have to
get a USB wireless dongle. The BBB does have a USB A connector that is a USB
host.

You have a router somewhere! :slight_smile:

Robert,

This worked under Windows 10. The Bone could access the internet fine.

P.C. Now running Ubuntu 20.04.

Same WiFi. I live in an assisted living center and they have WiFi. No router for me.

Apply the following to Ubuntu and sudo apt xxx and other functions work fine from Beaglebone

Invoke after reboot. 01-28-2021 KM / ChipMaster

sudo sysctl net.ipv4.ip_forward=1

WiFi device || from route command

/----\

sudo iptables -t nat -A POSTROUTING -o wlp3s0 -j MASQUERADE

This worked under Windows 10. The Bone could access the internet fine.

  More likely -- "this worked under Windows 10" INTERNET CONNECTION
SHARING (ICS). A feature which has to be enabled/configured in Windows, it
is not automatic. When configured properly -- meaning the local and wide
area network NICs have been defined, and the firewall has had stuff opened
up to allow pass-through traffic, the Windows machine becomes an Internet
Gateway Router.

P.C. Now running Ubuntu 20.04.

  There is no "all in one" configuration. You have to adjust the Linux
routing tables, defining gateway ports, the NICs to route between, along
with setting up firewall rules. All actions that require some knowledge of
Linux and networking.

  Might be better to run a network cable connection from the BBB to the
(laptop? I presume it has an RJ45 jack somewhere) and try to configure
Linux to route a proper Ethernet connection to the WiFi rather than trying
to use the pseudo-device created over the USB connection. As has been
mentioned, that USB-gadget is really meant just to allow direct (SSH)
connection to the BBB for purposes of configuring it (if needed) with the
Ethernet connection being the primary networking link.