Using the UdpNtpClient example with a static arduino IP

The example at http://arduino.cc/en/Tutorial/UdpNtpClient works fine. When I set a static IP and start ethernet with: Ethernet.begin(mac, ip) instead of Ethernet.begin(mac) it no longer works. DHCP somehow delivers the NTP packets to the arduino correctly. Skipping DHCP the example doesn't work. I set my router to map port 8888 to the arduino static IP and the same port (using: nat mapadd intf=Internet inside_addr=10.0.0.30 outside_port=8888 inside_port=8888), I even tried mapping port 123 to the arduino, it still doesn't work. Any ideas how can I fix this? Help please?

What ip does the Arduino get with dhcp? What ip are you assigning static? What is the gateway (router ip)? What is the subnet mask for that localnet in the router?

By assigning the static ip that way, the compiler uses defaults for the rest of those settings. If you assigned 192.168.0.2 as the ip, then by default: the gateway is 192.168.0.1 the dns server is 192.168.0.1 the subnet mask is 255.255.255.0

Does all that look ok?

edit: I just checked mine behind a router on a localnet, and it worked fine with both static and dhcp ip addresses. Insure there is not a microSD card in the slot for the test.

The DHCP IP automaticaly assigned is 10.0.0.141 or above, (From the DHCP pool range I have set in the router) The static IP I assign is 10.0.0.30

byte mac[] = { 
  0x90, 0xA2, 0xDA, 0x00, 0x56, 0x07 };
byte ip[] = { 
  10, 0, 0, 30 };
static char baseurl[]="http://10.0.0.30/";
byte gateway[] = {
  10,0,0,138};
byte subnet[] = {
  255,255,255,0};

Changing this:

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

to this:

Ethernet.begin(mac);

makes it work with no other changes. I am guessing it's a router, port forwarding thing, but 3 days now I can't solve it, nor find info anywhere.

Just solved it:

byte mac[] = { 
  0x90, 0xA2, 0xDA, 0x00, 0x56, 0x07 };
byte ip[] = { 
  10, 0, 0, 30 };
byte gateway[] = {
  10,0,0,138};
byte mydns[] = {
  10,0,0,138};
// and in setup:
Ethernet.begin(mac, ip, mydns, gateway);

My Ethernet.begin command was wrong. The gateway wasn't set correctly. Thank you for pointing me in the right direction.