I have a machine that I just installed Ubuntu Server on. The only problem is that I do not know how to connect it to a wireless network, and I cannot use a network cable to connect it to my router.
When trying to list the network cards, only the loopback interface showed up:
$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric 1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
which was unexpected, as both my Ethernet network interface (eth0
) and wireless network interface (wlan0
) showed up when doing the same in a fresh installation of Ubuntu Desktop 10.10.
So, my two questions are:
- how can I install the wireless drivers (and packages I could download etc.) and/or set up the wireless network interface to work properly, and
- how can I connect to a WPA-encrypted wireless network from the command line?
EDIT:
I ended up uninstalling Ubuntu Server and installing Ubuntu Desktop instead, then configuring the wireless network through the GUI and making it boot into command line instead of GNOME.
If you don't have wireless drivers, then you will have to figure out a way to get those first, because you obviously will not be able to use your wireless card to get those ;) you can look them up on another computer and install the binaries. More than likely, though, you do already have drivers, but you need to edit your
/etc/network/interfaces
(as root), which contains interface declarations. It should register your cards once you add the following lines to it:This will should make ubuntu recognize the cards once you hit
/etc/init.d/networking restart
andifup -a
.Once you have the wireless card up, you can type
iwlist scan
to list wireless networks in range. I have only dealt with open and WEP-secured networks, and it works perfectly for those. For those networks, you can useiwconfig wlan0 essid "network-name" ap any key <wep-key>
I know WPA is possible, but it's a lot more configuration than just using iwconfig.
Take a look at this guide for connecting to the network: http://ubuntuforums.org/showthread.php?t=571188
I hope I can give you some ideas for your first question, but I only have a definite answer for the second one.
If this site tells you that the driver is already part of the kernel, then you have some issue you must troubleshoot. For example, there are two drivers for Ralink, both included with Ubuntu, and when you plug the card in, both drivers try to steer it, so it doesn't work. The solution is to blacklist one of both. For this kind of problem, you will probably have to google something like "[chipset] wireless card does not work on ubuntu", this gets you a result much quicker than if you google it without the chipset name.
Edit (or create) the file /etc/wpa_supplicant/wpa_supplicant.conf
It needs following code:
Depending on the router settings, you may need to try out different combinations for pairwise and group (e. g. both CCMP or both TKIP).
This solution assumes that you are using the older WPA encryption. If you have WPA 2, it changes to proto=RSN.
Then connect using the line
here you need to write the name of your interface after -i and the name of your driver after -D (you should know both after you have solved 1.)
I can vouch that this method worked with Intrepid, but haven't used it since. If there is a problem with it, you can look at how to set it up in the man file here.