Could i ask why didnt you implement DHCP?
Well:
- using dhcp makes your code bigger when you upload the sketch
- sometimes it doesn't pick up an IP
- this way you know exactly what ip, subnet, gateway and DNS you are using
But:
- if you want, you can just erase this:
byte ip[] = { 192,168,1,20}; //change this
byte subnet[] = {255,255,255,0}; //change this
byte gateway[] = {192,168,0,1}; //change this
byte dns[] = {192,168,0,1}; //change this
and replace this:
Ethernet.begin(mac, ip, dns, gateway, subnet);
with this:
Ethernet.begin(mac);
Arduino IDE will then auto include dhcp and your Arduino will use dhcp when started (or it should)