3

I wanna connect two RPis together with an ethernet cable. I did it and test with ping function and it works, I can communicate.

But for my task I have to be sure that the IP addresses are static on eth0, I don't know if it's the case. Moreover I would like to chose them myself because they don't follow the same pattern (one is 169.254.62.28 and the other 169.254.226.136).

I checked on Google and it seems I have to modify the file /etc/dhcpcp.conf, but all the information I found is when the Pi is connected to a switch/router. So, I don't know what I have to put for this 2 data:

#static routers=?
#static domain_name_servers=?

Can I just modify static ip_address ignoring the previous ones?

Thanks in advance for your help.

Dark Patate
  • 211
  • 2
  • 10

1 Answers1

1

169.254. are Link-local addresses and are usable for the purpose you outlined.

They ARE NOT Static IP addresses.

Indeed you don't NEED to know the addresses, hostname.local will work (each Pi should have a unique hostname).

You CAN define Static IP addresses if you want, but you should specify nogateway to prevent these from interfering with routing and there is obviously no need to specify routers or domain_name_servers.
See Advanced dhcpcd Configuration in How to set up networking/WiFi

Milliways
  • 62,573
  • 32
  • 113
  • 225