• NetBSD
  • Question about NetBSD wireless and wpa_supplicant

oui

What I meant was going through the steps you detailed in your response.

I've already deleted what I added manually to /etc/wpa_supplicant.conf

Wireless doesn't work at all

Also, do you use a 5GHz and 2.4GHz dual band router? Some wireless cards don't support 5GHz so connect to your 2.4GHz wifi profile just in case.

    oui

    It's 5G. 2.4 is available on my network. This is a thinkpad t420. iirc I had no issues with the 5G on an install of Debian on the same machine

    nortonham ok after going through that process, on reboot I can see that wpa_supplicant is successful, but the output of ifconfig recognizes the wifi but says
    status: no network.

    It would be easier if you were more verbose:

    • share info about your hardware and the driver attached. Your NIC may only have partial/incomplete support or have been proven to be prone to misbehavior in the past. By the way, are you sure you didn't have to toggle license agreement in sysctl.conf? The man page for the relevant driver would tell so, were that to be the case.

    • share info about about the router and the network; is that WPA1/2, or RSN only? Is it a hidden network?

    • paste here anything related to network configuration (rc.conf, resolv.conf, and ifconfig.* if you created one). Misconfigured interface, routing or IPv6 related problems may be involved.

    • what does service dhcpcd status return?

    • what do ifconfig $interface list scan and wlanctl $interface return?

    • Stop/disable wpa_supplicant and dhcpcd, and run them manually in foreground (as user processes, not as system services), then paste the output here. [Run wpa_supplicant -i $interface -c /etc/wpa_supplicant.conf followed by dhcpcd $interface].

    • finally run ifconfig again and paste the output.

      JuvenalUrbino

      **My initial thought is it has something to do with the error "/etc/dhcpd.conf is not readable"

      I tried to answer as completely as could.

      It's a thinkpad T420. I don't have the exact wireless device name. I don't believe I had to toggle a license agreement, looking at iwn0 man page it doesn't seem like I needed to.

      The network is RSN, not hidden.

      ###rc.conf

      fconfig iwn0 up
      dhcpd=YES
      dhcpd_flags="-qM iwn0 -b"
      cgd=YES
      wscons=YES
      wpa_supplicant=YES
      wpa_supplicant_flags="-B -D bsd -i iwn0 -c /etc/wpa_supplicant.conf"

      /etc/resolv.conf

      domain rr.com
      nameserver 192.168.3.1

      /etc/ifconfig.iwn0

      up
      media autoselect
      dhcp

      *output of dhcpd status

      not running

      *ifocnfig iwn0 list scan

      output is a list of local available networks. Mine are visible.

      wlanctl $interface

      I won't post entire output unless you think it's helpful. I can see my (and other) available networks.

      #dhcpd $interface ##

      Can't open /etc/dhcpd.conf No such file or directory

      But the file exists?

      /var/run/rc.log: I have not posted the whole output because copy/paste is not possible. I am responding here on a different machine.

      /etc/dhcpd,conf not readable

      wpa_supplicant started successfully

        nortonham **My initial thought is it has something to do with the error "/etc/dhcpd.conf is not readable"

        Almost definitely. Your wireless is working properly, but the interface is not being assigned an address:

        *output of dhcpd status

        not running

        And, considering that dhcpcd.conf is not readable, as you wrote below, it's not surprising.

        It's a thinkpad T420. I don't have the exact wireless device name

        Learn how to get it then from the terminal. Shall prove useful in future.

        looking at iwn0 man page it doesn't seem like I needed to.

        correct 🙂

        The network is RSN, not hidden

        good to know, highlighting it as notice for others.

        # rc.conf
        fconfig iwn0 up

        what's that? this is not a rcvar. What you're looking for is:

        ifconfig_iwn0=up

        But you don't need it, since you already brought it up inside ifconfig.iwn0. Pick one of the two, whatever suites you best; but as it is, the configuration is redundant.

        # /etc/resolv.conf

        domain rr.com
        nameserver 192.168.3.1

        Is this really your router's internal address? Was this automatically generated by resolvconf(8), or you edited it by hand?

        # /etc/ifconfig.iwn0

        up
        media autoselect
        dhcp

        Again, the configuration should either take place here or inside rc.conf. Putting dhcp here triggers a hook for dhcpcd(8) to configure the interface and is equivalent to dhcpcd=YES in rc.conf.

        /etc/dhcpd,conf not readable

        Is the comma a typo? I suppose so. Anyway, since you somehow happened to mess with /etc permissions:

        $ chown root:wheel /etc/dhcpcd.conf
        $ chmod 644 /etc/dhpcd.conf

        However, at this point I would test all the ownership and permissions of NetBSD's standard files and directories against the common specification:

        $ mtree -e -p / -f /etc/mtree/NetBSD.dist

        This will return all altered permissions, ownership, paths, missing folders and files. Enjoy XD

        You can get the standard dhcpcd.conf for release -9 here.

          JuvenalUrbino

          I will respond more thoroughly when I have more time, but I do appreciate your help. This should be really straightforward, so I'm not sure what I'm doing wrong. I'm not sure if I did something wrong during the install process, or when trying to edit wpa_supplicant.conf by hand after installing,

          JuvenalUrbino

          JuvenalUrbino Stop/disable wpa_supplicant and dhcpcd, and run them manually in foreground (as user processes, not as system services), then paste the output here. [Run wpa_supplicant -i $interface -c /etc/wpa_supplicant.conf followed by dhcpcd $interface].

          When I run wpa_supplicant as a user process it returns "Successfully initialized wpa_supplicant" and nothing else. The wifi doesn't connect

          dhcpcd $interface returns "sending commands to master dhcpcd process" and nothing else

          • rvp replied to this.

            nortonham There are two different programs here: dhcpcd (the DHCP client, which is what you want) and dhcpd (the DHCP server, so not relevant here). Make sure that the correct config file exists for the program you're running in /etc/rc.conf--usually this is dhcpcd like in ref. files posted by @pin

              9 days later

              Well I got wireless working on FreeBSD 🙃

              I'll give it a shot again on NetBSD and let everyone know what happens

              • Jay likes this.
              7 months later

              Update:

              It's been several months, and many, many operating systems (BSD's, linuxen, illumos) on my spare T420. I decided to put NetBSD 9.3 on it recently.

              Wifi is working! I just wish I had an emoji of me banging my head against a wall for not figuring this out at the time ;)

              What I did to make it work. Firstly, I stopped trying to connect to my local 5ghz network, and just use the 2.4 network. I enabled wpa_supplicant in run time, and then dhcpcd as well. When I was sure everything worked I added the relevant info to rc.conf. On reboot everything worked as expected.

              A tip for anyone who might come across this thread: Slow down and be patient. I have a lack of patience at times, which definitely stopped me from resolving what was a very simple problem. Hence, why I don't work in IT.................

              As of now everything works. Relevant rc.conf for anyone who might see this in the future:

              dhcpcd=YES
              wpa_supplicant=YES

              /etc/wpa_supplicant.conf:

              ctrl_interface=/var/run/wpa_supplicant
              ctrl_interface_group=wheel

              network={
              ssid="myssid"
              psk="mypassword"
              }

              • Jay likes this.
              2 months later