# build 11 on asus ux31a



## clawhammer (Mar 26, 2017)

I installed this awhile ago but I could never get it to connect to the internet. In config it doesn't recognize my NIC and idk how to get the wifi to work. I am trying to do this on the console terminal. Can anyone help me figure this out? Ive read the freebsd manual about networking and tried to find stuff on google regarding my model but I became more confused.

I am just using the terminal to program c on freebsd as I only used windows before. But trying to set the internet is really hurting my brain.


----------



## Phishfry (Mar 26, 2017)

First you need to establish your wireless card.
Searching it looks like your wireless card is an Intel 6235.
Run this command from the command prompt to confirm if iwn0 is your correct interface:
`sysctl net.wlan.devices`
It should return= `sysctl net.wlan.devices: iwn0`
If not post your output.

If so use this for setup:

Easy editor is nice for appending the config file:`ee /etc/rc.conf`. Add these lines:

```
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
```
Escape key exits.
After edit reboot and check `ifconfig`. You should now have device wlan0.

I am unsure if you need to load any firmeware for this driver. The manual page may need updating.
You should try first without firmware. The kernel configuration part is dated. You do not need to compile.
https://www.freebsd.org/cgi/man.cgi?query=iwn&sektion=4

You can either set wpa passphrase manually or use `wpa_cli`.


----------



## clawhammer (Mar 27, 2017)

it finds the network card but won't connect to the wifi. it can't find any dhcp servers when I'm in bsdconfig.

when i run ifconfig it just displays a whole bunch of stuff that I don't know what it means.


----------



## Phishfry (Mar 27, 2017)

What does `dhclient -d wlan0` show? It is your DHCP client.
Can you access your Access Point and figure out whats up. Most stock AP/routers come with DHCP turned on so check that out. You can do static IP but the AP would need to be setup for that.

Do you have the iwn0 wireless adapter?

I deleted my `bsdconfig` instructions because FreeBSD11 changed wireless setup and `bsdconfig` is not working like it should for wifi. It does allow you to pick an AP and set passphrase once the card is configured. Some things there are not working right.


----------



## clawhammer (Mar 27, 2017)

dhclient[1829] dhclient already running pid 1758
dhclienct[1829] exiting

my router is using wpa2
dhcp is on

i put all the router ip address and my isp ip address in bsdconfig before but that didn't help.


----------



## Phishfry (Mar 27, 2017)

Can you post this output:
ifconfig wlan0


----------



## Phishfry (Mar 27, 2017)

Here is mine.
`wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
   ether e4:d5:3d:38:2e:7f
   inet 192.168.27.106 netmask 0xffffff00 broadcast 192.168.27.255
   nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
   media: IEEE 802.11 Wireless Ethernet MCS mode 11na
   status: associated
   ssid APOO channel 48 (5240 MHz 11a ht/40-) bssid 00:15:6d:84:01:01
   regdomain 106 indoor ecm authmode WPA1+WPA2/802.11i privacy ON
   deftxkey UNDEF AES-CCM 2:128-bit AES-CCM 3:128-bit txpower 30 bmiss 7
   mcastrate 6 mgmtrate 6 scanvalid 60 ampdulimit 64k ampdudensity 8
   shortgi wme burst roaming MANUAL
   groups: wlan`

What your looking for is the status and inet lines.


----------



## clawhammer (Mar 27, 2017)

pic


----------



## Phishfry (Mar 27, 2017)

I see your status shows: no carrier
It needs to read: associated

You need to be associated with an AP to get a dhcp address.


----------



## clawhammer (Mar 27, 2017)

i put my routers ip in bsdconfig.


----------



## Phishfry (Mar 27, 2017)

You can actually use `wpa-cli` to scan and connect.
http://sirlagz.net/2012/08/27/how-to-use-wpa_cli-to-connect-to-a-wireless-network/


----------



## clawhammer (Mar 27, 2017)

when i run it it says wpa_supplicant isn't running.


----------



## Phishfry (Mar 27, 2017)

That is a problem. Try and add this line to your config and reboot. See if `wpa_cli` starts then.

/etc/rc.conf
`wpa_supplicant_enable="YES"`

Some sites with valid FreeBSD11 wireless setup instructions.
https://www.freebsd.org/doc/handbook/network-wireless.html
http://srobb.net/fbsdquickwireless.html
https://vzaigrin.wordpress.com/2016/10/16/running-freebsd-11-on-raspberry-pi/

Do you have the /etc/wpa_supplicant.conf file created with your ssid and passphrase? wpa_supplicant might require that to startup.


----------



## clawhammer (Mar 27, 2017)

i already tried the wpa_supplicant)enable.

when i do ifconfig wlan0 create wlandevice iwn0 it says
ifconfig: create: bad value

thanks for the websites but I've already looked at those lol. I see one or two websites where people say they got it working on this laptop but don't provide any specifics.


----------



## Phishfry (Mar 27, 2017)

That is OK. That is what a proper interface shows when already configured.

Check or create that /etc/wpa_supplicant.conf as per the instructions.


----------



## clawhammer (Mar 27, 2017)

same thing.

http://kronometrix.blogspot.com/2014/10/asus-zenbook-and-freebsd-11.html

that person says freebsd 11 automatically detects the card so idk.


----------



## Phishfry (Mar 27, 2017)

After /etc/wpa_supplicant.conf is populated does wpa_cli work?

From your ifconfig the card looks fine.

You can manually start `wpa_supplicant` like this:
`wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf`


----------



## clawhammer (Mar 27, 2017)

I'm sorry I'm a bit rusty with FreeBSD so what does populated mean?

When I ran that command it said

```
failed to open config file '/etc/wpa_supplicant.conf', error: no such file or directory. failed to read or parse configuration '/etc/wpa_supplicant.conf'
```


----------



## SirDice (Mar 27, 2017)

Handbook: 30.3.4.1.3.1. WPA-PSK


----------

