Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm planning to maybe install Ubuntu server on an old machine. But my question is: can I install Ubuntu server on a machine and have it connect to my home network - wirelessly? I can't use a cable in this case.

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

You can install a GUI interface to Ubuntu server to get Network Manager or following the wpa_supplicant on this page (https://help.ubuntu.com/community/WifiDocs/WPAHowTo).

share|improve this answer
    
Does that wpa_supplicant require a graphical interface too? –  Lyrositor Oct 20 '10 at 22:09
2  
wpa_supplicant can be configured from the command line. –  Mike Oct 20 '10 at 22:10
    
NetworkManager can work without a GUI too... –  JanC Oct 21 '10 at 2:26
add comment

Note: First off you will want to make sure that the server has wpa_supplicant installed. Servers don't always have it and that can make it difficult if you can't connect it to Ethernet at least once.

This is how I do it. (be sure to use your ip numbers and network interface name)

Wont need this part for a server it is just if you wanted to kill off everything that would be interfering on a desktop.

sudo stop network-manager
sudo killall wpa_supplicant  #must stop network-manager before this as it resurrects it.
sudo killall nm-applet

this only needs to be done once unless the file gets trashed. (you can put the config anywhere really)

wpa_passphrase "YOUR_ESSID" | sudo tee /etc/wpa_supplicant.conf # and type your password

-B for background -s to log to syslog -c to tell it where the config is. -i interface

sudo wpa_supplicant -B -s -c /etc/wpa_supplicant.conf -i wlan0

for DHCP just use

sudo dhclient wlan0

for static ip

sudo ifconfig wlan0 192.168.1.12 # Be sure to set you ip to what works for you.

should be able to ping your router by ip. $ ping 192.168.1.1

sudo route add default gw 1992.168.1.1 # use the ip of you router

should be able to ping the net at large. $ ping 8.8.8.8

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf

should be done. $ ping google.com

This will not last through a reboot. To make this persist through a reboot,

sudo nano /etc/network/interfaces

Add this to the bottom (substitute for wlan0 if you have a different interface):

auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -B -c /etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

Note that you might not have the KILLALL component installed if you have a minimal server. You can get killall with:

aptitude install psmisc
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.