Setup wifi network step-by-step

vince66

Well-Known Member

Thanks: 10
Messages: 387

#1
Hello guys,

I'm following the FreeBSD Handbook to setup a wifi network.
The Desktop computer on which I want to do this has a PCI wifi network card (you can see it in the picture below).

IMG_20180914_152356.jpg




STEP 1: IDENTIFY THE NETWORK CARD
The command: sysctl net.wlan.devices returns a blank prompt.
So, I've analyzed the installed hardware with commands: pciconf -lv and dmesg | grep pci

IMG_20180914_160355.jpg


If I've well understood, my PCI network card on pci 0:1:0:0 has no a driver attached (I think that this means I need to search the correct driver for the wifi connected card).

This device is shown as using an Broadcom chip BCM43131.

STEP 2: IDENTIFY THE DRIVER FOR THE NETWORK CARD
To do this I've run the command: apropos Broadcom, obtaining a list of possible drivers.

QUESTION.
1 - I think that the next step is to notify the driver to the kernel. In which a way ?
2 - It seems that what I've shown here per images is hardware indipendent, that is running the previous commands on a laptop (booted with the same USB stick) I obtain the same results.

Any help is apreciated.
Thanks in advance.
 
OP
OP
vince66

vince66

Well-Known Member

Thanks: 10
Messages: 387

#4
Hello.

Are you sure ? Have you just tried ?
Because the bwi(4) says:

" This driver requires firmware to be loaded before it will work. The ports/net/bwi-firmware-kmod port needs to be installed before ifconfig(8) will work. "

Googling it also seems that:

" The firmware port installs a module that must also be loaded:

bwi_v3_ucode "

Have you experienced with the above interface card driver ?


Another question:

To join the BSS network of my lab with network name ``my_netlab'', I use the command:

ifconfig wlan create wlandev bwi0 ssid my_netlab up


where I've had to specify the wpa/wpa2 pass_key ?
 

pyret

New Member

Thanks: 3
Messages: 17

#5
/etc/wpa_supplicant.conf
Code:
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
  ssid="spooky"
  scan_ssid=0
  psk="michael_myers"
  priority=5
  proto=WPA2
}
/etc/rc.conf
Code:
wlans_wpi0="wlan0"
ifconfig_wlan0="WPA  inet 192.168.1.4 netmask 255.255.255.0 ssid 'spooky' bssid ha:ll:ow:ee:nh:20"
 
OP
OP
vince66

vince66

Well-Known Member

Thanks: 10
Messages: 387

#6
/etc/wpa_supplicant.conf
Ok ... I've again do my question in a wrong way. I try to be more clear:

Are the info contained in the /etc/wpa_supplicant.conf and /etc/rc.conf related with the driver of the network card ?
( the correct driver seems to be bwi(4), or probably the new one bwn(4) ).

If they are related in which part of the files the driver bwi is mentioned ?

That is:
/etc/wpa_supplicant.conf and /etc/rc.conf are configuration files executed at the boot time.
If so, their task is to inform the driver to sniff the network, to start up a connections, etc .... etc ......

Or not ?

Thanks very much.
 

kpa

Beastie's Twin

Thanks: 1,754
Messages: 6,234

#7
The rc.conf(5) settings are used to bring up the interface first to a known state. Then wpa_supplicant(8) is hooked up to process where the interface is told to associate with an access point and wpa_supplicant(8) will then apply its configuration based on the matching SSID to the interface and will set up the encryption. After this the IP address set up is done either by manual set up or DHCP.

Btw the configuration files are not executed, they are not program code where statements are executed in order. They are rather a set of settings that are either simple variable assignments or applied if they match certain conditions like the SSID. With rc.conf(5) the order isn't important but if you repeat the same setting twice only the latter will be in effect, for example:

Code:
hostname="host1.mydomain"
...
hostname="host2.mydomain"
With those hostname would be set just to "host2.mydomain".
 
OP
OP
vince66

vince66

Well-Known Member

Thanks: 10
Messages: 387

#8
/etc/wpa_supplicant.conf
The rc.conf(5) settings are used to bring up the interface first to a known state. Then wpa_supplicant(8) is hooked up to process where the interface is told to associate with an access point and wpa_supplicant(8)
Ok ... if it is so simple I only need to "copy and paste" the code shown in the above files.

Let me try to arrange them for my network ... I'll post the results here.


A question please .....

Add in /boot/loader.conf the bwi driver
Once the (correct) network card driver has been installed which command can I use to see if the card is usable ?
- ifconfig(8) is one for example ...
- dmesg(8) (related to the boot phase) ....
- which others ????
 
OP
OP
vince66

vince66

Well-Known Member

Thanks: 10
Messages: 387

#10
the correct kernel module
The problem is:
is there a way to find the name of correct kernel module.

In this case is maybe the driver's name: bwn ?

The rc.conf(5) settings are used to bring up the interface first to a known state.
Before configure rc.conf, immediately after the driver has been installed, how can I see if the net card is recognized by FreeBSD ?
I thought ifconfig, but ....
neither the driver name nor any reference to the hardware card are shown running ifconfig.

Thanks !!!
 
Top