Assign a static IP?

My YunoHost server

Raspberry Pi 4B
YunoHost version:
I have access to my server:

  • Through SSH
  • through the webadmin

Hi everyone,

How do I set a static IP?

I’ve tried:

sudo nano /etc/network/interfaces

then adding this:

# The primary network interface
allow-hotplug eth0
iface eth0 inet static

But it doesn’t work after a restart.

Changing the /etc/dhcpcd.conf also doesn’t work.

What am I doing wrong?

Thank you in advance.

Why did you remove the template on support topics ?
In your case, the YunoHost version can be quite important.

Are you sure about eth0 ?

That is the same thing as I have at home, but with another interface.

You can check the interfaces using ip a

(Or you can stay in DHCP and configure the DHCP server to assign a static IP to this machine)

1 Like

I’m sorry, I edited the initial post.

Running ip a revealed that it’s “eth0” (it’s lo, eth0and wlan0).

1 Like

Ok, my fault, I’ve edited the /etc/dhcpcd.conf again and this time it worked. Must’ve made a mistake before.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.