For raspbian version, check /etc/os-release
Raspbian 7 (wheezy)
ifface eth0 inet dhcp
iface eth0 inet static
Wireless Lan (Edimax for example)
iface wlan0 inet static
dns-nameservers 22.214.171.124 192.168.2.1
up route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1 dev wlan0
When I have both eth0 and wlan0 setup as static, I dunno why, but all my wlan0 traffic goes to eth0’s gateway. So I’ve to add the last line to force a route to wlan0 gateway in order to have internet access for wireless lan. Wired.
Sometime the /etc/resolv.conf also got reset to blank. I’ve to add the dns-nameservers manually.
Getting the wifi works is really pain in the ass.
That’s why unix system always need an administrator.
Raspbian 8 (jessie)