Not able to access INTERNET in BBB from ethernet cable when assigning static IP to BBB

Hello,
I’m trying to use a static IP address to access the Internet in BBB.
while dhcp works properly with the internet.
Static IP is successfully assigned to BBB but unable to ping www.google.com or ping 192.168.2.103

My windows PC [IP: 192.168.2.103]
VmWare(ubuntu 22.04) [static IP: 192.168.2.104]
BBB [IP: 192.168.2.105]
Bridged connection is applied inside VmWare Network Controller.

Screenshot from 2024-07-28 21-46-33


Screenshot from 2024-07-28 21-49-22

# uname -r                                                                                                                                     
6.7.0                                                                                                                                          
# ifconfig                                                                                                                                     
eth0      Link encap:Ethernet  HWaddr 04:A3:16:B0:0B:58                                                                                        
          inet addr:192.168.2.105  Bcast:0.0.0.0  Mask:255.255.255.0                                                                           
          inet6 addr: fe80::6a3:16ff:feb0:b58/64 Scope:Link                                                                                    
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                                                                                   
          RX packets:23 errors:0 dropped:0 overruns:0 frame:0                                                                                  
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0                                                                                
          collisions:0 txqueuelen:1000                                                                                                         
          RX bytes:2290 (2.2 KiB)  TX bytes:796 (796.0 B)                                                                                      
                                                                                                                                               
lo        Link encap:Local Loopback                                                                                                            
          inet addr:127.0.0.1  Mask:255.0.0.0                                                                                                  
          inet6 addr: ::1/128 Scope:Host                                                                                                       
          UP LOOPBACK RUNNING  MTU:65536  Metric:1                                                                                             
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0                                                                                   
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0                                                                                 
          collisions:0 txqueuelen:1000                                                                                                         
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B) 

/etc/network/interfaces looks like:

# sudo cat /etc/network/interfaces                                                                                                             
# interface file auto-generated by buildroot                                                                                                   
                                                                                                                                               
auto lo                                                                                                                                        
iface lo inet loopback                                                                                                                         
                                                                                                                                               
auto eth0                                                                                                                                      
iface eth0 inet static                                                                                                                         
  address 192.168.2.105                                                                                                                        
  netmask 255.255.255.0                                                                                                                        
  gateway 192.168.2.1                                                                                                                          
  dns-nameservers 8.8.8.8 8.8.4.4

Try this:

iface eth0 inet dhcp
address 192.168.2.105

Not a good plan, however some of the networking equipment is not consistent and the board implementation are not consistent.

You might also be blocked by your gateway/router’s mac authentication. That case you need admin access and will have to manually omit the original log in when it was pure dhcp and assigned an ip.

1 Like

Hi @foxsquirrel,
I tried this one but I am getting 192.168.137.207 ip address insteed of 192.168.2.105

I need a static ip.

You must be on the wrong subnet, what is the actual ip address of the gateway and the host you are on? It it assigned you .137.xxx set your static at 192.168.137.105. Also be very carefull with what you are doing.

It appears with the high numbers you are on a fairly large network. When you assign a static you will break stuff, if this is at work or school stop and get your sysadmin to help. If you break the network you will more than likely get fired.

It’s my personal PC,
@foxsquirrel Can you help me out to get any ip from 192.168.2 subnet ?
my goal is to get same subnet ip for ubuntu and BBB with internet functionality.

Thanks & regards
casabianca

Not sure what you are trying to achieve. Set you static ip on the same subnet as your gateway, connect board to gateway then ping it with your host connected to the same gateway. If you are trying to tether it from your host that is a different setup, sorry.

1 Like

Thanks @foxsquirrel :+1:

make sure on bbb, your
/etc/resolv.conf
contains
nameserver 192.168.2.1
assuming your routers address is this.

I think @amf99 is onto something.

Can you ping your gateway, using ip notation?
It could be something as “simple” as DNS not being able to resolve…

on BBB, if the dhcp can not obtain a valid ip, it will set a bogus one, like what your seeing

1 Like

inside /etc/resolv.conf there is nothing So I wrote nameserver 192.168.2.1 but everytime when I restart BBB resolv.conf is blanked. And still internet in not working.

Resolv.conf is normally dynamically generated.
What OS version are you running
The latest version uses systemd for networking and dns. Older versions you will need to edit the network/interfaces file. You can add your dbs nameservers in there and they will automatically get added to resolv.conf

## Booting kernel from Legacy Image at 80008000 ...                                                                                            
   Image Name:   Linux-6.7.0                                                                                                                   
   Created:      2024-07-28   0:27:19 UTC                                                                                                      
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                                                         
   Data Size:    7081744 Bytes = 6.8 MiB                                                                                                       
   Load Address: 80008000                                                                                                                      
   Entry Point:  80008000                                                                                                                      
   Verifying Checksum ... OK                                                                                                                   
## Flattened Device Tree blob at 88000000                                                                                                      
   Booting using the fdt blob at 0x88000000                                                                                                    
   Loading Kernel Image                                                                                                                        
   Loading Device Tree to 8ffeb000, end 8ffff1df ... OK                                                                                        
                                                                                                                                               
Starting kernel ...
# uname -a                                                                                                                                     
Linux vishant 6.7.0 #1 SMP Sun Jul 28 05:57:01 IST 2024 armv7l GNU/Linux 

here’s a link that talks about how to up date that

i’m so use to just have a script to modify it at boot time. sorry, maybe the above link will help

1 Like

Ok when I said OS I meant are you running the stock Debian image or did you compile your own image using Yocto or Buildroot ?

Assuming you are running stock Debian, you are most likely running systemd.

So first check that by running as root (or using sudo)

systemctl status systemd-networkd
and
systemctl status systemd-resolved

If running the systemd services I have found it better to create a .network file in /etc/systemd/network rather than using the /etc/network interfaces file.

So if running systemd for comment out the section in /etc/network.interfaces file for eth0 but adding a # to the start of every line.

Then in /etc/systemd/network create the file eth0.network
edit it and add ( different versions of systemd might change the syntax/options )

[Match]
Name=eth0

[Network]
Address=192.168.2.105/24
Gateway=192.168.2.103
DNS=8.8.8.8

save the file and restart networking - systemctl restart systemd-networkd
restart systemd-resolved - systemctl restart systemd-resolved
check the ip address is set correctly ip -br a
check dns is set correctly - resolvectl or systemd-resolve --status

make sure you can ping 192.168.2.103 - if the address is set correctly this should work
make sure you can ping 8.8.8.8 - if this doesn’t work you need to look at VmWare settings or firewall
check DNS by doing a ping google.com - if you can ping 8.8.8.8 this should work