Yunohost Raspberry Pi, how to assign a fixed IP to a peripheral

Discuss

Hi,

I am using Yunohost on a Raspberry Pi 5, connected to my Livebox.

I also have a Le Potato card Le Potato – LoveRPi on which is running Debian GNU/Linux 11 (bullseye) with BirdnetPi GitHub - Nachtzuster/BirdNET-Pi: A realtime acoustic bird classification system for the Raspberry Pi 5, 4B 3B+ 0W2 and more. Built on the TFLite version of BirdNET.

This Le Potato card is connected to my YH Pi via WiFi. I would like to assign a fixed IP to this Le Potato card so that it always have the same IP adress in my YH Pi.

What is the best way to do that?

Thank you.

Hello Arnauld!

Usually, a fixed IP address can be assigned to the MAC address of the wifi device of your Potato in the administration page of your router. It’s the easiest way to do it.
The other way around (and surely the worse one) would be, to assign a fixed IP address in your Potato and add it to the /etc/hosts of your YNH Pi and any other device that needs connection to that Potato.

1 Like

Add the MAC address of the Le Potato as fixed IP to the DHCP server of the WiFi access point and restart the network.

1 Like

The problem is that the the WiFi access point is the Pi running Yunohost…

Are you running the WiFi Hotspot App of the App Store?

Yes.

you can edit the /etc/network/interfaces file of the device to setup its network configuration

for example:

 auto ens3
 iface ens3 inet static
     address 192.168.0.42
     netmask 255.255.255.0
     gateway 192.168.0.254
     dns-nameservers 192.168.0.254
 iface ens3 inet6 static
     address 2a01::bbbb/64
     gateway fe80::aaaa
     dns-nameservers fe80::aaaa
1 Like