Arduino Ethernet Shield can't ping

Hi everyone!
I bought an Arduino Ethernet Shield without POE module.
I proved with this sketch to connect the ethernet shield but when I prove to ping the arduino ip, I can’t ping it.

This is the code:

#include <String.h>  
#include <SPI.h>  
#include <Ethernet.h>  
  
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xAC, 0x68 };   
byte ip[] = { 192, 168, 0, 10 }; // indirizzo IP della shield
 
//creo una variabile char per memorizzare i byte letti dal client
char Data_RX;
 
//creao un oggetto server che rimane in ascolto sulla porta
//specificata
EthernetServer ArduinoServer(80);
 
void setup()
{
    //inizializza lo shield con il mac e l'ip
    Ethernet.begin(mac, ip);
    //inizializza l'oggetto server
    ArduinoServer.begin();
}
 
void loop()
{
    //fai qualcosa!
    delay(10);
}

What’s the problem?
thank you and sorry for my bad English

What is the ip assigned to the computer you are trying to ping with?

Try this sketch. Does it print “IP is 192.168.0.10” on the serial monitor?

#include <SPI.h>  
#include <Ethernet.h>  
  
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xAC, 0x68 };   
IPAddress ip( 192, 168, 0, 10 );
 
void setup() {
    Serial.begin(9600);
    Ethernet.begin(mac, ip);
    Serial.print("IP is ");
    Serial.println(Ethernet.localIP());
}
 
void loop() {
}

The ip assigned to the computer I'm trying to ping is 192.168.0.4, my router ip is 192.168.0.1

I tryed that sketch and it print "IP is 192.168.0.10" on the serial monitor

Good. The SPI bus connection to the w5100 is working. Try this sketch. See if the arduino gets an ip from a dhcp server. Does it display “dhcp failed” or “IP is 192.168.0.x”? The ‘x’ will be a number.

#include <SPI.h>  
#include <Ethernet.h>  
  
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xAC, 0x68 };   

void setup() {
    Serial.begin(9600);
    if(!Ethernet.begin(mac)) Serial.println("dhcp failed");
    else {
       Serial.print("IP is ");
       Serial.println(Ethernet.localIP());
    }
}
 
void loop() {
}

It could take a couple minutes to display “dhcp failed”. It must wait for the dhcp request to timeout.

The serial monitor said "IP is 192.168.0.8"

OK, ping that ip.
ping 192.168.0.8

it ping!!

but if is use this sketch with ip=192.168.0.8 can’t ping.

#include <String.h>  
#include <SPI.h>  
#include <Ethernet.h>  
  
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xAC, 0x68 };   
byte ip[] = { 192, 168, 0, 8 }; // indirizzo IP della shield
 
//creo una variabile char per memorizzare i byte letti dal client
char Data_RX;
 
//creao un oggetto server che rimane in ascolto sulla porta
//specificata
EthernetServer ArduinoServer(80);
 
void setup()
{
    //inizializza lo shield con il mac e l'ip
    Ethernet.begin(mac, ip);
    //inizializza l'oggetto server
    ArduinoServer.begin();
}
 
void loop()
{
    //fai qualcosa!
    delay(10);
}

That is not a surprise to me. That ip is within the dhcp range for that router. Many routers will not recognize a static ip that is within the dhcp ip range. If you want to set a static ip, you must use one outside the dhcp range. Log in to your router and check what ip range the dhcp server issues, then pick an ip outside that range. Usually the routers have a few ips on each end of the range you can use for static ips.

thank you very much man!