0

As a first, I just want to say that this website is brilliant and has helped me no end whilst getting back into Ubuntu.

I have recently converted a VAIO laptop to run Ubuntu server 14.04. The first snag which I haven't yet gotten over was getting a wireless internet connection for the server. During the install, it asked for details of my wireless router. On the first install I had the router setup to only accept known MAC addresses, and also to not broadcast itself. After typing in the correct details for the network, it wouldn't add it. So I went back and connected to the router directly with an ethernet cable which didn't work at first, but after configuring the router to not filter MAC addresses, it appeared to work fine.

I tried to use the explanation found here to fix the wireless issue via the command line:

How to connect and disconnect to a network manually in terminal?

Unfortunately, none of the wpa_supplicant methods worked, and when I tried the network manager part, my computer said that it couldn't find the create_connections folder. However this currently isn't the issue I am writing about now, (I may have to start a new thread at some point!) I instead installed a Lubuntu GUI on the server to see if I could access a network manager from there, and access wireless via that. After downloading it and starting it, the internet still worked with an ethernet cable. However, there was no icon showing network manager, although there is a space So I did some more looking and found that you have to goto preferences > lx.... and type nm-applet in the autostart tab. After doing this, and relogging in, no icon appeared, but the blank space increased. I double clicked on the blank space and network manager appeared, and two NM icons appeared. I used one of them to connect to my wireless router and thought all would be well! (Both NM icons showed connection to my wireless network.) After opening Firefox, when trying to access the BBC website the circle kept on turning. At this point I turned off the eth0 port in case that was interfering, and it still didn't work. I went into the command line and typed "ping -c 5 www.bbc.co.uk" and after a while it said that it couldn't connect to the server. I pinged the router address which was fine. I then turned on the eth0 port and I still didn't have access to the internet! So I went back into preferences > LX... and took of the nm-applet. After re-logging into the account I could then access the internet via ethernet cable. However the network manager icons had dissapeared, and when I clicked on the blank space, although options appeared, they were greyed out. I tried the NM-applet solution again and the icons appeared but when clicking on them the options are still greyed out.

I have spent the majority of the last two days trying to solve this and getting nowhere. Can anyone suggest anything to help?

2 Answers2

1

The ip address in the address line must be the reserved ip address you have configured within your router.

That works well, but the more common method is to pick an address outside the DHCP range in the router. For example, if the router is set to allow 50 addresses for DHCP from, for example, 192,168.1.2 to 192.168.1.51, pick an address outside the range, such as 192.168.1.100. Keep a journal of the various addresses assigned statically, or do as I did years ago; write '100' on the back of the machine with a marker. Crude but effective.

chili555
  • 61,330
0

Ubuntu server for me works now.

The process I followed was thus: (NB these steps are for a simple home network, and assumes a little knowledge about getting local network settings such as the gateway address, and the DNS name server address.)

1) I set-up a reserved ip-address within my router for my home network. (See NB1 at the end of this post about obtaining the wireless MAC address of your device. This will probably be needed for reserving an ip address) This part for me was pretty important as when first installing Ubuntu server, my device could not acccess the router wirelessly until this address was configured on the router. Don't forget the ip address you have reserved, as it will be needed later!!!

2) After Ubuntu server boots, I went into the "interfaces" file within the system to edit it. NB see the note at the end about text editors!!

3) I pressed return a couple of times after the last entry, and typed in the following lines within the interfaces file to get the wireless network to work:

auto wlan0
iface wlan0 inet static
address 192.168.1.120 <-- The reserved ip address as configured on your router
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 192.168.1.1
wpa-ssid myroutername
wpa-psk mysecretkey

The first two lines must be typed as they are. The ip address in the address line must be the reserved ip address you have configured within your router. The netmask line should be typed as it is, (assuming this is a home network, with a simple 255.255.255.0 network.) The gateway address and dns-nameserver are normally the same thing on a home router, and can be found when accessing the home router, or by typing ipconfig on any windows machine at the command line, or can be checked in your network configuration on a tablet or fablet or smartphone!
myroutername in the WPA line is the actual name of your router as recognised on the network, (eg SKY76543, BTHub-98054, etc)
mysecretkey is the router password to be able to connect to the router. NB these lines are if your router has WPA/WPA2 configured. If you don't have it configured, or have WEP, please consider updating to WPA! (And dont type these lines!)

After typing the above into the interfaces file, save it, then reboot your server, and you should have wireless access!!!

NB 1 For other people reading this you may need the MAC address of the wireless card that your device is using - typing ifconfig at the command line will bring up your network interfaces and the associated MAC addresses, which are always of the form aa:aa:aa:aa:aa:aa where the a's will actually be either a number from 0-9, or letters a-f. The MAC address that you will need for the router is the one associated with the wlan0 adapter. As an extra note bene, this might not work if the wireless adapter hasn't been "turned on." Typing iwconfig wlan0 up at the command line, (as a root user) will bring it up. If you get a response mentioning something about rfkill, try typing in "sudo rfkill unblock wifi" at the command line, then type in the previous iwconfig command, (remember as a root user!) Then finally type ifconfig and the wlan0 should appear!

NB 2 I used the command, "gksudo gedit /etc/network/interfaces." which opens the interfaces file found in the /etc/network folder, and opens it using the gedit text editor; The gksudo command actually allows you to edit the file, as opposed to just viewing it. gedit is a text editor within Ubuntu that allows you to edit any type of file within Ubunutu. At this point I had the lubuntu desktop installed on my ubuntu server, AND the gedit program installed. gedit needs a gui front end to work. If you have a fresh ubuntu server with only a command line to work from, the vi text editor (which should come with your installation) also allows you to edit the interfaces file. Use the command "vi /etc/network/interfaces." to open it in vi. Vi is a bit more complicated to use than gedit, so read up on how to edit files from vi, and then save them from vi.

NB All of the above are thanks to askubuntu and mainly chili555 for the configuration in the interfaces file.