# Wireless set up for FreeBSD 11.1; How to?



## jaymax (Mar 17, 2018)

I am running a double booted HP Laptop (17-ak013dx; O/S Windows 64 bit) with a USB mounted external HD, from which FreeBSD 11.1 is operated. The system hardware runs an ethernet Realtek RTL8723DE adapter, whose cable and Wi-Fi mode runs fine for the Windows 10 boot. With the FreeBSD boot only the cable mode access to the internet is operable, NO Wi-Fi! Obviously, compromising FreeBSD - laptop's mobility.

Form what I have been able to learn so far, and correct me if I am in error, there are no FreeBSD drivers for this/these Realtek adapters. The workaround given was or is, is to install a Virtual Machine (VM) - Linux proposed and then tunnel through the VLAN of that facility to the outside. On the other hand, there seems to be an older partial approach given in the HOWTO Forum at HOWTO: Wireless WPA2-Enterprise Connection.

The latter approach which seemed to be broadly highlighted was the use of a VM through the use of a bhyve hypervisor. I am sure this is not the sole approach.

Can someone direct me how best to proceed.


----------



## scottro (Mar 17, 2018)

The easiest workaround, if it's practical for you, is to use some kind of USB to wireless adapter.  If you're in the US, the Edimax is available for less than $10 from Amazon.
https://www.amazon.com/Edimax-EW-7811Un-150Mbps-Raspberry-Supports/dp/B003MTTJOY 

It works with FreeBSD, though you have to add a couple of lines to /boot/loader.conf


----------



## jaymax (Apr 5, 2018)

Hi!
I am running a double booted HP Laptop (17-ak013dx; O/S Windows 64 bit) with a USB mounted external HD, from which FreeBSD 11.1 is operating

I have configured an Edimax EW-7811Un WiFi Nano adapter as follows -

Added to
 /boot/loader.conf:

```
if_urtwn_load="YES"
        legal.realtek.license_ack=1
```

/boot/loader.conf:

```
if_urtwn_load="YES"
        legal.realtek.license_ack=1
```

 /etc/rc.conf:

```
wlans_urtwn0="wlan0"
        ifconfig_wlan0="WPA DHCP"
```
 
Created
/etc/wpa_supplicant.conf:

```
network={
            ssid="ZZZvvvvvvvvvvccc"
            psk="sktgknt83boodl43n"
        }
```

The installation and setup seemed to be successful as evidenced from

`# ifconfig`

```
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether xx:xx:xx:xx:xx:xx
        hwaddr xx:xx:xx:xx:xx:xx
        inet 192.168.1.52 netmask 0xffffff00 broadcast 192.168.1.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        groups: lo
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether **:**:**:**:**:**
        hwaddr **:**:**:**:**:**
        inet 192.168.1.83 netmask 0xffffff00 broadcast 192.168.1.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
        status: associated
        ssid ????xxxnnn channel 1 (2412 MHz 11g ht/20) bssid **:**:**:**:**:**
        regdomain FCC country US authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60
        protmode CTS ht20 -ampdutx ampdurx ampdulimit 64k ampdudensity 16
        -stbc wme roaming MANUAL
        groups: wlan
```

So far everything seems OK, but any attempt to ping it, sftp or shell access (putty) from another machine or to ping another etc - it goes no where.
Except when a network cat cable is connected.
`# ping 192.168.1.83`

```
PING 192.168.1.83 (192.168.1.83): 56 data bytes
64 bytes from 192.168.1.83: icmp_seq=0 ttl=64 time=0.027 ms
...
...
64 bytes from 192.168.1.83: icmp_seq=1 ttl=64 time=0.036 ms
```

Now the rc.conf file contents ==>


```
sendmail_enable="NONE"
hostname="Machine1"
ifconfig_re0="inet 192.168.1.52 netmask 255.255.255.0"
defaultrouter="192.168.1.254"
sshd_enable="YES"
ntpd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
tcsd_enable="YES"
# GNOME set up
dbus_enable="YES"
hald_enable="YES"
gdm_enable="YES"
gnome_enable="YES"
# FTP server set up
ftpd_enable="YES"
# Configuring LINUX binary compatibillities
linux_enable=YES
#   options     LINUX
# Apache setUp
apache24_enable="yes"
# Enabling Wi-Fi Nano USB Adapter [EW-7811-Un]
   wlans_urtwn0="wlan0"
   ifconfig_wlan0="WPA DHCP"
```


I guess I have to add something like =>
`ifconfig_????="inet 192.168.1.83 netmask 255.255.255.0"`
to the rc.conf file, but I'm not too sure what it should be, even if that single line suffices and further where best to add it, as in which line etc.

Thanks!


----------



## ronaldlees (Apr 6, 2018)

You are trying to ping the machine you just set up for WiFi, from another machine, also on WiFi?  I'm not sure I understand your desired result.  Anyway - I *truly* hope that is not your real psk in the wpa_supplicant.conf listing!


----------



## jaymax (Apr 7, 2018)

ronaldlees said:


> You are trying to ping the machine you just set up for WiFi, from another machine, also on WiFi?  I'm not sure I understand your desired result.  !


 Thanks! Quite correct, the two machines are on the same LAN, using the same 192.168.1.... address.


----------



## jaymax (Apr 28, 2018)

Following up from the last posting:
The ifconfig utility added the following (wlan0) to the listing of re0 and lo0.
Here is the wlan0 w/ some modifications.



```
lan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether **:**:**:**:**:**
        hwaddr **:**:**:**:**:**
        inet 192.168.1.83 netmask 0xffffff00 broadcast 192.168.1.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
        status: associated
        ssid ????xxxnnn channel 1 (2412 MHz 11g ht/20) bssid **:**:**:**:**:**
        regdomain FCC country US authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60
        protmode CTS ht20 -ampdutx ampdurx ampdulimit 64k ampdudensity 16
        -stbc wme roaming MANUAL
        groups: wlan
```
 
It lists "inet 192.168.1.83 netmask 0xffffff00 broadcast 192.168.1.255", which I assume is the IP address for the wlan0 interface.

Now the end of the rc.conf file lists

```
# Enabling Wi-Fi Nano USB Adapter [EW-7811-Un]
       wlans_urtwn0="wlan0"
       ifconfig_wlan0="WPA DHCP"
```
 
That did not seem to work in providing access to the WiFi router.
Furthermore, I prefer not to use a DHCP, changing with each lease, and prefer to use a fixed static IP.
So I changed it to the following -


```
# Enabling Wi-Fi Nano USB Adapter [EW-7811-Un]
       wlans_urtwn0="wlan0"
       ifconfig_wlan0="192.168.1.83"
```

Please comment.


----------



## ronaldlees (Apr 28, 2018)

I often find that it is more convenient to just set the static IP for a client in the WiFi router's DHCP configuration tab. You can usually set DHCP (here I have a Pace/AT&T setup) to always issue the same IP address to a given MAC.  This is convenient for machines you want to work as servers, etc, and doesn't involve manual setup on the clients.


----------



## jaymax (Apr 28, 2018)

Point about the static IP taken, but before that why is the 192.168.1.83  invisible to the WiFi, is there something amiss with my setup? If I use a cable to a hub it 'glows', I can remotely ping it, use (s)ftp or have shell access (sshd) to it.


----------



## SirDice (Apr 30, 2018)

You're missing the WPA configuration on the interface. So the wireless is never associated.


----------



## jaymax (Apr 30, 2018)

SirDice said:


> You're missing the WPA configuration on the interface. So the wireless is never associated.


How do I correct this?


----------



## jaymax (May 4, 2018)

SirDice said:


> You're missing the WPA configuration on the interface. So the wireless is never associated.


What do I have to add and to which file?

I already have this 

`network={
            ssid="ZZZvvvvvvvvvvccc"
            psk="sktgknt83boodl43n"`

in the /etc/wpa_supplicant.conf file, do I need to have it somewhere else? 
if so where?


----------



## VladiBG (May 4, 2018)

It's not a good idea to have static ip on your wifi but if you insist then set it as this in your /etc/rc.conf
ifconfig_wlan0="WPA inet 192.168.1.83 netmask 255.255.255.0 ssid ZZZvvvvvvvvvvccc"

It's better to leave it by DHCP as you did in the beginning.
ifconfig_wlan0="WPA DHCP"

You should check the Handbook here 30.3. Wireless Networking


----------



## Minbari (May 4, 2018)

Add `key_mgmt=WPA-PSK`to your /etc/wpa_supplicant.conf


----------



## nik0tine (Oct 6, 2018)

and:
 proto=RSN
!! no quotes


----------

