#include <Ethernet.h>

// the media access control (ethernet hardware) address for the Galileo:
byte mac[] =   { 0x98, 0x4F, 0xEE, 0x01, 0x0D, 0x0D }; // <--- MAC: 984FEE004D0F

//the IP address for the Galileo:
byte staticIp[] = { 192, 168, 1, 1 };

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("Attempting to start Ethernet");

  if(Ethernet.begin(mac) == 0) 
  {
    Serial.println("Failed to configure Ethernet using DHCP");
    Serial.println("Attempting to configure Ethernet using Static IP");
    Ethernet.begin(mac, ip);    
  }

  Serial.print("Galileo IP address: ");
  Serial.println(Ethernet.localIP());
  
  system("telnetd -l /bin/sh");  // Start the telnet server
}

void loop() {
  // put your main code here, to run repeatedly:

}
