How do I set up the ethernet on Arduino NOT using DHCP ?


I have scoured the internet but cannot find an answer.

I have a project running that sends data via the Ethernet port shield on my Arduino. This is working faultlessly but I have run out of program space in the Arduino to add more functions that I need to add.

I have read that using DHCP uses a lot of code.

What do i need to add to my program to get it to communicate with HTTP port 80 without using DHCP ?



Pseudo code below

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

 byte server[]         = {192,168,1,64};                                                        
 byte ip[]               = {192,168,1,1};                                                       // *** All must be unique ***
 byte mac[]            = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };                  // *** All must be unique ***
 byte gateway []    = { 192,168,1,254};   

void setup() 

  EthernetClient ethClient(80);                                                               // IS THIS CORRECT
  Ethernet.begin(mac, ip, gateway);

This is how this should be set up.

  Ethernet.begin(mac, ip, gateway, gateway);

I know it looks redundant, but the first "gateway" ip is for the dns, and the second is the gateway. Otherwise, it assigns as the gateway, and that is your ethernet shield ip, not the router gateway.