Goal: Associate a station to an AP with the WPS Push and PIN methods.
In this test scenario, a LANforge CT523 is used to simulate a station connecting to a commercial AP with WPS Push mode and also with WPS PIN mode. Currently this test requires the use of a terminal on the LANforge system to run some WPS commands.
Create a virtual wireless station.
Go to the Port Mgr tab.
Check wiphy0 settings by selecting wiphy0 and click Modify.
If the Down checkbox is selected, Click Set IF Down on the left, then uncheck the Down checkbox.
Make sure Channel/Freq is set to AUTO.
Click OK.
Back in the Port Mgr tab, select port wiphy0 and click Create.
Select WiFi STA.
Select DHCP-IPv4.
Set Quantity to 1.
Set STA ID to 0.
Set SSID to [BLANK]. Don't forget to add the brackets.
Click Apply.
Create a wpa_supplicant.conf file.
Open a terminal on the LANforge system.
Create the file wpa_supplicant.conf in /etc that contains the below text. Alternatively, the command in the next step can be used to create the file. ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 update_config=1
In the open terminal run the below command to create the wpa_supplicant.conf file. NOTE: Please make sure wpa_supplicant.conf doesn't already exist in the /etc directory.
First become root: su - Then run: if [ ! -f '/etc/wpa_supplicant.conf' ]; then printf %'s\n' ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 update_config=1 > /etc/wpa_supplicant.conf; fi
Keep in mind the wpa_supplicant.conf file will save AP information for stations. If you want a station to forget the AP information, you'll need to recreate the wpa_supplicant.conf file.
Configure sta0 to use a the wpa_supplicant.conf file created in step 2.
Select sta0 in the Port mgr tab and click Modify.
In the Misc Configuration tab, select Custom WPA Cfg then inside the text field for WPA Cfg, add the path of the wpa_supplicant.conf file. In this case, we'll be using /etc/wpa_supplicant.conf
Click OK.
Associate the station using WPS Push mode.
In a terminal on the LANforge system, enter in the below command and then push your AP's WPS button. If you aren't root, use su - wpa_cli -i sta0 wps_pbc
Your station should now associate and get an IP. Note: The SSID field in the sta0 Modify window will remain as [BLANK]. You also may see a different SSID in the View Details window, this is a bug and can be ignored for now as long as the BSSID is correct.
Associate the station using WPS PIN mode.
Obtain your AP's BSSID and WPS PIN. This information can usually be found on the AP label or in the AP's software.
In a terminal on the LANforge system, enter in the below command. Replace the x's with the BSSID and numbers with the PIN. If you aren't root, use su - wpa_cli -i sta0 wps_reg xx:xx:xx:xx:xx:xx 12345678
Your station should now associate and get an IP. Note: The SSID field in the sta0 Modify window will remain as [BLANK]. You also may see a different SSID in the View Details window, this is a bug and can be ignored for now as long as the BSSID is correct.