惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

SecWiki News
SecWiki News
I
InfoQ
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
博客园_首页
罗磊的独立博客
V
V2EX
李成银的技术随笔
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
True Tiger Recordings
Vercel News
Vercel News
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
F
Fox-IT International blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
M
Microsoft Research Blog - Microsoft Research
Know Your Adversary
Know Your Adversary
爱范儿
爱范儿
The Register - Security
The Register - Security
G
Google Developers Blog
The Hacker News
The Hacker News
Malwarebytes
Malwarebytes
S
Securelist
博客园 - 三生石上(FineUI控件)
Jina AI
Jina AI
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
S
SegmentFault 最新的问题
博客园 - 叶小钗
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
博客园 - 聂微东
T
Threatpost
博客园 - 【当耐特】
D
Docker
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
V
Visual Studio Blog
C
Cisco Blogs
IT之家
IT之家
S
Security Archives - TechRepublic
Latest news
Latest news
阮一峰的网络日志
阮一峰的网络日志

Librehat的部落格

Install Citrix Receiver for Linux in Toolbox – Librehat的部落格 My Attempts to Integrate Home Assistant with ADT UK – Librehat的部落格 Citrix Receiver UK Keyboard Layout Issue on Linux and Chrome OS – Librehat的部落格 部落格迁移到甲骨文云 – Librehat的部落格 Home Assistant Core Setup on Banana Pi M5 – Librehat的部落格 Chrome OS Flex on Samsung Galaxy Book Pro 360 Dual Boot – Librehat的部落格 Flatpak Wine 微信安装手记 – Librehat的部落格 FydeOS上手体验 – Librehat的部落格 Banana Pi M5 Pro Quick Review – Librehat的部落格
Soft AP on Linux with WPS – Librehat的部落格
2025-02-17 · via Librehat的部落格

I’ve recently upgraded my home WiFi setup with Ubiquiti (UniFi) access points (I bought a U7 Pro AP). All is good, except that UniFi doesn’t support WPS. On the other hand, my old Canon TS3150 printer can only be setup using WPS. Now, it wouldn’t have been an issue, had I not changed the SSID. The easiest workaround seems to be setting up a WiFi that has the same SSID and password, and supports WPS (so the printer can connect to it).

Some people on the Internet have suggested buying a cheap router/AP that supports WPS, which seems like a waste to me. Not only it costs minimally £30 or so, but also it’ll literally become an e-waste one minute later. Bad for the environment!

With the help of Gemini 2.0, and this post on StackExchange, I’ve managed to open a Hotspot by using SoftAP via hostapd that supports WPS (WiFi Protected Setup), and my printer is now happily connected to the WiFi network created by my UniFi AP.

I’m using Fedora Kinoite on my desktop, and hostapd is not Flatpak’d, therefore rpm-ostree is needed to get hostapd installed:

sudo rpm-ostree install hostapd

Then create this hostapd.conf file:

interface=wlo1  # check the actual device name, ip link
ieee80211d=1  # make sure the frequency conforms to the regulation
country_code=GB  # United Kingdom
eap_server=1
ap_setup_locked=1
ssid=<ACTUAL SSID>
channel=1
hw_mode=g
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=<ACTUAL PASSWORD>
wps_state=2
ap_max_inactivity=300
auth_algs=3
ctrl_interface=/var/run/hostapd
config_methods=label virtual_display virtual_push_button keypad

Now you need to first switch off the AP/WiFi so there is no conflict. Then stop NetworkManager and start hostapd,

sudo systemctl stop NetworkManager
sudo hostapd hostapd.conf

In a different Terminal window/tab,

sudo hostapd_cli wps_pbc

Immediately, press the WPS button on the printer (or other devices that need to be setup in this way). You can query whether WPS has been successful by running

sudo hostapd_cli wps_get_status

A successful setup should have a message like:

Selected interface 'wlo1'
PBC Status: Disabled
Last WPS result: Success
Peer Address: 34:XX:XX:XX:XX:00

Once it’s done, you can turn off the SoftAP (pressing Ctrl+C in the terminal window where hostapd is running), switch back the normal AP/WiFi, and start NetworkManager again – sudo systemctl start NetworkManager

A screenshot showing now my printer is now happily connected to the Ubiquiti U7 AP