Skip to content

Instantly share code, notes, and snippets.

@0xBADCA7
Forked from alghanmi/wps_openwrt.sh
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xBADCA7/8074a748b3a9925de5fd to your computer and use it in GitHub Desktop.
Save 0xBADCA7/8074a748b3a9925de5fd to your computer and use it in GitHub Desktop.
##
## WPS on OpenWRT
## This script enables Wi-Fi Protected Setup on OpenWRT.
##
## Resources
## http://wiki.openwrt.org/doc/uci/wireless#wps.options
##
#Install the full wpad package
opkg update
opkg remove wpad-mini
opkg install wpad hostapd-utils
#Enable WPS on the Wifi network interface.
# Notes:
# * The network interface should be configured to support WPA2-PSK
# * This script assumes the last interface is the one used for WPS, hence using @wifi-iface[-1]
# * You can view all the wireless interfaces by issuing the following command and getting the index of the correct one
# uci show wireless
uci set wireless.@wifi-iface[-1].wps_pushbutton=1
#The following are all optional
uci set wireless.@wifi-iface[-1].wps_device_name="OpenWRT AP"
uci set wireless.@wifi-iface[-1].wps_manufacturer="openwrt.org"
##
## Save Changes & Reboot
##
uci commit
reboot
##
## Run WPS
##
hostapd_cli -p /var/run/hostapd-phy0 wps_pbc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment