Wlan with wpa_supplicant under NixOS?











up vote
1
down vote

favorite












How to set up networking (wlan) with wpa_supplicant on NixOS? Whenever I try to connect to my local wlan network, I get CONN_FAILED as reason, which is a bit uninformative. It also tells me that my pks is not valid (WRONG_KEY) but I trible confirmed that it is right and I used the configuration with the very same key (git version controlled) on the network on my Archlinux box before and it worked.










share|improve this question


























    up vote
    1
    down vote

    favorite












    How to set up networking (wlan) with wpa_supplicant on NixOS? Whenever I try to connect to my local wlan network, I get CONN_FAILED as reason, which is a bit uninformative. It also tells me that my pks is not valid (WRONG_KEY) but I trible confirmed that it is right and I used the configuration with the very same key (git version controlled) on the network on my Archlinux box before and it worked.










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      How to set up networking (wlan) with wpa_supplicant on NixOS? Whenever I try to connect to my local wlan network, I get CONN_FAILED as reason, which is a bit uninformative. It also tells me that my pks is not valid (WRONG_KEY) but I trible confirmed that it is right and I used the configuration with the very same key (git version controlled) on the network on my Archlinux box before and it worked.










      share|improve this question













      How to set up networking (wlan) with wpa_supplicant on NixOS? Whenever I try to connect to my local wlan network, I get CONN_FAILED as reason, which is a bit uninformative. It also tells me that my pks is not valid (WRONG_KEY) but I trible confirmed that it is right and I used the configuration with the very same key (git version controlled) on the network on my Archlinux box before and it worked.







      networking wireless-networking wpa-supplicant






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 6 '15 at 20:16









      musicmatze

      1084




      1084






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          I doubt it will become any more informative than what you already have, yet here we go.



          First we need to store our WPA2-PSK secrets:



                 wpa_passphrase MyWifiSSID MySecretPassword > wpa_supplicant.conf


          Now make sure you have stopped a Network Manager, if you use one, and issue all the following commands as sudo. We clean the interface (I call it wlan0):



                  ip link set dev wlan0 down
          ip addr flush dev wlan0
          ip link set dev wlan0 up


          Now we associate to the AP:



                   wpa_supplicant -B -i wlan0 -Dnl80211 -c wpa_supplicant.conf
          dhclient wlan0


          If the network is correctly configured, then you are done. If there are some errors in the DHCP configuration, you may be missing either the default gateway or the DNS servers. You can set them just as I am about to do in the case of a static IP.



          If you do not have a DHCP server, or if you wish to give yourself a static IP (say, 192.168.1.200), then skip the last command above, and issue instead



                   ip addr add 192.168.1.200/24 dev wlan0


          Remember, 24 is the network mask in CIDR notation. If yours differs, please adjust accordingly. Once this is done, you will need a default gateway:



                   ip route add default via 192.168.1.1 dev wlan0


          where 192.168.1.1 is the address of your home router/gateway, and DNS servers,



                   echo nameserver 8.8.8.8 >> /etc/resolv.conf
          echo nameserver 8.8.4.4 >> /etc/resolv.conf


          This is it.






          share|improve this answer























          • I will try this out asap, hang tight!
            – musicmatze
            Jul 8 '15 at 18:42










          • This works, I get wlan, but I still cannot ping in my internal network.
            – musicmatze
            Jul 11 '15 at 7:47










          • @musicmatze Perhaps dhcpd isn't running? Or not on that interface?
            – Daniel Jour
            Nov 25 '15 at 19:26






          • 1




            @DanielJour No, that's not the problem. Most likely he did not setup a default gateway and the DNS servers.
            – MariusMatutiae
            Nov 25 '15 at 22:31










          • It works now. I'm not sure about DNS or gateway... I'll mark this as appropriate answer.
            – musicmatze
            Nov 27 '15 at 10:30











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f937059%2fwlan-with-wpa-supplicant-under-nixos%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          5
          down vote



          accepted










          I doubt it will become any more informative than what you already have, yet here we go.



          First we need to store our WPA2-PSK secrets:



                 wpa_passphrase MyWifiSSID MySecretPassword > wpa_supplicant.conf


          Now make sure you have stopped a Network Manager, if you use one, and issue all the following commands as sudo. We clean the interface (I call it wlan0):



                  ip link set dev wlan0 down
          ip addr flush dev wlan0
          ip link set dev wlan0 up


          Now we associate to the AP:



                   wpa_supplicant -B -i wlan0 -Dnl80211 -c wpa_supplicant.conf
          dhclient wlan0


          If the network is correctly configured, then you are done. If there are some errors in the DHCP configuration, you may be missing either the default gateway or the DNS servers. You can set them just as I am about to do in the case of a static IP.



          If you do not have a DHCP server, or if you wish to give yourself a static IP (say, 192.168.1.200), then skip the last command above, and issue instead



                   ip addr add 192.168.1.200/24 dev wlan0


          Remember, 24 is the network mask in CIDR notation. If yours differs, please adjust accordingly. Once this is done, you will need a default gateway:



                   ip route add default via 192.168.1.1 dev wlan0


          where 192.168.1.1 is the address of your home router/gateway, and DNS servers,



                   echo nameserver 8.8.8.8 >> /etc/resolv.conf
          echo nameserver 8.8.4.4 >> /etc/resolv.conf


          This is it.






          share|improve this answer























          • I will try this out asap, hang tight!
            – musicmatze
            Jul 8 '15 at 18:42










          • This works, I get wlan, but I still cannot ping in my internal network.
            – musicmatze
            Jul 11 '15 at 7:47










          • @musicmatze Perhaps dhcpd isn't running? Or not on that interface?
            – Daniel Jour
            Nov 25 '15 at 19:26






          • 1




            @DanielJour No, that's not the problem. Most likely he did not setup a default gateway and the DNS servers.
            – MariusMatutiae
            Nov 25 '15 at 22:31










          • It works now. I'm not sure about DNS or gateway... I'll mark this as appropriate answer.
            – musicmatze
            Nov 27 '15 at 10:30















          up vote
          5
          down vote



          accepted










          I doubt it will become any more informative than what you already have, yet here we go.



          First we need to store our WPA2-PSK secrets:



                 wpa_passphrase MyWifiSSID MySecretPassword > wpa_supplicant.conf


          Now make sure you have stopped a Network Manager, if you use one, and issue all the following commands as sudo. We clean the interface (I call it wlan0):



                  ip link set dev wlan0 down
          ip addr flush dev wlan0
          ip link set dev wlan0 up


          Now we associate to the AP:



                   wpa_supplicant -B -i wlan0 -Dnl80211 -c wpa_supplicant.conf
          dhclient wlan0


          If the network is correctly configured, then you are done. If there are some errors in the DHCP configuration, you may be missing either the default gateway or the DNS servers. You can set them just as I am about to do in the case of a static IP.



          If you do not have a DHCP server, or if you wish to give yourself a static IP (say, 192.168.1.200), then skip the last command above, and issue instead



                   ip addr add 192.168.1.200/24 dev wlan0


          Remember, 24 is the network mask in CIDR notation. If yours differs, please adjust accordingly. Once this is done, you will need a default gateway:



                   ip route add default via 192.168.1.1 dev wlan0


          where 192.168.1.1 is the address of your home router/gateway, and DNS servers,



                   echo nameserver 8.8.8.8 >> /etc/resolv.conf
          echo nameserver 8.8.4.4 >> /etc/resolv.conf


          This is it.






          share|improve this answer























          • I will try this out asap, hang tight!
            – musicmatze
            Jul 8 '15 at 18:42










          • This works, I get wlan, but I still cannot ping in my internal network.
            – musicmatze
            Jul 11 '15 at 7:47










          • @musicmatze Perhaps dhcpd isn't running? Or not on that interface?
            – Daniel Jour
            Nov 25 '15 at 19:26






          • 1




            @DanielJour No, that's not the problem. Most likely he did not setup a default gateway and the DNS servers.
            – MariusMatutiae
            Nov 25 '15 at 22:31










          • It works now. I'm not sure about DNS or gateway... I'll mark this as appropriate answer.
            – musicmatze
            Nov 27 '15 at 10:30













          up vote
          5
          down vote



          accepted







          up vote
          5
          down vote



          accepted






          I doubt it will become any more informative than what you already have, yet here we go.



          First we need to store our WPA2-PSK secrets:



                 wpa_passphrase MyWifiSSID MySecretPassword > wpa_supplicant.conf


          Now make sure you have stopped a Network Manager, if you use one, and issue all the following commands as sudo. We clean the interface (I call it wlan0):



                  ip link set dev wlan0 down
          ip addr flush dev wlan0
          ip link set dev wlan0 up


          Now we associate to the AP:



                   wpa_supplicant -B -i wlan0 -Dnl80211 -c wpa_supplicant.conf
          dhclient wlan0


          If the network is correctly configured, then you are done. If there are some errors in the DHCP configuration, you may be missing either the default gateway or the DNS servers. You can set them just as I am about to do in the case of a static IP.



          If you do not have a DHCP server, or if you wish to give yourself a static IP (say, 192.168.1.200), then skip the last command above, and issue instead



                   ip addr add 192.168.1.200/24 dev wlan0


          Remember, 24 is the network mask in CIDR notation. If yours differs, please adjust accordingly. Once this is done, you will need a default gateway:



                   ip route add default via 192.168.1.1 dev wlan0


          where 192.168.1.1 is the address of your home router/gateway, and DNS servers,



                   echo nameserver 8.8.8.8 >> /etc/resolv.conf
          echo nameserver 8.8.4.4 >> /etc/resolv.conf


          This is it.






          share|improve this answer














          I doubt it will become any more informative than what you already have, yet here we go.



          First we need to store our WPA2-PSK secrets:



                 wpa_passphrase MyWifiSSID MySecretPassword > wpa_supplicant.conf


          Now make sure you have stopped a Network Manager, if you use one, and issue all the following commands as sudo. We clean the interface (I call it wlan0):



                  ip link set dev wlan0 down
          ip addr flush dev wlan0
          ip link set dev wlan0 up


          Now we associate to the AP:



                   wpa_supplicant -B -i wlan0 -Dnl80211 -c wpa_supplicant.conf
          dhclient wlan0


          If the network is correctly configured, then you are done. If there are some errors in the DHCP configuration, you may be missing either the default gateway or the DNS servers. You can set them just as I am about to do in the case of a static IP.



          If you do not have a DHCP server, or if you wish to give yourself a static IP (say, 192.168.1.200), then skip the last command above, and issue instead



                   ip addr add 192.168.1.200/24 dev wlan0


          Remember, 24 is the network mask in CIDR notation. If yours differs, please adjust accordingly. Once this is done, you will need a default gateway:



                   ip route add default via 192.168.1.1 dev wlan0


          where 192.168.1.1 is the address of your home router/gateway, and DNS servers,



                   echo nameserver 8.8.8.8 >> /etc/resolv.conf
          echo nameserver 8.8.4.4 >> /etc/resolv.conf


          This is it.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 22 at 11:04

























          answered Jul 8 '15 at 9:51









          MariusMatutiae

          37.9k95195




          37.9k95195












          • I will try this out asap, hang tight!
            – musicmatze
            Jul 8 '15 at 18:42










          • This works, I get wlan, but I still cannot ping in my internal network.
            – musicmatze
            Jul 11 '15 at 7:47










          • @musicmatze Perhaps dhcpd isn't running? Or not on that interface?
            – Daniel Jour
            Nov 25 '15 at 19:26






          • 1




            @DanielJour No, that's not the problem. Most likely he did not setup a default gateway and the DNS servers.
            – MariusMatutiae
            Nov 25 '15 at 22:31










          • It works now. I'm not sure about DNS or gateway... I'll mark this as appropriate answer.
            – musicmatze
            Nov 27 '15 at 10:30


















          • I will try this out asap, hang tight!
            – musicmatze
            Jul 8 '15 at 18:42










          • This works, I get wlan, but I still cannot ping in my internal network.
            – musicmatze
            Jul 11 '15 at 7:47










          • @musicmatze Perhaps dhcpd isn't running? Or not on that interface?
            – Daniel Jour
            Nov 25 '15 at 19:26






          • 1




            @DanielJour No, that's not the problem. Most likely he did not setup a default gateway and the DNS servers.
            – MariusMatutiae
            Nov 25 '15 at 22:31










          • It works now. I'm not sure about DNS or gateway... I'll mark this as appropriate answer.
            – musicmatze
            Nov 27 '15 at 10:30
















          I will try this out asap, hang tight!
          – musicmatze
          Jul 8 '15 at 18:42




          I will try this out asap, hang tight!
          – musicmatze
          Jul 8 '15 at 18:42












          This works, I get wlan, but I still cannot ping in my internal network.
          – musicmatze
          Jul 11 '15 at 7:47




          This works, I get wlan, but I still cannot ping in my internal network.
          – musicmatze
          Jul 11 '15 at 7:47












          @musicmatze Perhaps dhcpd isn't running? Or not on that interface?
          – Daniel Jour
          Nov 25 '15 at 19:26




          @musicmatze Perhaps dhcpd isn't running? Or not on that interface?
          – Daniel Jour
          Nov 25 '15 at 19:26




          1




          1




          @DanielJour No, that's not the problem. Most likely he did not setup a default gateway and the DNS servers.
          – MariusMatutiae
          Nov 25 '15 at 22:31




          @DanielJour No, that's not the problem. Most likely he did not setup a default gateway and the DNS servers.
          – MariusMatutiae
          Nov 25 '15 at 22:31












          It works now. I'm not sure about DNS or gateway... I'll mark this as appropriate answer.
          – musicmatze
          Nov 27 '15 at 10:30




          It works now. I'm not sure about DNS or gateway... I'll mark this as appropriate answer.
          – musicmatze
          Nov 27 '15 at 10:30


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f937059%2fwlan-with-wpa-supplicant-under-nixos%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          QoS: MAC-Priority for clients behind a repeater

          Ивакино (Тотемский район)

          Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)