You are not logged in.
Hello again, mtbvfr. The nmcli command (see reply #25 just above) made the "handle_probe_req: send failed" messages disappear on my ThinkPad X230 with Devuan Daedalus
Now the hotspot created with skinny-create-ap is completely stable.
I updated the script in reply #18 to include the nmcli command. I will go ahead and mark the thread as "Solved" (almost 7 years later--haha).
P.S. Please let me know if the nmcli command fixes things on your Lenovo L540. As for your other laptops, I'll leave those for you and other users to troubleshoot. I suggest scrutinizing the wifi hardware (not all hardware supports AP mode), excluding interference from network managers, and excluding interference from other software (e.g., rfkill).
Last edited by GNUser (2024-02-19 18:44:50)
Offline
Hi Bruno,
NetworkManager is installed and running when I experience the handle_probe_req: send failed issue.
If I run nmcli dev set wlan0 managed no, how do I undo the effects of this when I've finished using the Access Point or does the command sudo pkill hostapd; sudo pkill -f 'dnsmasq.*/tmp/dnsmasq.conf' take care of this?
Is wicd a viable alternative to NetworkManager?
I will try testing tomorrow.
Thanks, MTB.
Offline
If I run nmcli dev set wlan0 managed no, how do I undo the effects of this when I've finished using the Access Point
With nmcli dev set wlan0 managed yes
or does the command sudo pkill hostapd; sudo pkill -f 'dnsmasq.*/tmp/dnsmasq.conf' take care of this?
No.
Regarding wicd, its last stable release was in 2016 and last merge request from 2019. You could try it but the software is unmaintained.
Offline
Hi Bruno et al,
The nmcli command fixes things on the Lenovo L540.
After I enter my sudo password for running v2.3 of skinny-create-ap, there is no more output in the Terminal app. It simply returns to the Command Prompt.
Thanks! again, MTB.
Offline
Just a quick follow-up regarding haveged.
TL;DR version:
With modern linux kernels (5.6 or later) there is no need to install haveged on a GNU/Linux box being used as a wireless router.
Detailed version:
Entropy is needed for fast communication between wireless router and wireless clients (due to wpa2 cryptography operations). It used to be recommended to run cat /proc/sys/kernel/random/entropy_avail on the router and, if result was less than 1000, to install haveged and run it as a daemon to augment router's entropy pool.
Turns out that linux 5.6 incorporated a haveged-inspired mechanism that generates entropy extremely quickly (~200 MiB/s), making the haveged daemon obsolete for this use case (fast entropy generation). Also, result of cat /proc/sys/kernel/random/entropy_avail is now meaningless (the command always returns "256").
Ref: https://github.com/jirka-h/haveged/issues/57
P.S. Would the forum moderator kindly delete haveged from Reply #18 (two places) and Reply #21 (one place)? I tried to delete it myself, but was denied ("You do not have permission to access this page").
Last edited by GNUser (2024-03-12 19:31:23)
Offline
Hi Folks,
Looks like the script has been broken by dnsmasq in the setup_dhcp() procedure.
I get the following output:
dnsmasq: failed to create listening socket for 192.168.50.1: Address already in useThe best I can do to help pinpoint the problem is the following.
sudo ss -tulpn | grep "192.168.50.1" provides the following output:
udp UNCONN 0 0 192.168.50.1:137 0.0.0.0:* users:(("nmbd",pid=2996,fd=21))
udp UNCONN 0 0 192.168.50.1:138 0.0.0.0:* users:(("nmbd",pid=2996,fd=23))pid=2996 refers to "nmbd -D"
TIA!!
Offline
Hi mtbvfr. Since your machine is already using 192.168.50.X, just change the ip_stem=192.168.50 line in the script to something else. For example, you could change that line to ip_stem=192.168.60 and then the script should work for you.
Last edited by GNUser (2026-08-20 03:21:36)
Offline
@GNUser
Hi Bruno,
I tried 192.168.60, 192.168.70, 192.168.80 &, 192.168.90 and I was getting the same response.
When I got to 192.168.100, I got the following response:
RTNETLINK answers: File exists
dnsmasq: failed to create listening socket for 192.168.90.1: Address already in useWhen I tried 192.168.110, 192.168.120 & 192.168.130, I got the following response:
dnsmasq: failed to create listening socket for 192.168.90.1: Address already in useWhat else can I look at or try?
Thanks!! again, mtbvfr.
Offline
Hi mtbvfr. I don't understand what's going on there--if you are trying stems/subnets other than 192.168.90, then dnsmasq shouldn't care that 192.168.90.1 is in use.
Maybe you're not changing the stem/subnet in the right place? Try this:
First run sudo pkill -f dnsmasq just to make sure there isn't an instance of dnsmasq already running and interfering.
Then try this script. I added a function to make sure the selected ip_stem isn't already being used. I haven't tested it but it should work.
#!/bin/sh
# skinny-create-ap v2.4 (August 27, 2026)
# Bruno "GNUser" Dantas (GPLv3)
# Purpose: Turn a GNU/Linux system into a wireless router
# Dependencies: iproute2 iptables dnsmasq hostapd
# Not a dependency but highly recommended: haveged
# Syntax: $ sudo skinny-create-ap <lan_if> <wan_if> <ssid> <passphrase>
# Example usage: $ sudo skinny-create-ap wlan0 eth0 DevuanHotspot TopSecret123
# To turn off the hotspot: $ sudo pkill hostapd; sudo pkill -f 'dnsmasq.*/tmp/dnsmasq.conf'
# user variables:
lan_if="$1"
wan_if="$2"
ssid="$3"
password="$4"
channel=6
#dns_server=1.1.1.1
main()
{
prevent_nm_interference
select_subnet
setup_kernel
setup_nat
setup_dhcp
setup_ap
}
prevent_nm_interference()
{
nmcli dev set "$lan_if" managed no >/dev/null 2>&1
}
select_subnet()
{
# let's make sure the subnet/"ip_stem" we use for wlan isn't already being used by the host:
ip_stem_part1=192.168
ip_stem_part2=60
while sudo netstat -tulpn | grep -q "$ip_stem_part1.$ip_stem_part2"; do
ip_stem_part2=$(( ip_stem_part2 + 10 ))
done
ip_stem=$ip_stem_part1.$ip_stem_part2
echo "$(basename $0): will use ip_stem $ip_stem"
}
setup_kernel()
{
echo 1 >/proc/sys/net/ipv4/conf/"$wan_if"/forwarding
echo 1 >/proc/sys/net/ipv4/ip_forward
}
setup_nat()
{
iptables -t nat -A POSTROUTING -o "$wan_if" -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i "$lan_if" -o "$wan_if" -j ACCEPT
}
setup_dhcp()
{
# first, bring up $lan_if and give it a suitable ip address:
if ip link set "$lan_if" up; then
ip addr add $ip_stem.1/24 dev "$lan_if"
else
echo "$lan_if does not exist or cannot be brought up. Make sure necessary driver +/- firmware is installed." >&2
exit 1
fi
# create dnsmasq config file:
echo "
dhcp-leasefile=/tmp/dnsmasq.leases
dhcp-range=$ip_stem.100,$ip_stem.200,255.255.255.0,24h
#dhcp-option-force=option:dns-server,$dns_server
" >/tmp/dnsmasq.conf
# start dnsmasq (with care not to clash with any dnsmasq instances that might already be running):
dnsmasq --interface="$lan_if" --bind-interfaces --except-interface=lo -C /tmp/dnsmasq.conf
}
setup_ap()
{
# create hostapd config file:
echo "
ssid=$ssid
interface=$lan_if
driver=nl80211
channel=$channel
ignore_broadcast_ssid=0
hw_mode=g
auth_algs=1
wpa=2
wpa_passphrase=$password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
# N
ieee80211n=1
wmm_enabled=1
" >/tmp/hostapd.conf
# start hostapd:
hostapd /tmp/hostapd.conf &
}
mainOffline
Hi mtbvfr. I tried the above script and am able to reproduce your problem. Something must have changed in dnsmasq--either its internal logic or its command line syntax. I'm going to have to investigate this and get back to you.
Offline
Hi mtbvfr. Rather than trying to debug dnsmasq, let's just use busybox's minimalistic dhcp server instead.
I tested the script below and it is working on my Devuan Excalibur laptop.
#!/bin/sh
# skinny-create-ap v2.5 (August 27, 2026)
# Bruno "GNUser" Dantas (GPLv3)
# Purpose: Turn a GNU/Linux system into a wireless router
# Dependencies: $ sudo apt install iproute2 iptables busybox hostapd
# Syntax: $ sudo skinny-create-ap <lan_if> <wan_if> <ssid> <passphrase>
# Example usage: $ sudo skinny-create-ap wlan0 eth0 DevuanHotspot TopSecret123
# To turn off the hotspot: $ sudo pkill hostapd; sudo pkill -f udhcpd
# user variables:
lan_if="$1"
wan_if="$2"
ssid="$3"
password="$4"
channel=6
dns_server=9.9.9.9
main()
{
prevent_nm_interference
select_subnet
setup_kernel
setup_nat
setup_dhcp
setup_ap
}
prevent_nm_interference()
{
nmcli dev set "$lan_if" managed no >/dev/null 2>&1
}
select_subnet()
{
# let's make sure the subnet/"ip_stem" we use for wlan isn't already being used by the host:
ip_stem_part1=192.168
ip_stem_part2=60
while netstat -tulpn | grep -q "$ip_stem_part1.$ip_stem_part2"; do
ip_stem_part2=$(( ip_stem_part2 + 10 ))
done
ip_stem=$ip_stem_part1.$ip_stem_part2
echo "$(basename $0): will use ip_stem $ip_stem"
}
setup_kernel()
{
echo 1 >/proc/sys/net/ipv4/conf/"$wan_if"/forwarding
echo 1 >/proc/sys/net/ipv4/ip_forward
}
setup_nat()
{
iptables -t nat -A POSTROUTING -o "$wan_if" -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i "$lan_if" -o "$wan_if" -j ACCEPT
}
setup_dhcp()
{
# first, bring up $lan_if and give it a suitable ip address:
if ip link set "$lan_if" up; then
ip addr add $ip_stem.1/24 dev "$lan_if"
else
echo "$lan_if does not exist or cannot be brought up. Make sure necessary driver +/- firmware is installed." >&2
exit 1
fi
# create config file:
echo "
start $ip_stem.100
end $ip_stem.200
interface $lan_if
opt dns $dns_server
opt subnet 255.255.255.0
opt router $ip_stem.1
" >/etc/udhcpd.conf
# start dhcp server:
busybox udhcpd
}
setup_ap()
{
# create hostapd config file:
echo "
ssid=$ssid
interface=$lan_if
driver=nl80211
channel=$channel
ignore_broadcast_ssid=0
hw_mode=g
auth_algs=1
wpa=2
wpa_passphrase=$password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
# N
ieee80211n=1
wmm_enabled=1
" >/tmp/hostapd.conf
# start hostapd:
hostapd /tmp/hostapd.conf &
}
mainHow-to:
1. Put the script somewhere in your PATH and make it executable. I'd call it skinny-create-ap or similar.
2. Install the script's dependencies:
$ sudo apt install iproute2 iptables busybox hostapd3. Run the script. Syntax is sudo skinny-create-ap <lan_if> <wan_if> <ssid> <passphrase> so, for example:
$ sudo skinny-create-ap wlan0 eth0 DevuanHotspot TopSecret123At that point, clients should be able to connect to the hotspot you created ![]()
Once you're done and want to take down the hotspot, run these commands on the host machine:
$ sudo pkill hostapd; sudo pkill -f udhcpdLet me know how it goes.
P.S. If after running the script you find that your host machine cannot resolve domain names, check the file /etc/resolv.conf and make sure it contains the ip address of your preferred dns server. Here is what my minimal, working /etc/resolv.conf looks like:
nameserver 9.9.9.9Last edited by GNUser (Today 03:00:10)
Offline