can't setup ethernet 2 shield

Is there a new sketch for arduino ethernet 2 shield? as existing one freezes with “Trying to get an IP address using DHCP”

iArduino Ver 1.0.ino (14.9 KB)

The Ethernet Shield 2 uses the W5500 Ethernet controller chip instead of the W5100 chip on the Ethernet Shield. The Ethernet library is not compatible with the W5500. If you’re using the arduino.org IDE then you can just change line 30 in your sketch to:

#include <Ethernet2.h>

If you’re using the arduino.cc(this website) IDE, which I would highly recommend then you only need to install an Ethernet library that supports the W5500. There are a few choices:

Ethernet2 library - this is the same library included with the arduino.org IDE

EthernetMod W5x00 branch - This supports W5100, W5200, and W5500 without needing any modifications
GitHub - per1234/EthernetMod at W5x00 follow the installation instructions on that page, you don’t need to make any changes to your current sketch.

Wiznet Ethernet Library - GitHub - Wiznet/WIZ_Ethernet_Library: WIZnet Ethernet Library this is already set up to support the W5500 but the installation is slightly complicated so let me know if you want to install that one and need help with installation.