Ethernet Shield - IP address failing

Hai

My main board - Mega 2630
Ethernet shield rev 02 (original arduino)

I tried to setup the IP address, and write the IP address via serial to check.
All lights are On link act all flashing

But IP address I am getting is " 0.223.223.223". I tried to register the IP 192.168.1.107
Ping also not working.

I tried most of the troubleshooting found on forums. Pls help me

Thanks in advance
(I am very new to Arduino)

I presume you are using a Mega 2560. Can you post a link to the ethernet shield you are using?

Here is a test sketch. Compile and upload this code. What does the serial monitor show? If it shows 192.168.0.2, then the SPI bus and the SPI side of the w5100 is working, If anything else, it is failing. Check to insure the shield is seated correctly and fully into the Mega.

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

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,0,2);

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

  // disable SD card if one in the slot
  digitalWrite(4,HIGH);

  Serial.println("Starting w5100");
  Ethernet.begin(mac,ip);

  Serial.println(Ethernet.localIP());
}

void loop() {
}

Thank you for your support.

I tried ur code, but no hope see the attached snaps
shield fixed tightly … no Gap
I am getting IP address

0.239.239.239 …!

SPI bus side and all seated properly, is it required to connect 50, 51 and 52 ?
Snaps attached

Thanks
Anwar

That is because that shield is from Arduino.org, not Arduino.cc. That model has a w5500 controller on it. It requires a different library.
GitHub - Wiznet/WIZ_Ethernet_Library: WIZnet Ethernet Library

WOW>>>>>>

THANK YOU...

Now i got my IP .....

THANKS THANKS THANKS