i think you misunderstand what client and server are. these exist on the arduinos and are used to communicate between arduinos (it's not clear to me that you need both or just a client to send and received msgs)
i use esp32 board which support WiFi and open WiFi server to receive messages and a WiFi client to send msgs (when using Linux i would open a socket to do the same thing, so i'm confused about the Arduino approach).
but you are using an Ethernet shield and presumably need an Arduino Ethernet server and client, (see the Arduino Ethernet reference, but i'm confused about their examples)
i strongly recommend finding some example code
in my case, when i connect to a WiFi router, the esp32 is assigned an IP address. in other words the board gets the IP address from the router. i believe the same is true for the Ethernet library.
the next step is to open a connection to an IP application on some other device. to do so, the IP address and "port" number for the application is needed.
there are several ways to do things, which makes things confusing (find some example code)
i have some older code where i have WiFiClient and can use it to write/print msgs or check if a received msg is available() and read() bytes.
in other cases, i have a server with a callback function that processes any received messages. a 3rd way to to check for a new server connection and then start monitoring that.
as mentioned earlier, i believe your first step, since you're using a router is to connect to the router and determine the local IP address of that device, Ethernet.localIp()
once you know the assigned address for each device try to connect to the other arduino using it's IP address and a port you define.
client.connect(), and obtain an IP address.