1

I've configured the WiFi SSID and key through /etc/network/interfaces as shown below:

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
wpa-ssid MYWIFINAME
wpa-ap-scan 1
wpa-key-mgmt WPA-PSK
wpa-psk WIFIKEYGOESHERE

I did not use the usual password. I ran it through wpa_passphrase to get the proper key.

Even though these settings seem correct, and running iwconfig gives me this:

wlan0   IEEE 802.11bgn  ESSID:"MYWIFINAME"
        Mode:Managed  Frequency:2.462 GHz  Access Point: AB:CD:EF:12:34:56
        Bit Rate=72.2 Mb/s   Tx-Power=20 dBm
        Retry short limit:7   RTS thr=2347 B   Fragment thr:off
        Power Management:off
        Link Quality=38/70  Signal level=-72 dBm
        Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
        Tx excessive retries:0  Invalid misc:4   Missed beacon:0

lo      no wireless extensions.

Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]

... I can not ping any website, as they all return unknown host site.com and I can not ping my own router. Running ping -c 4 10.0.0.1 returns Network is unreachable, so what can I do? I don't have any information on the server right now, so I could wipe and reinstall if necessary.

When the server is rebooted, starting it up causes it to stall on Waiting for networking configuration, and it gives itself over 60 seconds to finish, but gives up.

Output of sudo ifup -v wlan0: http://paste.ubuntu.com/12989292/

EDIT: I decided to wipe the server, and I'm going to install Ubuntu Server in a VM in order to make it easier to use the Internet connection. It will be much easier to set up in Windows.

  • Does `ifconfig` show that you have an address? Is there another interface that it is trying to send packets through? – Stephen Angelico Oct 28 '15 at 01:28
  • @StephenAngelico When I run `ifconfig` I see `Link encap:Ethernet HWaddr AB:CD:EF:12:34:56` and then on 3 more lines different IPv6 address ranges that all end in `/64`. The first is Global, second is Link, and third is also Global. – Phoenix Logan Oct 28 '15 at 10:12
  • I'm not sure offhand what the significance of that is. Is eth0 getting in the way? Could you have not got an address? If you take wlan0 down and bring it up again, does it say `bound to x.x.x.x - renewal in y seconds` or `No DHCPOFFERS received`? – Stephen Angelico Oct 28 '15 at 10:22
  • I don't have `eth0`, just `wlan0` and `lo` because I disabled Ethernet in the BIOS menu, just to make sure it wasn't interfering. When I run `sudo ifdown wlan0` then `sudo ifup wlan0`, the `ifup` command says `Listening on LPF/wlan0/AB:CD:EF:12:34:56` then `Sending on LPF/wlan0/the same MAC` then `Sending on Socket/fallback`. After that it just repeats `DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval X (xid=0x8bcc3505)` forever. – Phoenix Logan Oct 28 '15 at 10:27
  • @StephenAngelico After about 3 minutes of repeating `DHCPDISCOVER`... it says `No DHCPOFFERS received.` then `No working leases in persistent database - sleeping.` Does this mean it's not getting an IP address from my router? – Phoenix Logan Oct 28 '15 at 10:32
  • That's right. Check the logs on your server to see if the requests are getting there, otherwise see if the router is playing up. – Stephen Angelico Oct 28 '15 at 11:10
  • @StephenAngelico thanks. Where do I find the log for DHCP? I'm mostly new to Ubuntu, so sorry about that. – Phoenix Logan Oct 28 '15 at 11:11
  • Please [edit] your question and add output of `lspci -knn | grep Net -A2` terminal command. – Pilot6 Oct 28 '15 at 11:28
  • @Pilot6 Returns nothing. What does this mean? – Phoenix Logan Oct 28 '15 at 12:39
  • Is it a PCI or USB adapter? – Pilot6 Oct 28 '15 at 12:40
  • @Pilot6 It is a USB adapter. Sorry about that. Should I use a different command? – Phoenix Logan Oct 28 '15 at 12:52
  • 1
    It is `lsusb` then. – Pilot6 Oct 28 '15 at 12:53
  • @Pilot6 Here is the entry for the device I'm using: `Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]` – Phoenix Logan Oct 28 '15 at 13:06
  • @Pilot6 if wlan0 shows up as an interface, I don't see how much difference the actual device model makes. Are you looking for driver issues? – Stephen Angelico Oct 28 '15 at 13:14
  • The kernel driver does not work well for this device. It actually never works. – Pilot6 Oct 28 '15 at 13:15
  • Your NIC did not get assigned IP address from DHCP. Does other wifi device working?? – Aizuddin Zali Oct 28 '15 at 14:11
  • @AizuddinZali All other devices on the network are working fine. It just seems to be this computer. – Phoenix Logan Oct 28 '15 at 14:14
  • @Pheonix Try `dhclient wlan0` and kill any dhclient process first. – Aizuddin Zali Oct 28 '15 at 14:19

2 Answers2

0

Please amend your /etc/network/interfaces file to:

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet dhcp
wpa-ssid MYWIFINAME
wpa-psk WIFIKEY

Where WIFIKEY is the actual key in clear text. Restart the interface:

sudo ifdown wlan0 && sudo ifup -v wlan0

Test:

ping -c3 www.ubuntu.com

The -v for verbose in the ifup command should produce sufficient output to diagnose why you didn't connect. As it may be lengthy, please post it here and give us the link: http://paste.ubuntu.com.

chili555
  • 58,968
  • 8
  • 93
  • 129
  • I still get `ping: unknown host www.ubuntu.com` from that. One thing I was curious about is that I don't have an IP address when I run `ifconfig`, even though running `iwconfig` shows my SSID seeming to be configured. It even shows my router's MAC address. – Phoenix Logan Oct 28 '15 at 10:14
  • `/etc/network/interfaces` can handle a plain text password as well as an encrypted key. – Stephen Angelico Oct 28 '15 at 10:15
  • @StephenAngelico That's good to know, because I'd rather not have to deal with `wpa_passphrase` again. – Phoenix Logan Oct 28 '15 at 10:16
  • 1
    @PhoenixLogan It's always a good idea to use wpa_passphrase to encrypt them. – Stephen Angelico Oct 28 '15 at 10:18
  • @StephenAngelico It is a little awkward trying to type the entire key out, but I guess it isn't a big deal if it makes it more secure, instead of storing the plain text. Although for now I just have the key in plaintext. – Phoenix Logan Oct 28 '15 at 10:20
  • @StephenAngelico `/etc/network/interfaces` will only accept an encrypted password in the context of a fully configured wpa_supplicant.conf file. That is not the case here, nor is it required. – chili555 Oct 28 '15 at 11:22
  • @PhoenixLogan Please see my edit to the answer above. – chili555 Oct 28 '15 at 11:24
  • @chili555 I uploaded the paste. It seems like DHCP is not working for some reason. – Phoenix Logan Oct 28 '15 at 13:07
  • Your NIC did not get assigned IP address from DHCP. Does other wifi device working?? – Aizuddin Zali Oct 28 '15 at 14:10
0

You need to install a driver for this adapter. Connect to internet with some other adapter and run:

sudo add-apt-repository ppa:hanipouspilot/rtlwifi
sudo apt-get update
sudo apt-get install rtl8192cu-dkms linux-firmware

If you do not have other adapter then download these files:

https://launchpad.net/~hanipouspilot/+archive/ubuntu/rtlwifi/+files/rtl8192cu-dkms_0.2~trusty_all.deb

http://mirrors.kernel.org/ubuntu/pool/main/d/dkms/dkms_2.2.0.3-1.1ubuntu5.14.04.5_all.deb

https://launchpad.net/~hanipouspilot/+archive/ubuntu/rtlwifi/+files/linux-firmware_1.144%2Bar3012_all.deb

copy them to the /home/$USER directory and run

sudo dpkg -i *.deb
sudo reboot
Pilot6
  • 88,764
  • 91
  • 205
  • 313