Arduino-Arduino LAN communication - client not connecting to server

(@Nick Gammon: I am with you 100%, for both posts)

(@zoomkat: If anyone has more experience please step in. How I understand it is:

Each device that connects to a network has to have a globally unique MAC address. If only one arduino is present in the network it makes no difference what the MAC address is, as long as this address does not belong to another device, which is super highly unlikely. It is the second device that introduces the problem. This is why all code available works well with the "default" or "place holder" MAC.

However, it is highly recommended that you CHANGE THE MAC ADDRESS to the Shield sticker value or a true random number before this device starts connecting to other arduino boards or the internet. MAC addresses are intended to be a permanent, device specific, globally unique identifier. When you start having thousands or millions of devices with the same "unique" MAC it smells trouble.)

Hope that makes sense. And now it is with great pleasure that I present to you a more permanent solution, using EEPROM to save and retrieve the last three bytes of the MAC address. I read somewhere that the first three bytes are specific to the organisation, so I only change the last three. For those bytes I used http://www.random.org/ to initialise three values from 0 to 255, once and for all for each Arduino board.

OK, it is not the automatic S/N specific address I would have liked, but setting up three numbers each time you buy a new board is not too bad either! Hope it helps!

/*

  EEPROM MAC address
  
  This sketch saves the three last bytes of MAC to the first 
  three positions in EEPROM so that it can later be retrieved 
  for Ethernet connectivity. It is very important to have a 
  unique MAC addresses for each Arduino board, otherwise the 
  boards may fail to connect unexpectedly.
  
  created 14 Nov 2012
  by Dimitris Kallergis

*/

#include <SPI.h>
#include <Ethernet.h>
#include <EEPROM.h>

//Keep the first definition in comments.
//Use it only to initialise EEPROM MAC on a new Arduino
//Update the last three bytes before use
//Values accepted: decimals 0-255 or 2 hex digits
//Only use unique or random values
//Please do NOT use 0xEF, 0xFE, 0xED!
//byte mac[] = { 0xDE, 0xAD, 0xBE, 255, 255, 255 };

//The last three bytes will be filled in by EEPROM data 
byte mac[] = { 0xDE, 0xAD, 0xBE, 0x00, 0x00, 0x00 };

void setup()
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial)
  {
    ; // Wait for serial port to connect. Needed for Leonardo only
  }
  
  if (!EEPROMMAC()) // Read/Write/Check EEPROM MAC
  {
    Serial.println("EEPROM MAC failed. Set MAC address.");
    while(true); //do nothing forevermore
  }
  
  Serial.println
  (
    "MAC: " 
    + String(mac[0],16) + ':' 
    + String(mac[1],16) + ':' 
    + String(mac[2],16) + ':' 
    + String(mac[3],16) + ':' 
    + String(mac[4],16) + ':' 
    + String(mac[5],16)
  );
  
  Ethernet.begin(mac);
  
  Serial.println(Ethernet.localIP());

}

void loop()
{
}

boolean EEPROMMAC()
{
  if (!(mac[3] | mac[4] | mac[5])) //MAC to be filled in by EEPROM
  {
    mac[3] = EEPROM.read(0);
    mac[4] = EEPROM.read(1);
    mac[5] = EEPROM.read(2);
    if(!(mac[3] | mac[4] | mac[5])) //all values 0
      return false;
    if((mac[3] & mac[4] & mac[5]) == 0xff) //all values 255 (0xff)
      return false;
  }
  else
  {
    //do not write to EEPROM if nothing changes
    //be careful about how often you write to it
    if (EEPROM.read(0) != mac[3])
      EEPROM.write(0, mac[3]);
    if (EEPROM.read(1) != mac[4])
      EEPROM.write(1, mac[4]);
    if (EEPROM.read(2) != mac[5])
      EEPROM.write(2, mac[5]);
  }
  return true;
}

I call it EEPROMMAC ...and it holds 2^24 - 2 = 16777214 values, or should I say 16777213!