linking two arduino via LAN

Good day.

just a little help..

I am thinking of connecting two unos in the network using the ethernet shield. the idea is a button switch is connected to one arduino and a relay is connected to another arduino. If the button switch is pressed at one arduino the relay at another arduino should trigger.

Any suggestion as how to do this.. Thanks a lot

How far apart are they? Maybe LAN is overkill.

as far as 500 meters.. the two unos will be in one VLAN. thanks you

See this tutorial;

I suggest the two Arduinos communicated regularly, whether or not the button changes state, and that you define what to do if the communications fail.

Many thanks sir for the suggestion and the link.