I'm using Ubuntu Server, and this is what my /etc/network/interfaces looks like:
auto wlan0
iface wlan0 inet static
address 192.168.1.68
netmask 255.255.255.0
gateway 192.168.1.254
and it gives me this error when I try to do sudo ifup wlan0
RTNETLINK answers: File exists
Failed to bring up wlan0