User Tools

Site Tools


en:cs:op:bsd:wifi

FreeBSD Wifi Settings

Bu yazımda FreeBSD ortamında GUI olmadan nasıl wifi adaptörü ayarlamaları yapılır ondan bahsedeceğim.

Does the system see the wifi card?

The first thing we need to find out is if the system can use the wifi card.

In version 10 and above, the ifconfig command may no longer show the information of the wifi cards. So you can use the following command.

sysctl net.wlan.devices

After entering the command, it will give information according to the card type. In my system the feedback is as follows;

net.wlan.devices: iwn0

I understand from this that my intel card appears as a device with the code iwn0, and if you have an atheros card, it may be ath0. In the rest of the article, I will use iwn0 and you will use it if the value is different.

Most wifi cards are not enabled by default during boot. We will provide this. For this we just need to look at the man of the card.

man iwn

In the Intel IEEE 802.11n wireless network driver manual, it says I need to enter the following in /boot/loader.conf.

in my case it suggests that I add the following codes.

if_iwn_load="YES"
iwn1000fw_load="YES"
iwn100fw_load="YES"
iwn105fw_load="YES"
iwn135fw_load="YES"
iwn2000fw_load="YES"
iwn2030fw_load="YES"
iwn4965fw_load="YES"
iwn5000fw_load="YES"
iwn5150fw_load="YES"
iwn6000fw_load="YES"
iwn6000g2afw_load="YES"
iwn6000g2bfw_load="YES"
iwn6050fw_load="YES"

Then we need to create the device.

ifconfig wlan create wlandev iwn0

For this to happen automatically on every startup, we add the following codes in /etc/rc.conf.

wlans_iwn0="wlan0"

Then we can connect to the wifis around us.

We scan the wifis around with the following command.

ifconfig wlan0 up scan

Now that we know the name of the wifi network we want to connect to, let's connect.

You can connect to old type insecure wifi networks with the following command. Here the wifi network should not have a password.

ifconfig wlan0 ssid NYPL

To connect to WPA/WPA2/Personal networks, which are frequently used today, we need to do the following.

First, with the following command, we create a file in /etc/ that will hold the information of our wifi network.

wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf

Then we need to write the following information in this file. If the wifi address is a hidden address, we need to add the line scan_ssid=1.

But you don't need to add it for general home use as there is no hidden wifi.

network={
	# scan_ssid=1
	ssid="__WIFI_ADI__"
	psk="__SIFRE__"
}

Then we will use the following command to run DHCP.

dhclient wlan0

For this to be automatic, we need to add the following code in /etc/rc.conf.

ifconfig_wlan0="WPA SYNCDHCP"

Then we restart netif with the following command.

service netif restart && service routing restart

The wifi should now be operational.

Taken from UCH Wiki. https://wiki.ulascemh.com/doku.php?id=en:cs:op:bsd:wifi

en/cs/op/bsd/wifi.txt · Last modified: 2025/05/04 17:55 by ulascemh