Page 1 of 1

Connecting 2 Pies together using Ethernet cord?

Posted: Fri Jan 10, 2020 2:23 pm
by Botspot
What would this setup do?
piconnected-min.png
piconnected-min.png (125.89 KiB) Viewed 395 times
Would the Pies be able to see each other on a local network, or would absolutely nothing happen? If they could see each other, could one connect to the other using VNC or SSH?

Re: Connecting 2 Pies together using Ethernet cord?

Posted: Fri Jan 10, 2020 2:29 pm
by trejan
The Ethernet link should come up as the LAN7515 Ethernet chip on the Pi 3B+ supports auto MDI/MDI-X so a special crossover isn't needed. Just plugging in a regular network patch cable should work.

If you configure both with a static IP address then they should be able to communicate with each other as well. Otherwise you'd need to setup a DHCP server on one of the Pi boards.

Re: Connecting 2 Pies together using Ethernet cord?

Posted: Fri Jan 10, 2020 2:46 pm
by DougieLawson
Easiest way to get the RPis to see each other is make one the master.

Assign a fixed IP address in /etc/dhcpcd.conf on that master machine.
Run dnsmasq as a DHCP server on that master machine.

The other Raspberry will get a DHCP address from the range you've got in dnsmasq.conf.

/etc/dhcpcd.conf

Code: Select all

option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
require dhcp_server_identifier
slaac hardware
nohook lookup-hostname
interface eth0
static ip_address=192.168.3.14/24
static routers=192.168.3.14
static domain_name_servers=192.168.3.14 8.8.8.8
/etc/dnsmasq.conf

Code: Select all

interface=eth0
dhcp-range=192.168.3.141,192.168.3.142,255.255.255.0,24h
So the master RPi will have an address 192.168.3.14 and the other RPi will either be 192.168.3.141 or 192.168.3.142.

Re: Connecting 2 Pies together using Ethernet cord?

Posted: Sat Jan 11, 2020 3:19 am
by LTolledo
one other way, as I did in my previous test, is to assign each RPi with static IP address
RPi1: 192.168.3.141
RPi2: 192.168.3.142

if RPi2: 192.168.4.142, both RPis may mot be able to communicate with each other.

Re: Connecting 2 Pies together using Ethernet cord?

Posted: Sun Jan 12, 2020 6:57 am
by DougieLawson
My way has an advantage. If you connect a small switch (five port in my case) between the two raspberries and connect your laptop to the switch it will also get a DHCP IP address. You can then use it to ssh into either of the raspberries.

https://www.amazon.co.uk/NETGEAR-GS205- ... B00AYRZYG4