about ethernet communication with static IP

Dear All, i am new in arduino world and working with great pleasure with arduino guidance and also your help. now i am working with a project where i need intranet access for this i brought a w5100 chip for Ethernet communication and mega2560 for master control.

for working with it i need to give a static ip and access this ip from remote end. i tried a program of w5100 and its working fine when i connect it to my pc with a lan cable.

and i give w5100 ip: 192.168.5.120 and pc ip: 192.168.5.1 musk 255.255.255.0

initialization function for Eth i use

default arduino lib ethernet.h and function for init is

Ethernet.begin(mac, ip); ///where mac=byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

                                 /// and ip=IPAddress ip(192,168,5, 120);

its working fine. and having no ping loss while i run the program.

but in real environment i need to give a fixed ip which contains gateway

IPAddress ip(10,217,249, 254);
byte gateway[] = { 10, 217, 249, 253};  
byte subnet[] = { 255, 255, 255, 252 };


////For init i use function

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

its not working in real environment.

while i connect to LAN i get request timeout from other end(this other end goes far remote via many swtich and router and the connection is not faulty because other device like pc have no ping loss).

please suggest me what should i do now.

NB: i am using arduino 1.0.6 in 32 bit PC.

You are missing the dns server IP in the begin function. If you do not plan on using any domain resolutions, use the gateway for the dns server IP.

IPAddress ip(10,217,249, 254);
byte gateway[] = { 10, 217, 249, 253};  
byte subnet[] = { 255, 255, 255, 252 };


////For init i use function

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

but in real environment i need to give a fixed ip which contains gateway

What device are you using for the gateway? PC? router?