Enable SSH over ethernet without USB.

I’m facing an issue enabling SSH on my Beaglebone Black via Ethernet when powered by a 5V adapter to the DC jack. Currently, I can only enable SSH when the Beaglebone Black (BBB) and my PC are connected via USB. When connected via USB, both USB0 and ETH0 interfaces on the BBB work, with IPs assigned (PC: 192.168.7.1, BBB: 192.168.7.2 for USB0; BBB: 192.168.100.2 for ETH0).

However, when I power the BBB via the 5V adapter and connect it to my PC via Ethernet, SSH isn’t accessible. To enable SSH over Ethernet, I’ve added the following configuration to the /etc/network/interfaces file (to assign a static IP for eth0).

auto eth0
iface eth0 inet static
    address 192.168.100.2
    netmask 255.255.255.0
    network 192.168.100.0

What could be causing this issue, and how can I resolve it ?

Regards,
Aji Mathew.

Make sure you are on the same subnet ( xxx.xxx.subnet.xxx);

Also assuming you are trying to connect by direct eth to eth to host, nothing between both devices.
Set your host to static IP (xxx.xxx.subnet.different that target) in the same subnet, mask 255.255.255.0, gateway 192.168.subnet.1

Also remove the network line in your eth0 config.

This is much easier if you are running debian or ubuntu on the host, native. If in a VM make sure your networking is configured for bridge mode (vmware) it would be similar for virtualbox.

If in a VM

$ip route

to verify your host’s IP.

On your debian / ubuntu host

$sudo apt install net-tools

That will install ifconfig
then you will have more information regarding the network

$ifconfig

debian:

$sudo ifconfig
1 Like

Don’t forget you can always log in via the 6 pin serial console connector and have a look around…

1 Like

Out of the box the ethernet is setup to use DHCP.

As you have found connecting directly to your PC you must set a static IP address.
You will also need to set a static IP address on your PC for the ethernet.
Both must be on the same subnet. Don’t use the same subnet as any other adaptor on your PC.
Everything should then work.

If you want to access other subnets from the BBB then your PC will need to forward packets.

2 Likes

I removed the network line in my eth0 config, and it worked perfectly. Thank you so much!

Regards,
Aji Mathew

Can I share internet via the same ethernet ? How can I do it??

I enabled wifi sharing on windows PC and added nameserver 8.8.8.8 in /etc/resolv.conf file .
When I try to ping google I get the following error.

debian@BeagleBone:~$ ping google.com
ping: google.com: Temporary failure in name resolution`

Regards,
Aji Mathew

You are getting that error because the BBB can’t reach the name server.

Make sure you have a default gatway set on Linux to be the IP address of the PC.

do route -n or ip route on the BBB to check this

But this is probably 99.99% to do with Windows Internet sharing/firewall/AV blocking packets being forwarded.

1 Like

I am not much help regarding how to connect via a windows box, we only have a few machines that actually run windows, sorry.

A simple solution would be if you need to install apt packages onto the target. Just connect your bbb to your internet router via cable, you “should” be able to connect even with the different subnet. Use a keyboard and monitor to down load then reconnect to your host.

1 Like