If you can connect with DHCP but not with a static IP address, the problem probably is due to the way your network is set up.
Are you using the same IP address that the DHCP dynamically gave you? There is an Arduino sketch that will print out the DHCP IP address that was assigned. I would recommend running that script, getting the IP address, then using that IP address to test the static IP address.
But really, if it connects via DHCP, there is no need to even bother with static IP address. Static IP and DCHP IP addresses, are just two different ways used to setup devices on a network. Most networks either use one or the other, and for the last decade (or two), DHCP has been the method that most networks use.
This morning I was in the office where we haven't DHCP.
Now at home I have tried to use DHCP but it isn't working. Yesterday it worked fine also at home with DHCP.
The only thing I have done between yesterday and today is to create an SD to boot Galileo with full-featured Linux.
After some tests with SD I returned to use Galileo without SD and the problem comes.
It seems that Eclipse.begin(mac) works fine (using DHCP) but client.connect(server, 80) failed where server is declared as
char server = "www.google.com"
It seems that there is a problem with gateway and/or DNS. My network works fine....all my devices use DHCP without problems !
Any idea ?
Another strange behavior is that I can't connect also to a local server inside my LAN.
Ethernet.begin(mac) always return true so it means that the initialization works fine (IP address via DHCP) but client.connect(...) always fails.
I tried to reset the board execute firmware update (I hope it erase all SPI flash and reinstall Linux distro on it) but it didn't help me. :-(
Do you have a copy of Linux on your SD card? Were you booting from the SD card or from the SPI?
It seems like the sketch works for you if you boot from the SPI. But the sketch does not work when you try to boot from you SD card?
Have you upgraded your firmware (using the Arduino IDE)? If not, I would start with that.