Well in this case I suggest to set up your IP manually, following these steps:
sudo iwconfig [INTERFACE] mode managed key open
sudo iwconfig [INTERFACE] essid [ESSID]
Now set your IP address:
sudo ifconfig [INTERFACE] [IP ADDRESS] netmask [SUBNETMASK]
Then add your IP of router as default gateway:
sudo route add default gw [ROUTER GATEWAY]
Finally, configure DNS:
sudo echo nameserver [DNS] >> /etc/resolve.conf