1

I've attempted to set up a static ip address for my home computer (Ubuntu 14.04 LTS), and have followed a few online instructions to no avail.

my interfaces file was :

auto l0
iface lo inet loopback

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.151
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8

when I reboot the machine and type ifconfig in the terminal my wlan0 ipv4 was successfully changed to 192.168.1.151 but there is no wireless connection detected. i did the same process with an other linux(debian) machine and it's works fine. thank you for your help !

| improve this question | | | | |
  • 1
    Specifying an IP is not enough, you must also specify a network to join, etc. Why not use NetworkManager? – fkraiem Feb 3 '16 at 13:41
  • And what is auto 10? It should be auto lo. – Pilot6 Feb 3 '16 at 13:42
  • yes yes it's l0 – Ahmed El Mokhtar Feb 3 '16 at 13:51
  • Ah, so you didn't put a cut-and-paste of /etc/network/interfaces in your question, but merely typed something in, with 1 known error at this point (l0 vs lo). What other errors are there? – waltinator Feb 3 '16 at 14:01
  • no i putted "l" it's look like "1" – Ahmed El Mokhtar Feb 3 '16 at 14:13
5

The issue with Wireless Networks is that they are not managed correctly by /etc/network/interfaces unless you configure all the WPA2 items. This poses a problem - it will always try and configure itself then for that Wireless Network, and then you won't have a working wifi if you need to do another network, until you reconfigure the item in /etc/network/interfaces, and then reboot or restart the wifi card.

The correct way to handle Wireless Networks is to use Network Manager, on a default Ubuntu installation, and then have all the configuration done in the network profile that is stored inside Network Manager.

In a typical setup of Ubuntu 14.04, you will have to configure Network Manager to connect to a wireless network. Inside Network Manager, it will have different connection profiles for each Wireless network. Start by connecting to the network as you normally would - this will then give you a dynamically-assigned Wireless address, and create the profile.

Click the network manager icon in the indicator bar. Hit "Edit Connections", and select the network you want to edit. Then hit "Edit"; this type of screen shows up:

Editing A Network Window

You can then go to the IPv4 tab, and hit "Manual". In the box for IP addresses, network data, etc. you will then put your configuration items there, such that 192.168.1.151 is the address, 24 is the NetMask you enter (you can also put 255.255.255.0 if you want, but 24 is identified the same way), and 192.168.1.1 is the gateway.

Another box is for DNS servers - there you would put 8.8.8.8.

It'd look something like this when you're done:

Editing a Network - IPv4

Hit "Save". Then, tell Network Manager to disconnect and then connect to the network again. You then have static-IP addressing for that wireless network.

You can also configure different settings for different Wireless networks in this way, if multiple networks need different static IP addresses or network settings set on your device.

| improve this answer | | | | |
  • I did this but it seem to have made things worse, when i restart the laptop said " Booting system without full network configuration" then "Waiting up to 60 more seconds for network configuration" after that it boot normally but it doesn't detect the wifi even when i type ifconfig there in no wlan0 – Ahmed El Mokhtar Feb 3 '16 at 17:52
  • 1
    this due to a mistake on my interfaces file, you helped me a lot it solved my problem, thanks a lot. – Ahmed El Mokhtar Feb 3 '16 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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