Latest LQ Deal: Linux Power User Bundle
Go Back > Blogs > drask
User Name


Rate this Entry

wireless lan on raspberry pi

Posted 12-29-2013 at 11:47 PM by drask
Updated 12-30-2013 at 12:17 AM by drask

I just had to rebuild my raspberry pi again. It seems to keep eating its sd card for some reason. I decided to forgo the gui this time since it's a headless server. I just access it via ssh and vnc and I think I'm ready to drop vnc. Generally all I use X for is editing files in leafpad, and I can just as easily run pluma locally and connect over sshfs.

I have a pretty simple wireless setup - an open wireless network with no keys or certificates (I live on a farm, I'm not concerned about people intercepting my wifi). But it took me some time to figure out how to configure it, so I wanted to record what I did.

Anyway, here is my /etc/network/interfaces file:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp

wpa-conf /etc/wpa_supplicant/wireless-lan.conf
and here are the contents of /etc/wpa_supplicant/wireless-lan.conf:

I'm not sure why I had to put the gateway into the interfaces file. Supposedly dhcp should set this, but without it I had no defined routes and couldn't get to anything outside my local subnet:

$ /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 wlan0
If it had to go anywhere, it seems like it would belong in the network definition in the wireless-lan.conf file, since different wireless networks will probably sport different gateways. When connecting using Network Manager, it's never been a problem, so I'm not sure why it's not getting set automatically here.
Posted in Uncategorized
Views 1740 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 02:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration