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?

  • What are your settings in Network manager? Static? DHCP? – chili555 Aug 20 '14 at 00:03
  • DHCP, however, I cant even get Network Manager to work at the moment. This is the first thing I want to correct if possible. – John Smith Aug 20 '14 at 09:43
  • In a server, that usually runs headless, no graphical desktop is installed. If you'd care to remove NM altogether, you can use the traditional method: http://ubuntuforums.org/showthread.php?t=2238753 Please see my post #4. – chili555 Aug 20 '14 at 12:59
  • chili555 you are the man!!!

    I initially left the whole thing because I was becoming frustrated with it. However it now works!!! (See the rather long post below.) After setting it up, I thought about uninstalling the lubuntu desktop, however that was so onerous that I reinstalled the whole thing again. And ironically this time it connected to the router during the install which I put down to the configuring the reservation on the router. Which can't happen unless you know the MAC address of the wireless adapter in the first place, which seems a little back to front for me.

    – John Smith Aug 25 '14 at 22:41

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
  • 60,188
  • Because the netmask on my router is 255.255.255.0, and I didn't want to screw around with it, and also because in my humble experience, most home routers use a 24 bit netmask for the LAN range, (either 192.168.1.0 or 192.168.0.0) I thought it would be easier to reserve an IP address rather than change the DHCP address range. – John Smith Aug 26 '14 at 23:01
  • I didn't suggest you change the netmask in the router, nor did I suggest you change the DHCP range in the router; only that you pick an address outside it. Nothing else. – chili555 Aug 26 '14 at 23:28
  • I wasnt trying to be difficult when I posted my answer. To my knowledge, (which isn't a great deal!), there is normally only one lan connected to the wifi port on a home router. I don't understand how you could wirelessly connect to an address that is outside the DHCP range when the DHCP range encompasses the entire range of addresses that the LAN has within its network. Please correct me if Im wrong. – John Smith Aug 27 '14 at 08:58
  • Normally, at least in consumer-grade routers, the DHCP is not only a narrow portion of the available addresses, but also user-adjustable. See: http://www.abyssunderground.co.uk/images/router/dhcp.gif In this example, DHCP addresses are set to use xx.110 to xx.160. Therefor, all the addresses from xx.2 to xx.109 and also from xx.161 to xx.253 are available for static IP assignments. As well, one needn't necessarily use 50 addresses for DHCP; if it better suits your needs, select 25 or 10 or whatever. – chili555 Aug 27 '14 at 11:29
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.