Ethernet shield DHCP on Cisco Linksys E1200

I have a problem with my Cisco Linksys E1200 router. My Ethernet Shield doesn't get IP address from its DHCP server. I am using standard sketchbook from examples:

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
void setup()
{
Serial.begin(9600);
EthernetDHCP.begin(mac, 1);
}

Another problem is, that even when I fix the IP address I can not access internet servers on internet site. The sketch is working on local server in LAN area (also using standard sketchbook from examples).
If I change the Linksys router some low cost router (Buffalo, Ausus) everything works fine.

Anybody has same problem, any ideas how to fix this?

Regards
Peter Kolar

What IDE version are you using? This is for v1.0.1 or later. Upload it and open the serial monitor.

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

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEA };

void setup()
{
  Serial.begin(9600); 

  // disable SD SPI if memory card in the uSD slot
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  Serial.print("Starting w5100...");
  if(!Ethernet.begin(mac)) Serial.println("failed");
  else Serial.println(Ethernet.localIP());
}

void loop() {

}

Does it get an ip?

It does not get an IP.
I tried version 0.22 and 1.0.1. The same problem in both versions.

Have you checked the setup in the router?

Yes. But I doesn't know what to change. All other devices work without problem (desktops, laptops, mobile phones, Sony TV and Audio device ...). I can see them in routers DHCP table. But not my Arduino shield...

Try this sketch. Does the serial monitor display the ip as 192.168.2.2?

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

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

IPAddress ip(192,168,2,2);

void setup() {
  Serial.begin(9600);

  // disable SD SPI
  pinMode(4,OUTPUT);
  digitalWrite(4,HIGH);

  // Start ethernet
  Serial.println("Starting ethernet...");
  Ethernet.begin(mac, ip);
  digitalWrite(10,HIGH);
  Serial.println(Ethernet.localIP());

  Serial.println("Ready");
}

void loop() {
}

edit: I know you want to use DHCP, but this is testing the communication between the w5100 and the Arduino.

If ip = 192.168.2.2, the w5100 is working.
If ip = 0.0.0.0, the w5100 has failed.

Your ethernet shield has a w5100 IC, and not enc28j60, correct?

edit2: My bad. I see by your first post it works with other router models. I don't have any experience with that particular router.

Hi kolarp,

I have the same problem (I am using enc28j60 ethernet board) with my Cisco Linksys E1200 router and everything is OK with another brand of router. However after changing the first value of the MAC address I was assigning to my ethernet board from "0xDD,0xDD,0xDD,0x00,0x00,0x01" to "0x00,0xDD,0xDD,0x00,0x00,0x01" everything goes OK.