There is a netbook under ubuntu 14 lts , there is a router with wifi and wps , the password is unknown, but the wps-pin and mac-address are known.
How to connect to wifi by pressing the wps button on the router?
free translation of the answer to the question: How to connect to Wi-Fi AP through WPS? taking into account this information (hereinafter it is understood that your wifi interface is called wlan0
):
create (or edit) the /etc/wpa_supplicant.conf
file, bringing it to the form:
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 update_config=1
run the wpa_supplicant program in daemon mode:
$ sudo wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
Run the wpa_cli program:
$ sudo wpa_cli
and make sure it works by typing status
at its invitation. You should see the answer wpa_state=INACTIVE
.
Use the scan
and scan_results
to scan for available wireless networks:
> scan OK <3>CTRL-EVENT-SCAN-RESULTS > scan_results bssid / frequency / signal level / flags / ssid 00:00:00:00:00:00 2462 -49 [WPA2-PSK-CCMP][ESS] MYSSID 11:11:11:11:11:11 2437 -64 [WPA2-PSK-CCMP][ESS] ANOTHERSSID
add the selected bssid ( 00:00:00:00:00:00
for MYSSID
) and pin (which you know, for example: 12345678
):
> wps_reg 00:00:00:00:00:00 12345678
you should get the answer "ok". wait a few seconds while wpa_supplicant contacts the router, holds association and key negotiation . if you see the message CTRL-EVENT-CONNECTED
, then the pin is accepted and the association is successful. at the moment you can run (in a different terminal)
$ sudo dhclient wlan0
to verify that the dhcpd in the router is functioning normally, and you can get from it the ip-address for the wlan0 interface.
Go back to the running wpa_cli program and enter the save
command, which should return "ok" and save the new settings in the /etc/wpa_supplicant.conf
file.
psk
. this will be the generated key.then it will be possible to connect to the same router in the “usual” way: from the command line, from gui - “wrappers” around the network manager , etc.
Source: https://ru.stackoverflow.com/questions/459124/
All Articles