-1

New to Pi, but want to be able to connect two Pi’s together using an ethernet and communicate with each other.

How would I do this?

4
  • a Raspberry Pi is a computer, similar to a PC or a Mac ... your question is not specific to the RPi ... it is a linux question
    – jsotola
    Commented Nov 18, 2021 at 18:18
  • Yes I know they will take ethernet’s but is there any configuring of IP’s needed between one and another?
    – T Gibson
    Commented Nov 18, 2021 at 18:19
  • maybe yes, maybe no ... have you connected both RPis to your LAN? ... are you able to browse the internet with each one? ... it seems like you are asking before you even tried anything
    – jsotola
    Commented Nov 18, 2021 at 18:24
  • Depends what you mean by "communicate" . If you connect 2 Pi you can ssh although it is easier to use your router.
    – Milliways
    Commented Nov 18, 2021 at 21:12

1 Answer 1

0

If you connect them with a simple CAT5 cable (568A to 568A or 568B to 568B, no crossover needed) then assign an IP address on each end of the link it will "just work".

The system will assign an IP address from 169.254.xxx.xxx automatically by default, but that's a pain as you have to find the new IP address each time you reboot either system. Setting a static IP address is easy.

Use sudo ip addr add 192.168.137.1 dev eth0 on one RPi and sudo ip addr add 192.168.137.2 dev eth0 on the other to give them both fixed IP addresses.

Or add these lines in /etc/dhcpcd.conf (on RPi1)

interface eth0
static ip_address=192.168.137.1/24
static routers=192.168.137.1

and these lines on RPi2

interface eth0
static ip_address=192.168.137.2/24
static routers=192.168.137.2

Reboot or restart dhcpcd5 to get those new fixed IP addresses activated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.