Static ip on eth0

55 views
Skip to first unread message

Johan Ingvast

unread,
Feb 3, 2021, 11:12:29 AM2/3/21
to BeagleBoard
Hi
I use Debian 10.3 on a beaglebone enhanced industrial and try to configure eth0 to a static ip.
https://wiki.debian.org/NetworkConfiguration  claim /etc/network/interfaces should have the lines
   auto eth0
   iface eth0 inet static
       address 192.168.10.156
       netmask 255.255.255.0
       gateway 192.168.10.1

the commands ifup and ifdown should then take care of the switching.

$ ifdown eth0
results in an error 
   ifdown: interface eth0 not configured

When I reboot, I do get the right address and everything seem to work.
However the service networking.service gets an error.

Interestingly, the original version of /etc/network/interfaces does not mention eth0, yet it starts correctly. Is there some other mechanism starting it? 

What is the correct way of configuring static ip for eth0?

best
Johan Ingvast

Johan Ingvast

unread,
Feb 3, 2021, 12:08:44 PM2/3/21
to BeagleBoard
I think I found the solution.  
Debian for BB uses connman for handling eth0.

So what I had to do was 
As root
Find the service name by
        $ connmanctl services
It will output something like
        *AR Wired                ethernet_d05fb8efd72f_cable
The latter part will be used as reference to what to change
        $ connmanctl config --ipv4 manual 192.168.10.156 255.255.255.0 192.168.10.1
Where the order of the addresses are: ip netmask gateway
If you are on ethernet you will loose contact (in case the ip is changed), connect again with the new address.
You also need to change the nameservers (better to do before)
        $ connmanctl config --nameservers 8.8.8.8   4.4.4.4

jonnymo

unread,
Feb 3, 2021, 2:28:08 PM2/3/21
to Beagle Board
Yeah, this pops up from time to time so perhaps there is a way to make it sticky or something.
Ex:

Or:


Cheers,

Jon 


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/81b13002-aebc-46bf-b4ea-c53195695105n%40googlegroups.com.

Ren Waldura

unread,
Feb 3, 2021, 5:40:28 PM2/3/21
to beagl...@googlegroups.com
Helpful, thank you!
Why must the nameservers be changed?? I thought it was a property of the host, not the interface.


Johan Ingvast

unread,
Feb 4, 2021, 3:17:07 AM2/4/21
to BeagleBoard
Correction, the command lines came out wrong. Should be 
     $ connmanctl config   ethernet_d05fb8efd72f_cable   --ipv4 manual 192.168.10.156 255.255.255.0 192.168.10.1 

and
     $ connmanctl config   ethernet_d05fb8efd72f_cable   --nameservers 8.8.8.8   4.4.4.4  

/johan

Johan Ingvast

unread,
Feb 4, 2021, 3:19:09 AM2/4/21
to BeagleBoard
Maybe they do not have to be changed. I guess it depends on what nameservers were from beginning. I just noted that when I set the new ip, I lost dns.
However, I did not try a reboot before I set the new nameservers.
/johan

Reply all
Reply to author
Forward
0 new messages