Ubuntu 14.04 Server - WiFi WPA2 Personal

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
38
down vote

favorite
29












I just installed Ubuntu 14.04 Server and cannot get wifi configured correctly to work with WPA2 personal and could use some help.



There was a simple wizard during install where I selected my SSID from a list and entered my passphrase and that worked great. Now that the install is done I am having trouble configuring wifi. My Access Point is setup to WPA2 Personal TKIP or AES. Any advice would be greatly appreciated. I have been messing around with WPA supplicant ant my /etc/network/interfaces file with no luck.



Thanks










share|improve this question

























    up vote
    38
    down vote

    favorite
    29












    I just installed Ubuntu 14.04 Server and cannot get wifi configured correctly to work with WPA2 personal and could use some help.



    There was a simple wizard during install where I selected my SSID from a list and entered my passphrase and that worked great. Now that the install is done I am having trouble configuring wifi. My Access Point is setup to WPA2 Personal TKIP or AES. Any advice would be greatly appreciated. I have been messing around with WPA supplicant ant my /etc/network/interfaces file with no luck.



    Thanks










    share|improve this question























      up vote
      38
      down vote

      favorite
      29









      up vote
      38
      down vote

      favorite
      29






      29





      I just installed Ubuntu 14.04 Server and cannot get wifi configured correctly to work with WPA2 personal and could use some help.



      There was a simple wizard during install where I selected my SSID from a list and entered my passphrase and that worked great. Now that the install is done I am having trouble configuring wifi. My Access Point is setup to WPA2 Personal TKIP or AES. Any advice would be greatly appreciated. I have been messing around with WPA supplicant ant my /etc/network/interfaces file with no luck.



      Thanks










      share|improve this question













      I just installed Ubuntu 14.04 Server and cannot get wifi configured correctly to work with WPA2 personal and could use some help.



      There was a simple wizard during install where I selected my SSID from a list and entered my passphrase and that worked great. Now that the install is done I am having trouble configuring wifi. My Access Point is setup to WPA2 Personal TKIP or AES. Any advice would be greatly appreciated. I have been messing around with WPA supplicant ant my /etc/network/interfaces file with no luck.



      Thanks







      wireless networking server






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 11 '14 at 20:09









      clettsome

      193134




      193134




















          5 Answers
          5






          active

          oldest

          votes

















          up vote
          55
          down vote



          accepted










          I suggest you set up /etc/network/interfaces something like:



          auto lo
          iface lo inet loopback

          auto wlan0
          iface wlan0 inet static
          address 192.168.1.150
          netmask 255.255.255.0
          gateway 192.168.1.1
          wpa-ssid <your_router>
          wpa-psk <your_wpa_key>
          dns-nameservers 8.8.8.8 192.168.1.1


          Be sure to select a static address outside the range used by the DHCP server in the router, switch or other access point. Of course, substitute your details here.



          Get the system to read and use the changes:



          sudo ifdown wlan0 && sudo ifup -v wlan0


          Did you connect?



          ping -c3 192.168.1.1
          ping -c3 www.google.com





          share|improve this answer




















          • This answer did the trick. I had done this a number of times before and one capital letter off in the SSID caused it not to work. Been ripping out my hair for days and finally resorted to posting this call for help and it comes down to a simple typo. Your answer did confirm that i was not crazy in my config approach and that affirmation you provided was something I needed in order to look closer. Thanks for the quick and simply help. This is exactly why I love the Ubuntu community and why I choose to use the product! Thank you for the support!
            – clettsome
            May 12 '14 at 4:19










          • I added the lines auto wlan0, iface wlan0 inet dhcp, wpa-ssid <your_router>, and wpa-psk <your_wpa_key> after the auto lo section. My file ends with auto p4p1, iface p4p1 inet dhcp (there by default). I was able to connect to my wifi. If I restart, things are fine if network cable is plugged. If unplugged, the 'Starting configure network device' step in the startup hangs, and takes two rounds of 60 seconds before system continues (message: waiting up to 60 more seconds for network configuration). Then I get 'booting system without full network config'. Wifi works, but how do i 'fix' this?
            – Vinh Nguyen
            Oct 24 '14 at 4:27










          • @VinhNguyen In ifconfig do you have a wlan0 interface? I suspect you'll need to ask your own new question.
            – chili555
            Oct 24 '14 at 12:11










          • FYI I posted the question at askubuntu.com/questions/541247/ubuntu-server-wifi
            – Vinh Nguyen
            Oct 25 '14 at 0:57










          • you saved me hours of running-in-circles... Thanks a lot!
            – fmquaglia
            Jan 24 '16 at 0:24


















          up vote
          30
          down vote













          I managed to connect to my WPA2 access point by putting the following in /etc/network/interfaces. Slightly modified from the accepted answer, and using DHCP.



          auto wlan0
          iface wlan0 inet dhcp
          wpa-ssid <your_router>
          wpa-psk <your_wpa_key>


          Then a simple sudo ifup -v wlan0 and it connected. All good.






          share|improve this answer
















          • 2




            Perfect! On 15.10, wlan0 is named wls1 by default.
            – dardisco
            Jan 10 '16 at 0:42










          • This worked for me aswell
            – ranjan
            Apr 1 '16 at 11:47






          • 3




            Here is how to store a hash of the key instead of the key itself: unix.stackexchange.com/questions/274095/…
            – kol
            Jun 6 '16 at 15:10






          • 3




            It's important to use the name of the WiFi interface of your system! Type ifconfig -a or ip a: the name of the WiFi interface usually starts with w. For example, on my Ubuntu 16.04 server it's called wlp5s0. Use this name in /etc/network/interfaces instead of wlan0.
            – kol
            Jun 6 '16 at 16:01











          • Works for 16.04! Thank you!
            – Rugal
            Feb 23 '17 at 2:26

















          up vote
          3
          down vote













          Using either DHCP or a static config (doesn't matter which)--AND assuming your wifi worked during install--make your /etc/network/interfaces look something like below (for wlan0 should match the name of your wifi card listed under ifconfig -a e.g. your detected wifi card could be nicknamed eth1 by the OS for all I know.):



           auto lo iface lo inet loopback 
          auto wlan0 iface wlan0 inet dhcp
          wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


          To configure wpa_supplicant use the command (Referenced in the config above)



          wpa_passphrase "YOUR_SSID" SSID_PASSWORD | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf


          Next, create a new executable script named iwconfig (you can name this script anything really, "iwconfig-default-ssid", perhaps?--I just made it short for the example):



          sudo touch /etc/network/if-up.d/iwconfig && sudo chmod 700
          /etc/network/if-up.d/iwconfig && sudo ln -s
          /etc/network/if-up.d/iwconfig /etc/network/if-pre-up.d/iwconfig


          Now edit /etc/network/if-up.d/iwconfig and add the SSID you want Ubuntu Server to connect to on startup:



          #!/bin/sh
          iwconfig wlan0 essid "YOUR_DEFAULT_SSID" mode managed


          Now bring ifdown (if you haven't already), then ifup, and you should be golden now and when you reboot (as long as you're near your SSID.)




          If you're out in public with your laptop with this config, you'll have to use: iwlist wlan0 scan, then sudo iwconfig essid "PUBLIC_ESSID" mode managed to connect with anything (and/or make a unique script for each place(s) you visit--just don't put any of these scripts under the 'if-up.rc.d' folder. /etc/network/interfaces can also handle location alias, so check the man/forums for help on this.)



          Or you can try your luck with the CLI frontend for wicd when roaming about town:




          sudo apt-get install wicd-curses







          share|improve this answer





























            up vote
            1
            down vote













            Perhaps you could try using Network Manager or Wicd. While Network Manager does have a few GUI dependencies which you might dislike having on a headless server, connecting to wifi is quite simple. For a hotspot setup by my Android phone (called Android AP), I could connect using:



            nmcli dev wifi connect 'Android AP' password test


            You might find WICD more useful, as curses-based interface as well (http://manpages.ubuntu.com/manpages/lucid/man8/wicd-curses.8.html). I haven't used it much, so I am not sure of the syntax for connecting to wifi.



            If /etc/network/interfaces is your only option, maybe you could show what you have done so far to see how we might fix it.






            share|improve this answer




















            • nmcli worked as a charm for me
              – feniix
              Jan 19 '15 at 15:08

















            up vote
            0
            down vote













            A real good super easy way to set up WiFi on the command line is with nmtui but I can't find how to install it.






            share|improve this answer





















              protected by Community♦ May 26 '16 at 20:22



              Thank you for your interest in this question.
              Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



              Would you like to answer one of these unanswered questions instead?














              5 Answers
              5






              active

              oldest

              votes








              5 Answers
              5






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              55
              down vote



              accepted










              I suggest you set up /etc/network/interfaces something like:



              auto lo
              iface lo inet loopback

              auto wlan0
              iface wlan0 inet static
              address 192.168.1.150
              netmask 255.255.255.0
              gateway 192.168.1.1
              wpa-ssid <your_router>
              wpa-psk <your_wpa_key>
              dns-nameservers 8.8.8.8 192.168.1.1


              Be sure to select a static address outside the range used by the DHCP server in the router, switch or other access point. Of course, substitute your details here.



              Get the system to read and use the changes:



              sudo ifdown wlan0 && sudo ifup -v wlan0


              Did you connect?



              ping -c3 192.168.1.1
              ping -c3 www.google.com





              share|improve this answer




















              • This answer did the trick. I had done this a number of times before and one capital letter off in the SSID caused it not to work. Been ripping out my hair for days and finally resorted to posting this call for help and it comes down to a simple typo. Your answer did confirm that i was not crazy in my config approach and that affirmation you provided was something I needed in order to look closer. Thanks for the quick and simply help. This is exactly why I love the Ubuntu community and why I choose to use the product! Thank you for the support!
                – clettsome
                May 12 '14 at 4:19










              • I added the lines auto wlan0, iface wlan0 inet dhcp, wpa-ssid <your_router>, and wpa-psk <your_wpa_key> after the auto lo section. My file ends with auto p4p1, iface p4p1 inet dhcp (there by default). I was able to connect to my wifi. If I restart, things are fine if network cable is plugged. If unplugged, the 'Starting configure network device' step in the startup hangs, and takes two rounds of 60 seconds before system continues (message: waiting up to 60 more seconds for network configuration). Then I get 'booting system without full network config'. Wifi works, but how do i 'fix' this?
                – Vinh Nguyen
                Oct 24 '14 at 4:27










              • @VinhNguyen In ifconfig do you have a wlan0 interface? I suspect you'll need to ask your own new question.
                – chili555
                Oct 24 '14 at 12:11










              • FYI I posted the question at askubuntu.com/questions/541247/ubuntu-server-wifi
                – Vinh Nguyen
                Oct 25 '14 at 0:57










              • you saved me hours of running-in-circles... Thanks a lot!
                – fmquaglia
                Jan 24 '16 at 0:24















              up vote
              55
              down vote



              accepted










              I suggest you set up /etc/network/interfaces something like:



              auto lo
              iface lo inet loopback

              auto wlan0
              iface wlan0 inet static
              address 192.168.1.150
              netmask 255.255.255.0
              gateway 192.168.1.1
              wpa-ssid <your_router>
              wpa-psk <your_wpa_key>
              dns-nameservers 8.8.8.8 192.168.1.1


              Be sure to select a static address outside the range used by the DHCP server in the router, switch or other access point. Of course, substitute your details here.



              Get the system to read and use the changes:



              sudo ifdown wlan0 && sudo ifup -v wlan0


              Did you connect?



              ping -c3 192.168.1.1
              ping -c3 www.google.com





              share|improve this answer




















              • This answer did the trick. I had done this a number of times before and one capital letter off in the SSID caused it not to work. Been ripping out my hair for days and finally resorted to posting this call for help and it comes down to a simple typo. Your answer did confirm that i was not crazy in my config approach and that affirmation you provided was something I needed in order to look closer. Thanks for the quick and simply help. This is exactly why I love the Ubuntu community and why I choose to use the product! Thank you for the support!
                – clettsome
                May 12 '14 at 4:19










              • I added the lines auto wlan0, iface wlan0 inet dhcp, wpa-ssid <your_router>, and wpa-psk <your_wpa_key> after the auto lo section. My file ends with auto p4p1, iface p4p1 inet dhcp (there by default). I was able to connect to my wifi. If I restart, things are fine if network cable is plugged. If unplugged, the 'Starting configure network device' step in the startup hangs, and takes two rounds of 60 seconds before system continues (message: waiting up to 60 more seconds for network configuration). Then I get 'booting system without full network config'. Wifi works, but how do i 'fix' this?
                – Vinh Nguyen
                Oct 24 '14 at 4:27










              • @VinhNguyen In ifconfig do you have a wlan0 interface? I suspect you'll need to ask your own new question.
                – chili555
                Oct 24 '14 at 12:11










              • FYI I posted the question at askubuntu.com/questions/541247/ubuntu-server-wifi
                – Vinh Nguyen
                Oct 25 '14 at 0:57










              • you saved me hours of running-in-circles... Thanks a lot!
                – fmquaglia
                Jan 24 '16 at 0:24













              up vote
              55
              down vote



              accepted







              up vote
              55
              down vote



              accepted






              I suggest you set up /etc/network/interfaces something like:



              auto lo
              iface lo inet loopback

              auto wlan0
              iface wlan0 inet static
              address 192.168.1.150
              netmask 255.255.255.0
              gateway 192.168.1.1
              wpa-ssid <your_router>
              wpa-psk <your_wpa_key>
              dns-nameservers 8.8.8.8 192.168.1.1


              Be sure to select a static address outside the range used by the DHCP server in the router, switch or other access point. Of course, substitute your details here.



              Get the system to read and use the changes:



              sudo ifdown wlan0 && sudo ifup -v wlan0


              Did you connect?



              ping -c3 192.168.1.1
              ping -c3 www.google.com





              share|improve this answer












              I suggest you set up /etc/network/interfaces something like:



              auto lo
              iface lo inet loopback

              auto wlan0
              iface wlan0 inet static
              address 192.168.1.150
              netmask 255.255.255.0
              gateway 192.168.1.1
              wpa-ssid <your_router>
              wpa-psk <your_wpa_key>
              dns-nameservers 8.8.8.8 192.168.1.1


              Be sure to select a static address outside the range used by the DHCP server in the router, switch or other access point. Of course, substitute your details here.



              Get the system to read and use the changes:



              sudo ifdown wlan0 && sudo ifup -v wlan0


              Did you connect?



              ping -c3 192.168.1.1
              ping -c3 www.google.com






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered May 11 '14 at 22:26









              chili555

              36.5k54776




              36.5k54776











              • This answer did the trick. I had done this a number of times before and one capital letter off in the SSID caused it not to work. Been ripping out my hair for days and finally resorted to posting this call for help and it comes down to a simple typo. Your answer did confirm that i was not crazy in my config approach and that affirmation you provided was something I needed in order to look closer. Thanks for the quick and simply help. This is exactly why I love the Ubuntu community and why I choose to use the product! Thank you for the support!
                – clettsome
                May 12 '14 at 4:19










              • I added the lines auto wlan0, iface wlan0 inet dhcp, wpa-ssid <your_router>, and wpa-psk <your_wpa_key> after the auto lo section. My file ends with auto p4p1, iface p4p1 inet dhcp (there by default). I was able to connect to my wifi. If I restart, things are fine if network cable is plugged. If unplugged, the 'Starting configure network device' step in the startup hangs, and takes two rounds of 60 seconds before system continues (message: waiting up to 60 more seconds for network configuration). Then I get 'booting system without full network config'. Wifi works, but how do i 'fix' this?
                – Vinh Nguyen
                Oct 24 '14 at 4:27










              • @VinhNguyen In ifconfig do you have a wlan0 interface? I suspect you'll need to ask your own new question.
                – chili555
                Oct 24 '14 at 12:11










              • FYI I posted the question at askubuntu.com/questions/541247/ubuntu-server-wifi
                – Vinh Nguyen
                Oct 25 '14 at 0:57










              • you saved me hours of running-in-circles... Thanks a lot!
                – fmquaglia
                Jan 24 '16 at 0:24

















              • This answer did the trick. I had done this a number of times before and one capital letter off in the SSID caused it not to work. Been ripping out my hair for days and finally resorted to posting this call for help and it comes down to a simple typo. Your answer did confirm that i was not crazy in my config approach and that affirmation you provided was something I needed in order to look closer. Thanks for the quick and simply help. This is exactly why I love the Ubuntu community and why I choose to use the product! Thank you for the support!
                – clettsome
                May 12 '14 at 4:19










              • I added the lines auto wlan0, iface wlan0 inet dhcp, wpa-ssid <your_router>, and wpa-psk <your_wpa_key> after the auto lo section. My file ends with auto p4p1, iface p4p1 inet dhcp (there by default). I was able to connect to my wifi. If I restart, things are fine if network cable is plugged. If unplugged, the 'Starting configure network device' step in the startup hangs, and takes two rounds of 60 seconds before system continues (message: waiting up to 60 more seconds for network configuration). Then I get 'booting system without full network config'. Wifi works, but how do i 'fix' this?
                – Vinh Nguyen
                Oct 24 '14 at 4:27










              • @VinhNguyen In ifconfig do you have a wlan0 interface? I suspect you'll need to ask your own new question.
                – chili555
                Oct 24 '14 at 12:11










              • FYI I posted the question at askubuntu.com/questions/541247/ubuntu-server-wifi
                – Vinh Nguyen
                Oct 25 '14 at 0:57










              • you saved me hours of running-in-circles... Thanks a lot!
                – fmquaglia
                Jan 24 '16 at 0:24
















              This answer did the trick. I had done this a number of times before and one capital letter off in the SSID caused it not to work. Been ripping out my hair for days and finally resorted to posting this call for help and it comes down to a simple typo. Your answer did confirm that i was not crazy in my config approach and that affirmation you provided was something I needed in order to look closer. Thanks for the quick and simply help. This is exactly why I love the Ubuntu community and why I choose to use the product! Thank you for the support!
              – clettsome
              May 12 '14 at 4:19




              This answer did the trick. I had done this a number of times before and one capital letter off in the SSID caused it not to work. Been ripping out my hair for days and finally resorted to posting this call for help and it comes down to a simple typo. Your answer did confirm that i was not crazy in my config approach and that affirmation you provided was something I needed in order to look closer. Thanks for the quick and simply help. This is exactly why I love the Ubuntu community and why I choose to use the product! Thank you for the support!
              – clettsome
              May 12 '14 at 4:19












              I added the lines auto wlan0, iface wlan0 inet dhcp, wpa-ssid <your_router>, and wpa-psk <your_wpa_key> after the auto lo section. My file ends with auto p4p1, iface p4p1 inet dhcp (there by default). I was able to connect to my wifi. If I restart, things are fine if network cable is plugged. If unplugged, the 'Starting configure network device' step in the startup hangs, and takes two rounds of 60 seconds before system continues (message: waiting up to 60 more seconds for network configuration). Then I get 'booting system without full network config'. Wifi works, but how do i 'fix' this?
              – Vinh Nguyen
              Oct 24 '14 at 4:27




              I added the lines auto wlan0, iface wlan0 inet dhcp, wpa-ssid <your_router>, and wpa-psk <your_wpa_key> after the auto lo section. My file ends with auto p4p1, iface p4p1 inet dhcp (there by default). I was able to connect to my wifi. If I restart, things are fine if network cable is plugged. If unplugged, the 'Starting configure network device' step in the startup hangs, and takes two rounds of 60 seconds before system continues (message: waiting up to 60 more seconds for network configuration). Then I get 'booting system without full network config'. Wifi works, but how do i 'fix' this?
              – Vinh Nguyen
              Oct 24 '14 at 4:27












              @VinhNguyen In ifconfig do you have a wlan0 interface? I suspect you'll need to ask your own new question.
              – chili555
              Oct 24 '14 at 12:11




              @VinhNguyen In ifconfig do you have a wlan0 interface? I suspect you'll need to ask your own new question.
              – chili555
              Oct 24 '14 at 12:11












              FYI I posted the question at askubuntu.com/questions/541247/ubuntu-server-wifi
              – Vinh Nguyen
              Oct 25 '14 at 0:57




              FYI I posted the question at askubuntu.com/questions/541247/ubuntu-server-wifi
              – Vinh Nguyen
              Oct 25 '14 at 0:57












              you saved me hours of running-in-circles... Thanks a lot!
              – fmquaglia
              Jan 24 '16 at 0:24





              you saved me hours of running-in-circles... Thanks a lot!
              – fmquaglia
              Jan 24 '16 at 0:24













              up vote
              30
              down vote













              I managed to connect to my WPA2 access point by putting the following in /etc/network/interfaces. Slightly modified from the accepted answer, and using DHCP.



              auto wlan0
              iface wlan0 inet dhcp
              wpa-ssid <your_router>
              wpa-psk <your_wpa_key>


              Then a simple sudo ifup -v wlan0 and it connected. All good.






              share|improve this answer
















              • 2




                Perfect! On 15.10, wlan0 is named wls1 by default.
                – dardisco
                Jan 10 '16 at 0:42










              • This worked for me aswell
                – ranjan
                Apr 1 '16 at 11:47






              • 3




                Here is how to store a hash of the key instead of the key itself: unix.stackexchange.com/questions/274095/…
                – kol
                Jun 6 '16 at 15:10






              • 3




                It's important to use the name of the WiFi interface of your system! Type ifconfig -a or ip a: the name of the WiFi interface usually starts with w. For example, on my Ubuntu 16.04 server it's called wlp5s0. Use this name in /etc/network/interfaces instead of wlan0.
                – kol
                Jun 6 '16 at 16:01











              • Works for 16.04! Thank you!
                – Rugal
                Feb 23 '17 at 2:26














              up vote
              30
              down vote













              I managed to connect to my WPA2 access point by putting the following in /etc/network/interfaces. Slightly modified from the accepted answer, and using DHCP.



              auto wlan0
              iface wlan0 inet dhcp
              wpa-ssid <your_router>
              wpa-psk <your_wpa_key>


              Then a simple sudo ifup -v wlan0 and it connected. All good.






              share|improve this answer
















              • 2




                Perfect! On 15.10, wlan0 is named wls1 by default.
                – dardisco
                Jan 10 '16 at 0:42










              • This worked for me aswell
                – ranjan
                Apr 1 '16 at 11:47






              • 3




                Here is how to store a hash of the key instead of the key itself: unix.stackexchange.com/questions/274095/…
                – kol
                Jun 6 '16 at 15:10






              • 3




                It's important to use the name of the WiFi interface of your system! Type ifconfig -a or ip a: the name of the WiFi interface usually starts with w. For example, on my Ubuntu 16.04 server it's called wlp5s0. Use this name in /etc/network/interfaces instead of wlan0.
                – kol
                Jun 6 '16 at 16:01











              • Works for 16.04! Thank you!
                – Rugal
                Feb 23 '17 at 2:26












              up vote
              30
              down vote










              up vote
              30
              down vote









              I managed to connect to my WPA2 access point by putting the following in /etc/network/interfaces. Slightly modified from the accepted answer, and using DHCP.



              auto wlan0
              iface wlan0 inet dhcp
              wpa-ssid <your_router>
              wpa-psk <your_wpa_key>


              Then a simple sudo ifup -v wlan0 and it connected. All good.






              share|improve this answer












              I managed to connect to my WPA2 access point by putting the following in /etc/network/interfaces. Slightly modified from the accepted answer, and using DHCP.



              auto wlan0
              iface wlan0 inet dhcp
              wpa-ssid <your_router>
              wpa-psk <your_wpa_key>


              Then a simple sudo ifup -v wlan0 and it connected. All good.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jul 20 '15 at 0:33









              phocks

              417511




              417511







              • 2




                Perfect! On 15.10, wlan0 is named wls1 by default.
                – dardisco
                Jan 10 '16 at 0:42










              • This worked for me aswell
                – ranjan
                Apr 1 '16 at 11:47






              • 3




                Here is how to store a hash of the key instead of the key itself: unix.stackexchange.com/questions/274095/…
                – kol
                Jun 6 '16 at 15:10






              • 3




                It's important to use the name of the WiFi interface of your system! Type ifconfig -a or ip a: the name of the WiFi interface usually starts with w. For example, on my Ubuntu 16.04 server it's called wlp5s0. Use this name in /etc/network/interfaces instead of wlan0.
                – kol
                Jun 6 '16 at 16:01











              • Works for 16.04! Thank you!
                – Rugal
                Feb 23 '17 at 2:26












              • 2




                Perfect! On 15.10, wlan0 is named wls1 by default.
                – dardisco
                Jan 10 '16 at 0:42










              • This worked for me aswell
                – ranjan
                Apr 1 '16 at 11:47






              • 3




                Here is how to store a hash of the key instead of the key itself: unix.stackexchange.com/questions/274095/…
                – kol
                Jun 6 '16 at 15:10






              • 3




                It's important to use the name of the WiFi interface of your system! Type ifconfig -a or ip a: the name of the WiFi interface usually starts with w. For example, on my Ubuntu 16.04 server it's called wlp5s0. Use this name in /etc/network/interfaces instead of wlan0.
                – kol
                Jun 6 '16 at 16:01











              • Works for 16.04! Thank you!
                – Rugal
                Feb 23 '17 at 2:26







              2




              2




              Perfect! On 15.10, wlan0 is named wls1 by default.
              – dardisco
              Jan 10 '16 at 0:42




              Perfect! On 15.10, wlan0 is named wls1 by default.
              – dardisco
              Jan 10 '16 at 0:42












              This worked for me aswell
              – ranjan
              Apr 1 '16 at 11:47




              This worked for me aswell
              – ranjan
              Apr 1 '16 at 11:47




              3




              3




              Here is how to store a hash of the key instead of the key itself: unix.stackexchange.com/questions/274095/…
              – kol
              Jun 6 '16 at 15:10




              Here is how to store a hash of the key instead of the key itself: unix.stackexchange.com/questions/274095/…
              – kol
              Jun 6 '16 at 15:10




              3




              3




              It's important to use the name of the WiFi interface of your system! Type ifconfig -a or ip a: the name of the WiFi interface usually starts with w. For example, on my Ubuntu 16.04 server it's called wlp5s0. Use this name in /etc/network/interfaces instead of wlan0.
              – kol
              Jun 6 '16 at 16:01





              It's important to use the name of the WiFi interface of your system! Type ifconfig -a or ip a: the name of the WiFi interface usually starts with w. For example, on my Ubuntu 16.04 server it's called wlp5s0. Use this name in /etc/network/interfaces instead of wlan0.
              – kol
              Jun 6 '16 at 16:01













              Works for 16.04! Thank you!
              – Rugal
              Feb 23 '17 at 2:26




              Works for 16.04! Thank you!
              – Rugal
              Feb 23 '17 at 2:26










              up vote
              3
              down vote













              Using either DHCP or a static config (doesn't matter which)--AND assuming your wifi worked during install--make your /etc/network/interfaces look something like below (for wlan0 should match the name of your wifi card listed under ifconfig -a e.g. your detected wifi card could be nicknamed eth1 by the OS for all I know.):



               auto lo iface lo inet loopback 
              auto wlan0 iface wlan0 inet dhcp
              wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


              To configure wpa_supplicant use the command (Referenced in the config above)



              wpa_passphrase "YOUR_SSID" SSID_PASSWORD | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf


              Next, create a new executable script named iwconfig (you can name this script anything really, "iwconfig-default-ssid", perhaps?--I just made it short for the example):



              sudo touch /etc/network/if-up.d/iwconfig && sudo chmod 700
              /etc/network/if-up.d/iwconfig && sudo ln -s
              /etc/network/if-up.d/iwconfig /etc/network/if-pre-up.d/iwconfig


              Now edit /etc/network/if-up.d/iwconfig and add the SSID you want Ubuntu Server to connect to on startup:



              #!/bin/sh
              iwconfig wlan0 essid "YOUR_DEFAULT_SSID" mode managed


              Now bring ifdown (if you haven't already), then ifup, and you should be golden now and when you reboot (as long as you're near your SSID.)




              If you're out in public with your laptop with this config, you'll have to use: iwlist wlan0 scan, then sudo iwconfig essid "PUBLIC_ESSID" mode managed to connect with anything (and/or make a unique script for each place(s) you visit--just don't put any of these scripts under the 'if-up.rc.d' folder. /etc/network/interfaces can also handle location alias, so check the man/forums for help on this.)



              Or you can try your luck with the CLI frontend for wicd when roaming about town:




              sudo apt-get install wicd-curses







              share|improve this answer


























                up vote
                3
                down vote













                Using either DHCP or a static config (doesn't matter which)--AND assuming your wifi worked during install--make your /etc/network/interfaces look something like below (for wlan0 should match the name of your wifi card listed under ifconfig -a e.g. your detected wifi card could be nicknamed eth1 by the OS for all I know.):



                 auto lo iface lo inet loopback 
                auto wlan0 iface wlan0 inet dhcp
                wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


                To configure wpa_supplicant use the command (Referenced in the config above)



                wpa_passphrase "YOUR_SSID" SSID_PASSWORD | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf


                Next, create a new executable script named iwconfig (you can name this script anything really, "iwconfig-default-ssid", perhaps?--I just made it short for the example):



                sudo touch /etc/network/if-up.d/iwconfig && sudo chmod 700
                /etc/network/if-up.d/iwconfig && sudo ln -s
                /etc/network/if-up.d/iwconfig /etc/network/if-pre-up.d/iwconfig


                Now edit /etc/network/if-up.d/iwconfig and add the SSID you want Ubuntu Server to connect to on startup:



                #!/bin/sh
                iwconfig wlan0 essid "YOUR_DEFAULT_SSID" mode managed


                Now bring ifdown (if you haven't already), then ifup, and you should be golden now and when you reboot (as long as you're near your SSID.)




                If you're out in public with your laptop with this config, you'll have to use: iwlist wlan0 scan, then sudo iwconfig essid "PUBLIC_ESSID" mode managed to connect with anything (and/or make a unique script for each place(s) you visit--just don't put any of these scripts under the 'if-up.rc.d' folder. /etc/network/interfaces can also handle location alias, so check the man/forums for help on this.)



                Or you can try your luck with the CLI frontend for wicd when roaming about town:




                sudo apt-get install wicd-curses







                share|improve this answer
























                  up vote
                  3
                  down vote










                  up vote
                  3
                  down vote









                  Using either DHCP or a static config (doesn't matter which)--AND assuming your wifi worked during install--make your /etc/network/interfaces look something like below (for wlan0 should match the name of your wifi card listed under ifconfig -a e.g. your detected wifi card could be nicknamed eth1 by the OS for all I know.):



                   auto lo iface lo inet loopback 
                  auto wlan0 iface wlan0 inet dhcp
                  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


                  To configure wpa_supplicant use the command (Referenced in the config above)



                  wpa_passphrase "YOUR_SSID" SSID_PASSWORD | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf


                  Next, create a new executable script named iwconfig (you can name this script anything really, "iwconfig-default-ssid", perhaps?--I just made it short for the example):



                  sudo touch /etc/network/if-up.d/iwconfig && sudo chmod 700
                  /etc/network/if-up.d/iwconfig && sudo ln -s
                  /etc/network/if-up.d/iwconfig /etc/network/if-pre-up.d/iwconfig


                  Now edit /etc/network/if-up.d/iwconfig and add the SSID you want Ubuntu Server to connect to on startup:



                  #!/bin/sh
                  iwconfig wlan0 essid "YOUR_DEFAULT_SSID" mode managed


                  Now bring ifdown (if you haven't already), then ifup, and you should be golden now and when you reboot (as long as you're near your SSID.)




                  If you're out in public with your laptop with this config, you'll have to use: iwlist wlan0 scan, then sudo iwconfig essid "PUBLIC_ESSID" mode managed to connect with anything (and/or make a unique script for each place(s) you visit--just don't put any of these scripts under the 'if-up.rc.d' folder. /etc/network/interfaces can also handle location alias, so check the man/forums for help on this.)



                  Or you can try your luck with the CLI frontend for wicd when roaming about town:




                  sudo apt-get install wicd-curses







                  share|improve this answer














                  Using either DHCP or a static config (doesn't matter which)--AND assuming your wifi worked during install--make your /etc/network/interfaces look something like below (for wlan0 should match the name of your wifi card listed under ifconfig -a e.g. your detected wifi card could be nicknamed eth1 by the OS for all I know.):



                   auto lo iface lo inet loopback 
                  auto wlan0 iface wlan0 inet dhcp
                  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


                  To configure wpa_supplicant use the command (Referenced in the config above)



                  wpa_passphrase "YOUR_SSID" SSID_PASSWORD | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf


                  Next, create a new executable script named iwconfig (you can name this script anything really, "iwconfig-default-ssid", perhaps?--I just made it short for the example):



                  sudo touch /etc/network/if-up.d/iwconfig && sudo chmod 700
                  /etc/network/if-up.d/iwconfig && sudo ln -s
                  /etc/network/if-up.d/iwconfig /etc/network/if-pre-up.d/iwconfig


                  Now edit /etc/network/if-up.d/iwconfig and add the SSID you want Ubuntu Server to connect to on startup:



                  #!/bin/sh
                  iwconfig wlan0 essid "YOUR_DEFAULT_SSID" mode managed


                  Now bring ifdown (if you haven't already), then ifup, and you should be golden now and when you reboot (as long as you're near your SSID.)




                  If you're out in public with your laptop with this config, you'll have to use: iwlist wlan0 scan, then sudo iwconfig essid "PUBLIC_ESSID" mode managed to connect with anything (and/or make a unique script for each place(s) you visit--just don't put any of these scripts under the 'if-up.rc.d' folder. /etc/network/interfaces can also handle location alias, so check the man/forums for help on this.)



                  Or you can try your luck with the CLI frontend for wicd when roaming about town:




                  sudo apt-get install wicd-curses








                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jun 12 '15 at 12:47









                  andyc

                  32




                  32










                  answered May 31 '15 at 2:45









                  Jasen Ramon

                  311




                  311




















                      up vote
                      1
                      down vote













                      Perhaps you could try using Network Manager or Wicd. While Network Manager does have a few GUI dependencies which you might dislike having on a headless server, connecting to wifi is quite simple. For a hotspot setup by my Android phone (called Android AP), I could connect using:



                      nmcli dev wifi connect 'Android AP' password test


                      You might find WICD more useful, as curses-based interface as well (http://manpages.ubuntu.com/manpages/lucid/man8/wicd-curses.8.html). I haven't used it much, so I am not sure of the syntax for connecting to wifi.



                      If /etc/network/interfaces is your only option, maybe you could show what you have done so far to see how we might fix it.






                      share|improve this answer




















                      • nmcli worked as a charm for me
                        – feniix
                        Jan 19 '15 at 15:08














                      up vote
                      1
                      down vote













                      Perhaps you could try using Network Manager or Wicd. While Network Manager does have a few GUI dependencies which you might dislike having on a headless server, connecting to wifi is quite simple. For a hotspot setup by my Android phone (called Android AP), I could connect using:



                      nmcli dev wifi connect 'Android AP' password test


                      You might find WICD more useful, as curses-based interface as well (http://manpages.ubuntu.com/manpages/lucid/man8/wicd-curses.8.html). I haven't used it much, so I am not sure of the syntax for connecting to wifi.



                      If /etc/network/interfaces is your only option, maybe you could show what you have done so far to see how we might fix it.






                      share|improve this answer




















                      • nmcli worked as a charm for me
                        – feniix
                        Jan 19 '15 at 15:08












                      up vote
                      1
                      down vote










                      up vote
                      1
                      down vote









                      Perhaps you could try using Network Manager or Wicd. While Network Manager does have a few GUI dependencies which you might dislike having on a headless server, connecting to wifi is quite simple. For a hotspot setup by my Android phone (called Android AP), I could connect using:



                      nmcli dev wifi connect 'Android AP' password test


                      You might find WICD more useful, as curses-based interface as well (http://manpages.ubuntu.com/manpages/lucid/man8/wicd-curses.8.html). I haven't used it much, so I am not sure of the syntax for connecting to wifi.



                      If /etc/network/interfaces is your only option, maybe you could show what you have done so far to see how we might fix it.






                      share|improve this answer












                      Perhaps you could try using Network Manager or Wicd. While Network Manager does have a few GUI dependencies which you might dislike having on a headless server, connecting to wifi is quite simple. For a hotspot setup by my Android phone (called Android AP), I could connect using:



                      nmcli dev wifi connect 'Android AP' password test


                      You might find WICD more useful, as curses-based interface as well (http://manpages.ubuntu.com/manpages/lucid/man8/wicd-curses.8.html). I haven't used it much, so I am not sure of the syntax for connecting to wifi.



                      If /etc/network/interfaces is your only option, maybe you could show what you have done so far to see how we might fix it.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered May 11 '14 at 20:35









                      muru

                      130k19273463




                      130k19273463











                      • nmcli worked as a charm for me
                        – feniix
                        Jan 19 '15 at 15:08
















                      • nmcli worked as a charm for me
                        – feniix
                        Jan 19 '15 at 15:08















                      nmcli worked as a charm for me
                      – feniix
                      Jan 19 '15 at 15:08




                      nmcli worked as a charm for me
                      – feniix
                      Jan 19 '15 at 15:08










                      up vote
                      0
                      down vote













                      A real good super easy way to set up WiFi on the command line is with nmtui but I can't find how to install it.






                      share|improve this answer


























                        up vote
                        0
                        down vote













                        A real good super easy way to set up WiFi on the command line is with nmtui but I can't find how to install it.






                        share|improve this answer
























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          A real good super easy way to set up WiFi on the command line is with nmtui but I can't find how to install it.






                          share|improve this answer














                          A real good super easy way to set up WiFi on the command line is with nmtui but I can't find how to install it.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Jan 15 '16 at 16:01









                          0xF2

                          2,32721945




                          2,32721945










                          answered Jan 15 '16 at 15:12









                          Raymond Day

                          113




                          113















                              protected by Community♦ May 26 '16 at 20:22



                              Thank you for your interest in this question.
                              Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                              Would you like to answer one of these unanswered questions instead?


                              Popular posts from this blog

                              pylint3 and pip3 broken

                              Missing snmpget and snmpwalk

                              How to enroll fingerprints to Ubuntu 17.10 with VFS491