Beaglebone black connect to Web

Hi,

I have a beaglebone black and I’m attempting to connect it to the outside world. I have the latest debian image installed.

Here is what I have done:

  • installed latest windows 64 bit drivers
  • Configured my wifi network adapter to be shared with the network adapter created through the USB cable connection.

When I attempt to ping www.google.com I get the error “Temporary failure in name resolution”

Any help would be of benefit…

Thanks

IIRC the BB-s virtual Ethernet port is not configured to be an uplink to the Internet - the Ethernet port is. Changing this is going to be tricky (not impossible, but requires in-depth understanding of what you’re doing).

The simplest way to solve your problem is to connect the BB to Internet using an Ethernet cable and your nearest router.

Are you following the instructions listed at the following link?
https://www.digikey.com/en/maker/blogs/how-to-connect-a-beaglebone-black-to-the-internet-using-usb

Have you set the default router on your BBB?
Ex:
sudo /sbin/route add default gw 192.168.7.1

Cheers,

Jon

Hi,

Yes I have set the default router setup in windows 192.178.7.1.

Will it require an ethernet cross-over cable? Is there a link to basic instructions to achieve this?

Many thanks in advance.

Thanks

Hi again I don’t think the beaglebone gateway is working as when I ping 192.168.7.1 from the beagle via ssh it doesn’t work.

Hi,

I think the problem is with the network adapter not working correctly in windows. The network adapter shown is “Remote NDIS compatible Device”.

Thanks

A crossover cable is a bit old school. Most modern Ethernet divides do not require this; at least I have not seen a need for one a good amount of time.

As far as connecting to the Internet, did you set the “resolv.conf” on your Beaglebone. This is described in the link I provided previously.
Ex:
echo “nameserver 8.8.8.8” >> /etc/resolv.conf

Jon

That adapter is the norm for the BBB USB "ethernet" emulation.

  How are you powering the BBB? Using USB from the host computer? If so,
you also have the USB ethernet gadget active.

  In either case, you need the BBB configured to /route/ packets to the
next node in your network. Normally that would be an internet router --
even though I've powered this BBB using the USB (and hence have the
192.168.7.x IPs active) it is also connected to my router over a CAT-5
cable. Note that the router issued the BBB 192.168.1.69, and also that the
default destination for packets is the router (ATT U-Verse service).

debian@beaglebone:~$ ifconfig
eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
        inet 192.168.1.69 netmask 255.255.255.0 broadcast 192.168.1.255
        inet6 2600:1700:e630:890:d239:72ff:fe18:3ee5 prefixlen 64 scopeid
0x0<global>
        inet6 fe80::d239:72ff:fe18:3ee5 prefixlen 64 scopeid 0x20<link>
        inet6 2600:1700:e630:890::31 prefixlen 64 scopeid 0x0<global>
        ether d0:39:72:18:3e:e5 txqueuelen 1000 (Ethernet)
        RX packets 111 bytes 13355 (13.0 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 139 bytes 23120 (22.5 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
        device interrupt 55

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10<host>
        loop txqueuelen 1000 (Local Loopback)
        RX packets 81 bytes 6556 (6.4 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 81 bytes 6556 (6.4 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 192.168.7.2 netmask 255.255.255.0 broadcast 192.168.7.255
        inet6 fe80::d239:72ff:fe18:3ee7 prefixlen 64 scopeid 0x20<link>
        ether d0:39:72:18:3e:e7 txqueuelen 1000 (Ethernet)
        RX packets 118 bytes 27503 (26.8 KiB)
        RX errors 0 dropped 4 overruns 0 frame 0
        TX packets 46 bytes 10444 (10.1 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
        inet 192.168.6.2 netmask 255.255.255.0 broadcast 192.168.6.255
        ether d0:39:72:18:3e:eb txqueuelen 1000 (Ethernet)
        RX packets 0 bytes 0 (0.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 0 bytes 0 (0.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

debian@beaglebone:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
default dsldevice.attlo 0.0.0.0 UG 0 0 0
eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
dsldevice.attlo 0.0.0.0 255.255.255.255 UH 0 0 0
eth0
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0
usb1
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0
usb0

  If you are connecting to an ethernet port on your computer, your host
computer has to also be configured to act as a router -- that is, it has to
accept packets from the BBB, and pass them on to whatever node the host has
defined as a gateway.

  THIS ACTION is not automatic for Windows! In some versions it is known
as Internet Connection Sharing (ICS), and requires configuration to "link"
the (to-be-shared) network with the devices connected to the host computer.
cf:
https://answers.microsoft.com/en-us/windows/forum/windows_10-networking-winpc/internet-connection-sharing-in-windows-10/f6dcac4b-5203-4c98-8cf2-dcac86d98fb9

  I have never done this, and have no desire to experiment with it

debian@beaglebone:~$ traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
1 dsldevice.attlocal.net (192.168.1.254) 0.741 ms 0.966 ms 0.868 ms
2 76-255-152-1.lightspeed.gdrpmi.sbcglobal.net (76.255.152.1) 26.304 ms
26.519 ms 27.412 ms
3 71.152.176.29 (71.152.176.29) 21.155 ms 21.087 ms 21.230 ms
4 cr2.cgcil.ip.att.net (12.123.7.142) 32.936 ms 32.997 ms 33.044 ms
5 gar10.cgcil.ip.att.net (12.122.133.45) 28.911 ms 29.198 ms 30.100 ms
6 12.255.10.54 (12.255.10.54) 30.498 ms 22.241 ms 23.598 ms
7 10.252.38.62 (10.252.38.62) 24.052 ms 10.252.49.190 (10.252.49.190)
23.670 ms 10.252.38.30 (10.252.38.30) 24.364 ms
8 dns.google (8.8.8.8) 25.134 ms 22.236 ms 23.141 ms
debian@beaglebone:~$ traceroute 192.168.1.66
traceroute to 192.168.1.66 (192.168.1.66), 30 hops max, 60 byte packets
1 * * *
2 * * *
3 * * *
4 * * *
5 * * *
6 *^C
debian@beaglebone:~$

  Appears my host computer is blocking traceroute, but ping is okay

debian@beaglebone:~$ ping 192.168.1.66
PING 192.168.1.66 (192.168.1.66) 56(84) bytes of data.
64 bytes from 192.168.1.66: icmp_seq=1 ttl=128 time=0.440 ms
64 bytes from 192.168.1.66: icmp_seq=2 ttl=128 time=0.473 ms
64 bytes from 192.168.1.66: icmp_seq=3 ttl=128 time=0.454 ms
64 bytes from 192.168.1.66: icmp_seq=4 ttl=128 time=0.424 ms
64 bytes from 192.168.1.66: icmp_seq=5 ttl=128 time=0.433 ms
64 bytes from 192.168.1.66: icmp_seq=6 ttl=128 time=0.424 ms
^C
--- 192.168.1.66 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 13ms
rtt min/avg/max/mdev = 0.424/0.441/0.473/0.024 ms
debian@beaglebone:~$

Hi,

Following these instructions:

I have connected the USB Cable and nothing else from the beaglebone to the PC. All of thwe windows 64 bit drivers have been successfully installed.

https://www.digikey.com/en/maker/blogs/how-to-connect-a-beaglebone-black-to-the-internet-using-usb

The initial ping to the gateway 192.168.7.1 fails when I SSH into the beaglebone (Figure 3)

Before this I have configured the “created” network adapter when I connect the USB cable named as Ethernet 3 Uidentified network “Remote NDIS Compatible Device” as

Internet Protocol Version 4 (TCP/IPv4) Properties

IP address 192.168.7.1
Subnet Mask: 255.255.255.0
Preferred DNS server: 8.8.8.8
Alternate DNS Server: 8.8.4.4

I’ve setup the Wifi Network Adapter from the PC as shared with “Ethernet 3” detailed above.

tried this command “sudo /sbin/route add default gw 192.168.7.1”

The ping still doesn’t work…

attempting this even which sudo "echo “nameserver 8.8.8.8” >> /etc/resolv.conf "

Gives permission denied however this is a step later on the process as the initial ping should work…

Thanks in advance for all your help :slight_smile:

Hi,

Following these instructions:

I have connected the USB Cable and nothing else from the beaglebone to the
PC. All of thwe windows 64 bit drivers have been successfully installed.

  Just to follow along on this part, I've pulled the CAT-5 from my BBB.

debian@beaglebone:~$ ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC> mtu 1500
        ether d0:39:72:18:3e:e5 txqueuelen 1000 (Ethernet)
        RX packets 164 bytes 13701 (13.3 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 95 bytes 15719 (15.3 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
        device interrupt 55

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10<host>
        loop txqueuelen 1000 (Local Loopback)
        RX packets 153 bytes 11380 (11.1 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 153 bytes 11380 (11.1 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 192.168.7.2 netmask 255.255.255.0 broadcast 192.168.7.255
        inet6 fe80::d239:72ff:fe18:3ee7 prefixlen 64 scopeid 0x20<link>
        ether d0:39:72:18:3e:e7 txqueuelen 1000 (Ethernet)
        RX packets 193 bytes 35656 (34.8 KiB)
        RX errors 0 dropped 4 overruns 0 frame 0
        TX packets 84 bytes 18613 (18.1 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
        inet 192.168.6.2 netmask 255.255.255.0 broadcast 192.168.6.255
        ether d0:39:72:18:3e:eb txqueuelen 1000 (Ethernet)
        RX packets 0 bytes 0 (0.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 0 bytes 0 (0.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

  No IP address on eth0, expected address on usb0.

The initial ping to the gateway 192.168.7.1 fails when I SSH into the
beaglebone (Figure 3)

  WHY a screen grab? You are using a text console, aren't you -- just
select/copy/paste the TEXT...

debian@beaglebone:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0
usb1
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0
usb0
debian@beaglebone:~$ ping 192.168.7.1
PING 192.168.7.1 (192.168.7.1) 56(84) bytes of data.
64 bytes from 192.168.7.1: icmp_seq=1 ttl=128 time=0.368 ms
64 bytes from 192.168.7.1: icmp_seq=2 ttl=128 time=0.475 ms
64 bytes from 192.168.7.1: icmp_seq=3 ttl=128 time=0.501 ms
64 bytes from 192.168.7.1: icmp_seq=4 ttl=128 time=0.491 ms
^C
--- 192.168.7.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 9ms
rtt min/avg/max/mdev = 0.368/0.458/0.501/0.059 ms
debian@beaglebone:~$

  Pinging the host computer works, even without a gateway setting (since
192.168.7.1 and 192.168.7.2 are the same network, and likely it is presumed
that all hosts on that network can be reached using the adapter [usb0] that
is itself on the network).

  If that simple step is failing, you might have to check whatever
firewall you have running on Windows.

  NEXT action I tried was opening the Windows "Network Connections"
control panel. BRIDGING "Ethernet" (remember -- My systems are normally
cable connection) and "Ethernet 2" (the RNDIS gadget) is not the correct
action, as it kills the Internet access on "Ethernet" (and there is an
advisory that one cannot bridge an ICS adapter).

  So... remove bridge, open "Ethernet" and enable Sharing, specifying
"Ethernet 2" as the private network side.

  With ICS active, Windows assigned 192.168.137.1 to the RNDIS adapter! I
just edited that to use a manual IP address 192.168.7.1, length 24, and
gateway is set to my router (192.168.1.1). (I used the "WiFi" section as
that was the control panel type I had open)
https://pureinfotech.com/set-static-ip-address-windows-10/

  SSH back into the BBB at 192.168.7.2.

  Lastly, I added a gateway on the BBB...

debian@beaglebone:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0
usb1
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0
usb0
debian@beaglebone:~$ sudo route add default gw 192.168.7.1 usb0
[sudo] password for debian:
debian@beaglebone:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
default 192.168.7.1 0.0.0.0 UG 0 0 0
usb0
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0
usb1
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0
usb0
debian@beaglebone:~$ ping 192.168.7.1
PING 192.168.7.1 (192.168.7.1) 56(84) bytes of data.
64 bytes from 192.168.7.1: icmp_seq=1 ttl=128 time=0.432 ms
64 bytes from 192.168.7.1: icmp_seq=2 ttl=128 time=0.491 ms
64 bytes from 192.168.7.1: icmp_seq=3 ttl=128 time=0.460 ms
^C
--- 192.168.7.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 5ms
rtt min/avg/max/mdev = 0.432/0.461/0.491/0.024 ms

  Okay, I didn't expect that layer to change, as that is just BBB to host
level.

debian@beaglebone:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=23.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=22.7 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=116 time=23.7 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=116 time=23.5 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=116 time=23.1 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 12ms
rtt min/avg/max/mdev = 22.723/23.281/23.677/0.362 ms

... but that shows the routing went from BBB through my host computer to my
router...

  {Now to see how difficult it is to undo all this}

For the resolv.conf permission issue, you either need to login as root, “sudo su -” or as I do just make a copy of the “/etc/resolv.conf” in a local folder, edit it, and then copy over as such:

sudo cp resolv.conf /etc/resolv.conf

Cheers,

Jon

Hi,

You are right disabling the windows firewall allowed the beaglebone to ping the windows PC. I disabled the PC wifi in order that there were no issues. Any idea how I can configure the firewall in order that the beaglebone over the usb cable is allowed through?

Thanks

Typically, Windows disables the response to ping. I would leave it that way.

To get the Beaglebone to talk to the Internet through the Windows internet connection you should not have to change anything with the firewall; I did not have to do this.
I would go back through the steps and see what is missing.

Jon

John Dyson - did you ever get this to work? I have had the same problem and can’t get it to work…