请问如何将RockPi S的eth0设置为静态IP

我目前在应用RockPi S,目前eth0工作在DHCP模式下,没有问题。但现在需要使用静态的IP,我在RockPi的etc/network文件夹里没有找到interfaces这个配置文件。请问我需要如何配置呢?

急需方法,盼望各位大神帮助,非常感谢!

auto eth0
iface eth0 inet static
address 192.0.2.7/24
gateway 192.0.2.254

Something like that in /etc/network/interfaces
Don’t think debian has gone the way of Ubuntu with networking and you can just create a conf.

Thank you!
Seems like network service is not able to run base on the newest released image.
I am trying to get it work through Network-Manager. If any luck to work I will reply.

1 Like

Have they moved to netplan also?
https://netplan.io/examples

Hi netplan should be able to set static IP if we installed it.

For me I tried this Network-Manager, it works for me if I type:

nmcli con mod connection_name ifname eth0 type ethernet ip4 10.x.x.x/24 gw4 x.x.x.x
nmcli con mod connection_name ipv4.address 10.x.x.x
nmcli con mod connection_name ipv4.method manual
nmcli con mod connection_name connection.autoconnect yes
nmcli con up connection_name

1 Like