Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

4 votes
1 answers
9354 views
Cannot get IP address from WiFi access point (hostapd) with DHCP (dnsmasq) bridged with two ethernet adapters (bridge-utils)
**My Android phone is trying to get DHCP address through WiFi connection, but fails.** Obviously, I might have messed up something in my settings because I couldn't find a complete guide which would let me do everything in one go, thus I had to combine multiple guides, but I still feel a bit new to...
**My Android phone is trying to get DHCP address through WiFi connection, but fails.** Obviously, I might have messed up something in my settings because I couldn't find a complete guide which would let me do everything in one go, thus I had to combine multiple guides, but I still feel a bit new to network configuration on Linux. What I want to achieve: **- create a WiFi access point and DHCP server where all devices receive IP adresses in the same network. Internet access not required, so no routing needed - just a local network where my server acts as a switch (bridge) providing IP adresses for all devices connected to it through WiFi or Ethernet.** Here's what I have: - a Linux machine (actually, Raspberry Pi with Raspbian) with Ralink RT5370 WiFi dongle (which claims to support Access Point) and two Ethernet ports - one is RPi's built-in port and the other is Trendnet TU2-ET100 (chip AX88772) - I have installed bridge-utils and dnsmasq and everything works fine with Ethernet connections - all devices connected to RPi Ethernet ports receive their IP addresses from RPi through dnsmasq - I have installed hostapd and configured it to be open AP, for starters. I tried to use WPA, but on my Android phone that also failed with "Authentication failure", so I disabled auth. And now my Android device gets stuck while acquiring IP address and then fails. Here are my config files: /etc/default/hostapd: interface=wlan0 hw_mode=g bridge=br0 channel=1 ssid=FakeTestServer_AP auth_algs=1 wmm_enabled=0 /etc/default/hostapd: DAEMON_CONF="/etc/hostapd/hostapd.conf" /etc/network/interfaces: auto lo iface lo inet loopback auto br0 iface eth0 inet manual iface eth1 inet manual iface br0 inet static bridge_ports eth0 eth1 wlan0 bridge_stp off bridge_fd 0 bridge_waitport 0 bridge_maxwait 0 address 10.0.0.1 netmask 255.255.255.0 /etc/dnsmasq.conf: interface=br0 dhcp-range=10.0.0.2,10.0.0.254,255.255.255.0,12h Here is what ifconfig shows: br0 Link encap:Ethernet HWaddr 00:14:d1:da:c7:dc inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::214:d1ff:feda:c7dc/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1343 errors:0 dropped:0 overruns:0 frame:0 TX packets:212 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:83674 (81.7 KiB) TX bytes:16750 (16.3 KiB) eth0 Link encap:Ethernet HWaddr b8:27:eb:74:1f:8c UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:5824 errors:0 dropped:0 overruns:0 frame:0 TX packets:2800 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1448587 (1.3 MiB) TX bytes:1057796 (1.0 MiB) eth1 Link encap:Ethernet HWaddr 00:14:d1:da:c7:dc UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5353 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1145578 (1.0 MiB) TX bytes:414153 (404.4 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:52 errors:0 dropped:0 overruns:0 frame:0 TX packets:52 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3744 (3.6 KiB) TX bytes:3744 (3.6 KiB) mon.wlan0 Link encap:UNSPEC HWaddr 00-C1-40-95-0D-43-00-00-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:7417 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2107086 (2.0 MiB) TX bytes:0 (0.0 B) wlan0 Link encap:Ethernet HWaddr 00:c1:40:95:0d:43 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:182 errors:0 dropped:0 overruns:0 frame:0 TX packets:122 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:31498 (30.7 KiB) TX bytes:21682 (21.1 KiB) To make it clear, I repeat - the bridge and both Ethernet connections work fine, and there are no any errors when I run: sudo service hostapd restart sudo service dnsmasq restart sudo service networking restart At the very beginning bridge-utils failed with a message can't add wlan0 to bridge br0: Operation not supported but after I added bridge=br0 to hostapd settings, bridge-utils did not complain anymore, so I guess, wlan0 got added to the bridge but I'm not sure what's going on there. **How do I get my WiFi working in Access Point mode and be part of the same bridge as both eth0 and eth1 are?**
JustAMartin (203 rep)
Apr 16, 2015, 08:49 AM • Last activity: Aug 3, 2025, 04:04 PM
0 votes
0 answers
69 views
Trying to programatically get the RADIUS certificate
When connecting to a WPA Enterprise access point, operating systems like iOS and macOS display the server certificate to the user if it has not been seen before. However, on Linux, using wpa_supplicant, this prompt does not appear. I have configured wpa_supplicant using a .conf file, but I do not ge...
When connecting to a WPA Enterprise access point, operating systems like iOS and macOS display the server certificate to the user if it has not been seen before. However, on Linux, using wpa_supplicant, this prompt does not appear. I have configured wpa_supplicant using a .conf file, but I do not get the server certificate. Is there any way to obtain the certificate when connecting to the AP on linux? This is one of the configurations I have used: network={ ssid="ssid" key_mgmt=WPA-EAP eap=PEAP identity="your.username@example.com" password="yourpassword" phase1="peapver=0" phase2="auth=MSCHAPV2" ca_cert="/etc/ssl/certs/your_CA_cert.pem" } And the usage of wpa_supplicant: sudo wpa_supplicant -i wlan0 -c /etc/tmp/network.conf -D nl80211 -dd
juvor (149 rep)
Aug 3, 2025, 06:22 AM
0 votes
0 answers
22 views
How to configure FreeBSD as WPA Enterpise access point?
I have a FreeBSD machine with an Atheros WiFi card and I want to use it as WPA Enterprise access point. I set up a RADIUS server on the FreeBSD machine and configure interface wlan0 and hostapd.conf, but I have no luck. My phone informs me that the MyWiFi network is password protected and refuses to...
I have a FreeBSD machine with an Atheros WiFi card and I want to use it as WPA Enterprise access point. I set up a RADIUS server on the FreeBSD machine and configure interface wlan0 and hostapd.conf, but I have no luck. My phone informs me that the MyWiFi network is password protected and refuses to accept my certificate. But I successfully use an access point (a white box with antennas and blue LEDs) as a WPA Enterprise access point from my phone. So I suppose I set up the RADIUS server correctly.
wlan0: flags=8843 metric 0 mtu 1500
        options=0
        ether 00:1a:cc:44:33:aa
        inet 192.168.12.1 netmask 0xffffff00 broadcast 192.168.12.255
        groups: wlan
        ssid "MyFiWi" channel 1 (2412 MHz 11g) bssid 00:1a:cc:44:33:aa
        regdomain NONE country DE ecm authmode 802.1x privacy MIXED
        deftxkey UNDEF txpower 30 scanvalid 60 protmode CTS wme burst
        dtimperiod 1 -dfs
        parent interface: ath0
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g 
        status: running
        nd6 options=29
My /etc/hostapd.conf:
# GLOBAL PARAMETERS
interface=wlan0
debug=0
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=0
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel

ssid=MyFiWi

# WPA/IEEE 802.11i PARAMETERS
wpa=WPA-RADIUS
wpa_key_mgmt=WPA-EAP
ieee8021x=1

# RADIUS CLIENT PARAMETERS
own_ip_addr=192.168.12.1
nas_identifier=FreeBSD
auth_server_addr=127.0.0.1
auth_server_port=1812
auth_server_shared_secret=>
My /etc/wpa_supplicant.conf:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
#
# home network; allow all valid ciphers
 network={
        ssid="MyFiWi"
        key_mgmt=WPA-EAP
        eap=TLS
        ca_cert="/home/MyFiWi.pem"
 }
What I do wrong?
Sergey Zaykov (101 rep)
Jul 13, 2025, 10:36 PM
1 votes
1 answers
6292 views
Change wlan channel
I have 2 Wlan Routers with the same SSID. One on the channel 6 and one on the channel 11. By default I am connected to the one on the channel 6. How can I connect to the one on channel 11? (Of course I could just connect via LAN or power off the router with channel 6, but I'm searching for a solutio...
I have 2 Wlan Routers with the same SSID. One on the channel 6 and one on the channel 11. By default I am connected to the one on the channel 6. How can I connect to the one on channel 11? (Of course I could just connect via LAN or power off the router with channel 6, but I'm searching for a solution where i connect to a specific endpoint) Thanks in advance!
localhorst (11 rep)
Feb 27, 2016, 12:28 PM • Last activity: Jul 7, 2025, 07:04 AM
2 votes
1 answers
2922 views
hostapd fails with nl80211 driver initialization on i.MX6 (RTL8812au)
I’m having some trouble with `hostapd` and `nl80211`. When I try to launch `hostapd`, this is what I get: ``` # /etc/init.d/hostapd start Starting HOSTAP Daemon: Configuration file: /etc/hostapd.conf nl80211: Driver does not support authentication/association or connect commands nl80211 driver initi...
I’m having some trouble with hostapd and nl80211. When I try to launch hostapd, this is what I get:
# /etc/init.d/hostapd start
Starting HOSTAP Daemon: Configuration file: /etc/hostapd.conf
nl80211: Driver does not support authentication/association or connect commands
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started
Is this due to the Wi-Fi driver (RTL8812au) or the nl80211 driver? I’m working on an ARM-based device with an i.MX6 processor. The driver is cross-compiled. Something strange: iwconfig works:
# iwconfig 
wlan0     unassociated  Nickname:""
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated   
          Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
But when I run iw list, nothing happens. Can someone help me with this problem? Additional info: - Yocto and custom BSP on the i.MX6 board - Kernel version: 3.14.28 - Linux distribution: Poky 1.8.1 - Wi-Fi USB key: Edimax EW-7811USC
PierreOlivier (121 rep)
May 20, 2016, 01:24 PM • Last activity: May 30, 2025, 02:03 PM
3 votes
1 answers
5580 views
Hostapd on a Raspberry Pi 3 with external WiFi card
I am trying to set an AP on a Raspberry Pi 3 using an external USB WiFi card and hostapd and dsnmasq. I have managed to achieve it using the internal WiFi card but when I try to switch to my external one I got the following error: $ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf Configuration file...
I am trying to set an AP on a Raspberry Pi 3 using an external USB WiFi card and hostapd and dsnmasq. I have managed to achieve it using the internal WiFi card but when I try to switch to my external one I got the following error: $ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf Configuration file: /etc/hostapd/hostapd.conf nl80211: Could not configure driver mode nl80211: deinit ifname=wlan1 disabled_11b_rates=0 nl80211 driver initialization failed. wlan1: interface state UNINITIALIZED->DISABLED wlan1: AP-DISABLED hostapd_free_hapd_data: Interface wlan1 wasn't started I believe it is because by default the hostapd is using nl80211 driver. This is the output of lsusb - Bus 001 Device 004: ID 148f:3072 Ralink Technology, Corp. RT3072 Wireless Adapter. And this is the output of lshw *-network:1 description: Wireless interface physical id: 3 bus info: usb@1:1.4 logical name: wlan1 serial: 98:3f:9f:24:a2:00 capabilities: ethernet physical wireless configuration: broadcast=yes driver=rt2800usb driverversion=4.14.71-v7+ firmware=0.36 ip=10.100.100.254 link=no m ulticast=yes wireless=IEEE 802.11 So apparently this card is using the rt2080usb driver but when I try to put it inside the hostapd.conf and start manually the hostapd I got the following error: $ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf Configuration file: /etc/hostapd/hostapd.conf Line 3: invalid/unknown driver 'rt2080usb' 1 errors found in configuration file '/etc/hostapd/hostapd.conf' Failed to set up interface with /etc/hostapd/hostapd.conf Failed to initialize interface And this is my hostapd.conf file: interface=wlan1 ssid=WiPi driver=rt2080usb hw_mode=g ieee80211n=1 wmm_enabled=1 channel=4 macaddr_acl=0 auth_algs=3 ignore_broadcast_ssid=0 wpa=3 wpa_passphrase=wifipasswordhere wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP ht_capab=[HT20][SHORT-GI-20] [EDIT] This is the output of the iwconfig command: wlan1 IEEE 802.11 ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm Retry short long limit:2 RTS thr:off Fragment thr:off Power Management:off wlan0 IEEE 802.11 ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=31 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:on And this is the output of the iw list command: valid interface combinations: * #{ AP, mesh point } ENABLED wlan1: AP-ENABLED And this is the output of iwconfig: wlan1 IEEE 802.11 Mode:Master Tx-Power=20 dBm Retry short long limit:2 RTS thr:off Fragment thr:off Power Management:off And this is the hostapd log when I try to connect to my essid WiPi and run speedtest: $ Configuration file: /etc/hostapd/hostapd.conf Using interface wlan1 with hwaddr 98:3f:9f:24:a2:00 and ssid "WiPi" wlan1: interface state UNINITIALIZED->ENABLED wlan1: AP-ENABLED wlan1: STA 94:65:2d:d4:e0:5b IEEE 802.11: authenticated wlan1: STA 94:65:2d:d4:e0:5b IEEE 802.11: associated (aid 1) wlan1: AP-STA-CONNECTED 94:65:2d:d4:e0:5b wlan1: STA 94:65:2d:d4:e0:5b RADIUS: starting accounting session 5BEC735C-00000000 wlan1: STA 94:65:2d:d4:e0:5b WPA: pairwise key handshake completed (RSN) wlan1: AP-STA-DISCONNECTED 94:65:2d:d4:e0:5b Failed to set beacon parameters wlan1: INTERFACE-DISABLED wlan1: INTERFACE-ENABLED Failed to set beacon parameters wlan1: INTERFACE-DISABLED wlan1: INTERFACE-ENABLED Failed to set beacon parameters handle_probe_req: send failed
Georgi Stoyanov (860 rep)
Nov 7, 2018, 07:09 PM • Last activity: May 12, 2025, 03:08 AM
1 votes
1 answers
2792 views
Modifying existing SSID using nmcli
Hi so i know i can set up a wifi network using nmcli in this way. nmcli con add type wifi ifname uap0 mode ap con-name ssid nmcli con modify 802-11-wireless-security.psk But if i now want to modify the password and ssid of the created wifi network how do i do that? i do not find the correct command...
Hi so i know i can set up a wifi network using nmcli in this way. nmcli con add type wifi ifname uap0 mode ap con-name ssid nmcli con modify 802-11-wireless-security.psk But if i now want to modify the password and ssid of the created wifi network how do i do that? i do not find the correct command in the documentation.. Can i just do this sudo nmcli con down sudo nmcli con modify 802-11-wireless-security.psk "$WIFI_PASSWORD" sudo nmcli con modify ssid sudo nmcli con up
busssard (11 rep)
Feb 21, 2023, 04:00 PM • Last activity: May 8, 2025, 03:08 AM
0 votes
1 answers
2087 views
How to route traffic from a wifi AP via a docker container on a Raspberry Pi
I have a container **A** running a VPN client, then I traffic other containers' (**B** and **C**) traffic via container **A**. Is there a way to create a container **D**, which internally is running something like **HostAP** or **RaspAP** for the creation a wifi network in e.g. interface `wlan0`, an...
I have a container **A** running a VPN client, then I traffic other containers' (**B** and **C**) traffic via container **A**. Is there a way to create a container **D**, which internally is running something like **HostAP** or **RaspAP** for the creation a wifi network in e.g. interface wlan0, and then all the traffic is routed via container **A**? I found some docker images in docker hub with the above clients for my architechture, and while the few descriptions they have seem to have similar purpose to what I am trying to achieve, none of the worked properly. If previous option is not possible, how could this be achieved by directly changing the files in the host OS (Raspbian)? The host is connected via eth0 to the router. First I tried to run the containers directly from the interface eth0 and then tried to attach it to container **A**. None of them worked. **Docker compose for hostap:**
sudo docker run --restart unless-stopped -dit --name hostap \
  -e INTERFACE=docker0 \
  -e CHANNEL=6 \
  -e SSID=runssid \
  -e AP_ADDR=192.168.254.1 \
  -e SUBNET=192.168.254.0 \
  -e WPA_PASSPHRASE=passw0rd \
  -e OUTGOINGS=eth0 \
  -e HW_MODE=g \
--net host --privileged sdelrio/rpi-hostap:latest
Log file:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
2448abea512bf5207f7692d242804b0a0198b6e076b011c311b06092af1b5d80
Then it crashes the entire raspberry docker installation (no access to any other container). I have to kill the container and eliminate to re-gain access. ** Docker compose using raspap:**
sudo docker run --name raspap -it -d --privileged --network=host -v /sys/fs/cgroup:/sys/fs/cgroup:ro --cap-add SYS_ADMIN jrcichra/raspap-docker
This one stops the container after its creation. Log file:
systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
Detected virtualization docker.
Detected architecture arm.

Welcome to Debian GNU/Linux 10 (buster)!

Set hostname to .
Failed to create /init.scope control group: Read-only file system
Failed to allocate manager object: Read-only file system
[!!!!!!] Failed to allocate manager object.
Setup: - Docker running on Raspbian in a Raspberry Pi 4 Docker images checked: - https://github.com/sdelrio/rpi-hostap - https://github.com/RaspAP/raspap-docker Thanks in advance.
wdsgn (101 rep)
Aug 24, 2022, 08:41 PM • Last activity: Apr 30, 2025, 10:10 AM
0 votes
0 answers
17 views
"modem hangup," "connect script failed," and "timeout sending config-requests" or a process locking my modem what do I do?
I am working on a project to: 1. Use the SIM7600X 4G HAT to enable internet access on a Raspberry Pi 4B. 2. Configure the Raspberry Pi as a Wi-Fi hotspot to then share the 4G internet with other devices. The Internet connection has been working fine and I was looking into making the Pi an hotspot un...
I am working on a project to: 1. Use the SIM7600X 4G HAT to enable internet access on a Raspberry Pi 4B. 2. Configure the Raspberry Pi as a Wi-Fi hotspot to then share the 4G internet with other devices. The Internet connection has been working fine and I was looking into making the Pi an hotspot until recently, I started having issues like "modem hangup," "connect script failed," and "timeout sending config-requests" or a process locking my modem
Mofiyinfoluwa Joshua (1 rep)
Dec 20, 2024, 09:03 AM • Last activity: Dec 20, 2024, 09:06 AM
0 votes
0 answers
27 views
How to access IP and port configuration of the tablet running Linuxmint with "hostapd + DHCP"
_My task_: Configure and run Access Point (AP) on the tablet (x86) with Linux mint with access from devices connected to the created AP. ##### Background as additional information (but this is not the topic of question, *real question at the end of description*): - Some measurement devices must conn...
_My task_: Configure and run Access Point (AP) on the tablet (x86) with Linux mint with access from devices connected to the created AP. ##### Background as additional information (but this is not the topic of question, *real question at the end of description*): - Some measurement devices must connect to this tablet via AP and send data to it throw tcp socket. #### I have done the next parts: --- ## 1. Created the Virtual WiFi interface - the created intefce works as isolated (not bridged, like a router) All the scripts are provided for the physical WiFi interface wlp1s0 I created the virtual interface with the name wlp1s0_ap - Created a unit (service) file as /lib/systemd/system/wireless-device@.service
[Unit]
Description=Create virtual wireless interface
Requires=sys-subsystem-net-devices-wlp1s0.device
#After=network.target
After=sys-subsystem-net-devices-wlp1s0.device
[Service]
Type=oneshot
#ExecStart=/usr/sbin/iw dev wlp1s0 interface add %I type __ap  addr "00:0c:e3:6f:78:ee"
ExecStart=/usr/sbin/iw dev wlp1s0 interface add %I type managed addr "00:0c:e3:6f:78:ee"
#ExecStart=/usr/bin/iw dev wlan0 interface add wlp1s0_ap type __ap addr "00:0c:e3:6f:78:ee"
[Install]
WantedBy=multi-user.target
- Then run systemctl enable wireless-device@wlp1s0_ap.service - Reboot the PC --- ## 2. Added the new virtual interface into ignored ones for the **NetworkManager** **edit:**
sudo nano /etc/NetworkManager/NetworkManager.conf
by adding **wlp1s0_ap** created interface into _unmanaged-devices_ section (**NB!** append to existing ones)
[keyfile]
unmanaged-devices=interface-name:wlp1s0_ap
run
sudo nmcli general reload
--- ## 3. Configured hostapd I called the AP as EVT with password ******. More details are below. - install hostapd - sudo apt install hostapd - edit the file sudo nano /etc/default/hostapd - current version is below
DAEMON_CONF="/etc/hostapd/hostapd.conf"
- edit the configuration file (below is the current variant): - sudo nano /etc/hostapd/hostapd.conf
interface=wlp1s0_ap
driver=nl80211
country_code=EE

ssid=EVT
wpa_passphrase=****

hw_mode=g
channel=10

wpa=2
wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0
ieee80211n=1
- the daemon is started as - sudo systemctl start hostapd --- ## 4. Configured DHCP server Fro the DHCP server isc-dhcp-server is selected. ### _isc-dhcp-server_ configuration - install: sudo apt install isc-dhcp-server - edit the file - sudo nano /etc/dhcp/dhcpd.conf, (below is the current variant):
# dhcpd.conf

#INTERFACES="wlp1s0_ap"

option domain-name "etv.org";
option domain-name-servers 192.168.1.2, 192.168.1.3;

default-lease-time 86400;
max-lease-time 604800;

ddns-update-style none;

authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
        interface wlp1s0_ap;
        ## dhcp start  and end IP range ##
        range 192.168.1.100 192.168.1.200;
        option subnet-mask 255.255.255.0;     ## subnet
        option broadcast-address 192.168.1.255; ## broadcast
        option routers 192.168.1.254; ## router IP
}
The daemon is started as service isc-dhcp-server start --- ## 5. Assigned static IP address for the created virtual interface I modified the file to assign the IP 192.168.1.111 to the interface wlp1s0_ap:
sudo nano /etc/network/interfaces
the content of the /etc/network/interfaces file is
auto lo
iface lo inet loopback

auto wlp1s0_ap
iface wlp1s0_ap inet static
  address 192.168.1.111
  netmask 255.255.255.0
  gateway 192.168.1.0
  broadcast 192.168.1.255
  dns-nameservers 192.168.1.2,192.168.1.3
--- ### The parts described above are working and I can connect to the AP. ### ifconfig listing:
lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1386  bytes 149889 (149.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1386  bytes 149889 (149.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp1s0: flags=4163  mtu 1500
        inet 172.20.92.22  netmask 255.255.255.0  broadcast 172.20.92.255
        inet6 fe80::9ea9:58d3:aa31:b7e9  prefixlen 64  scopeid 0x20
        ether 00:0c:e3:6f:78:ed  txqueuelen 1000  (Ethernet)
        RX packets 1111808  bytes 125498550 (125.4 MB)
        RX errors 0  dropped 7507  overruns 0  frame 0
        TX packets 23673  bytes 3070974 (3.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp1s0_ap: flags=4163  mtu 1500
        inet 192.168.1.111  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::20c:e3ff:fe6f:78ee  prefixlen 64  scopeid 0x20
        ether 00:0c:e3:6f:78:ee  txqueuelen 1000  (Ethernet)
        RX packets 808  bytes 124999 (124.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 893  bytes 155057 (155.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
# Problem: **However I cannot communicate with this Tablet** For example, ping to the assigned IP ping 192.168.1.111 gives the next response:
PING 192.168.1.111 (192.168.1.111) 56(84) bytes of data.
From 192.168.1.101 icmp_seq=1 Destination Host Unreachable
From 192.168.1.101 icmp_seq=2 Destination Host Unreachable
From 192.168.1.101 icmp_seq=3 Destination Host Unreachable
From 192.168.1.101 icmp_seq=4 Destination Host Unreachable
^C
--- 192.168.1.111 ping statistics ---
5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 4065ms
**telnet** output:
~$ telnet 192.168.1.111
Trying 192.168.1.111...
telnet: Unable to connect to remote host: No route to host
The questions: 1. What I missed? 2. How to configure the access to the Tablet on which hostapd + DHCP are running?
Andrei Krivoshei (101 rep)
Oct 28, 2024, 02:57 PM
0 votes
0 answers
171 views
Access Point using NetworkManager only allows 6 devices to connect
I've a Raspberry Pi running Debian 12 (bookworm) and have set up an access point with the following command: ``` sudo nmcli con add type wifi ifname wlan0 mode ap con-name MY_AP ssid MySSID \ connection.autoconnect yes \ ipv4.method shared \ ipv4.addresses 192.168.5.1/24 \ 802-11-wireless.band bg \...
I've a Raspberry Pi running Debian 12 (bookworm) and have set up an access point with the following command:
sudo nmcli con add type wifi ifname wlan0 mode ap con-name MY_AP ssid MySSID \
   connection.autoconnect yes \
   ipv4.method shared \
   ipv4.addresses 192.168.5.1/24 \
   802-11-wireless.band bg \
   802-11-wireless.channel 7 \
   ipv6.method disabled \
   wifi-sec.key-mgmt wpa-psk \
   wifi-sec.psk 'PASSWORD
This works fine, but it looks like it's only allowing 6 devices to connect. If I try and connect a 7th, it says it won't connect and nothing appears in the NetworkManager logs to indicate that there was an attempted connection or why the connection wasn't permitted. I've tried connecting different devices in different orders, starting and restarting NetworkManager and playing with config files, but it always stops playing ball after 6 devices have connected. If I look in the NetworkManager logs, I see things like the following:
May 15 12:13:22 farmpi dnsmasq-dhcp: DHCPACK(wlan0) 192.168.5.104 98:f4:ab:e0:b2:26 strip2-4646
May 15 12:13:22 farmpi dnsmasq-dhcp: DHCPREQUEST(wlan0) 192.168.5.104 98:f4:ab:e0:b2:26
May 15 12:13:22 farmpi dnsmasq-dhcp: DHCPOFFER(wlan0) 192.168.5.104 98:f4:ab:e0:b2:26
May 15 12:13:22 farmpi dnsmasq-dhcp: DHCPDISCOVER(wlan0) 98:f4:ab:e0:b2:26
May 15 12:13:16 farmpi dnsmasq: cleared cache
May 15 12:13:16 farmpi dnsmasq: using nameserver 192.168.55.1#53
May 15 12:13:16 farmpi dnsmasq: reading /etc/resolv.conf
May 15 12:13:16 farmpi dnsmasq-dhcp: DHCP, IP range 192.168.5.10 -- 192.168.5.254, lease time 1h
May 15 12:13:16 farmpi dnsmasq: chown of PID file /run/nm-dnsmasq-wlan0.pid failed: Operation not permitted
This seems ok to me (chown error aside, but I assume that's not relevant?). The DHCP IP range should allow more then 244 devices to connect, and the connections are being handled correctly, it's just for some unfathomable reason, it stops doing that after the 6th device. I increased the log level to TRACE to see if I could get any more information, but nothing is printed about devices trying to connect. Any advice on how to try and debug this would be greatly appreciated.
linucks (101 rep)
May 15, 2024, 04:10 PM
46 votes
6 answers
102735 views
Create wireless access point and share internet connection with nmcli
How can I create a Wi-Fi hotspot with the command line tool `nmcli` and share/bridge the ethernet internet connection with the wireless access point? Furthermore, how can I start this automatically at boot? Is this possible with `nmcli`?
How can I create a Wi-Fi hotspot with the command line tool nmcli and share/bridge the ethernet internet connection with the wireless access point? Furthermore, how can I start this automatically at boot? Is this possible with nmcli?
BuZZ-dEE (2253 rep)
Oct 7, 2015, 03:18 PM • Last activity: Nov 8, 2023, 11:05 AM
0 votes
1 answers
280 views
Linux 5GHz access point REGULATORY DOMAIN problem (debian+ hostpad + dnsmasq)
I am getting problems setting a 5GHz access point with a lattepanda 3d. I run the following setup: - Debian - Hostapd - Dnsmasq - iw (for set/get reg dom) In the end I am able to successfully test a 2,4 GHz AP setup. No way to get 5GHz. While debugging HOSTAPD it seems it is looking for a regulatory...
I am getting problems setting a 5GHz access point with a lattepanda 3d. I run the following setup: - Debian - Hostapd - Dnsmasq - iw (for set/get reg dom) In the end I am able to successfully test a 2,4 GHz AP setup. No way to get 5GHz. While debugging HOSTAPD it seems it is looking for a regulatory domain 00 that got all the 5GHz frequencies no-ir (no-initiating-radiation-> not usable from hostpad). Usually you change the reg dom to what you need and hostpad will get the working frequencies (I have already been able to do such a thing with a raspi from gui). No way to accomplish: - setting kernel option does not work (modprobe cfg80211 ieee80211_regdom=XX or by conf file) - iw reg set XX does not work (for phy0 self managed). - crda has been deprecated and removed from Debian, I would not install it. I understand there was a LAR option not anymore accessible (would need an older kernel/driver?), that would have made the trick if set to =disabled. It has been removed from configurable paramenters for the **iwlwifi** driver. I cannot understand how to solve the problem and why it should be such complicated. I do not know if that is clear, please help me... regards ed
enon (3 rep)
Sep 27, 2023, 07:17 PM • Last activity: Sep 27, 2023, 11:27 PM
8 votes
1 answers
8444 views
hostapd multiple SSIDs with one BSSID
I have a [`wl12xx`](https://en.wikipedia.org/wiki/Wl12xx) wifi adapter that unfortunately does not seem to support creating multiple access points. If I run `iw list` it outputs this line: interface combinations are not supported If I run `hostapd` with multiple SSIDs set up if sometimes runs, and s...
I have a [wl12xx](https://en.wikipedia.org/wiki/Wl12xx) wifi adapter that unfortunately does not seem to support creating multiple access points. If I run iw list it outputs this line: interface combinations are not supported If I run hostapd with multiple SSIDs set up if sometimes runs, and sometimes gives me too many files are open, or device or resource busy. In any case I have only ever seen it make one wifi network. As I understand it, a BSSID is basically the wifi card's MAC address, and the standard way to create multiple APs with hostapd is to create multiple network interfaces, each with their own BSSID (MAC address) and SSID. It's as if you had multiple physical network cards. This mode appears to be not supported by my hardware but I actually only want one network (BSSID) with multiple SSIDs. Is it possible to do this? Does hostapd support it (there's very little documentation for it)? Does the wifi standard allow it? To put it in other words, instead of this: # First network on wlan0.ap1 interface=wlan0.ap1 ssid=my_first_ssid # Second network. bss=X starts a new section, using the network interface X. # I think that's how it works anyway. Documentation is very unclear and the config # file format is idiotic. bss=wlan0.ap2 ssid=my_second_ssid # Third network. bss=wlan0.ap3 ssid=my_third_ssid I want something like this. A single network that broadcasts itself as three SSIDs. # Single network on wlan0.ap1 with three ssids. interface=wlan0.ap1 ssid=my_first_ssid, my_second_ssid, my_third_ssid Or maybe something like this would work? interface=wlan0.ap1 ssid=my_first_ssid bss=wlan0.ap1 # Same interface ssid=my_second_ssid bss=wlan0.ap1 ssid=my_third_ssid Or this? interface=wlan0.ap1 ssid=my_first_ssid bssid=02:01:03:04:05:06 bss=wlan0.ap2 ssid=my_second_ssid bssid=02:01:03:04:05:06 # Same BSSID bss=wlan0.ap3 ssid=my_third_ssid bssid=02:01:03:04:05:06 Am I going to have to read the source code?
Timmmm (675 rep)
Feb 19, 2016, 11:58 AM • Last activity: Sep 10, 2023, 06:03 PM
0 votes
1 answers
534 views
How do I make a Linux-based IPv6 access point?
To make a typical IPv4-based access point on Linux, one does these steps: 1. Use `hostapd` to make e.g. `wlan0` available for incoming connections; 2. Choose some local subnet. For example, `192.168.99.0/24`. 3. Add one of IP addresses in that network (e.g. `192.168.99.1/24`) to `wlan0`. 4. Enable f...
To make a typical IPv4-based access point on Linux, one does these steps: 1. Use hostapd to make e.g. wlan0 available for incoming connections; 2. Choose some local subnet. For example, 192.168.99.0/24. 3. Add one of IP addresses in that network (e.g. 192.168.99.1/24) to wlan0. 4. Enable forwarding both for this network (wlan0) and for upstream (e.g. eth0). 5. Insert MASQUERADE rule to firewall to enable NAT. 6. Start dnsmasq or other DHCP server to manage local IP addresses of clients. Are there similar steps for IPv6? Ideally clients of wlan0 should see the IPv6 world just as if they were connected to eth0 directly (i.e. not another NAT, which is unidiomatic in IPv6 world), something like a pseudo-bridge (true brctl bridging may be problematic). It would also be useful if eth0 could be reconnected to another network without requiring restarting the infrastructure for serving wlan0, just like in the IPv4 case. Will the steps be different depending on whether DHCPv6 or router advertisements are used on eth0?
Vi. (5985 rep)
Jul 18, 2023, 10:02 AM • Last activity: Aug 7, 2023, 04:48 AM
2 votes
0 answers
102 views
Extend existing wifi using unix pc access point (with same SSID)
## Context I have a PC running Ubuntu Server and connected to my internet provider’s router using an ethernet connection (and that has a static IP set up in the router's portal). The internet provider’s router provides a native wifi network that is too weak in several rooms to be usable there. The P...
## Context I have a PC running Ubuntu Server and connected to my internet provider’s router using an ethernet connection (and that has a static IP set up in the router's portal). The internet provider’s router provides a native wifi network that is too weak in several rooms to be usable there. The PC is placed in a room where the signal is weak and I was able to create an access point using nmcli (details below). ## Goal What I would like to achieve is to have the access point wifi to share the router’s wifi SSID and password so that the main wifi is extended rather than separate. That way, devices would just switch access points using in appearance the same wifi network. ## Access Point Configuration My current nm configuration is as follows : [connection] id= uuid= type=wifi interface-name= permissions= timestamp= [wifi] band=bg channel=1 mac-address-blacklist= mode=ap seen-bssids= ssid=_private [wifi-security] group=ccmp; key-mgmt=wpa-psk pairwise=ccmp; proto=rsn; psk= [ipv4] dns-search= method=shared [ipv6] addr-gen-mode=stable-privacy dns-search= method=auto ## Hints I have so far My understanding is that in principle I should change the SSID to be my internet provider's wifi SSID and disable the access point DHCP. However, I don't understand how to do that after a while searching the internet. I tried setting the ipv4 and ipv6 methods to disabled but when I connected to the wifi with my phone I got disconnected almost instantly afterwards until I restored it. The internet provider's wifi is using WPA2 - AES as security setting and the channel 6 (that's why I chose wpa-psk, rsn and channel 1 in my nm configuration). Any advice is appreciated.
Tonio (121 rep)
Jul 18, 2023, 10:22 PM • Last activity: Jul 18, 2023, 10:28 PM
0 votes
0 answers
179 views
How do I access device using hostname that is hosting an access point?
I have an embedded linux device hosting an access point, I set it up like this: ``` sudo apt install dnsmasq-base -y nmcli connection add type wifi ifname wlan0 con-name access_point autoconnect yes ssid my_ssid nmcli connection modify access_point 802-11-wireless.mode ap 802-11-wireless.band bg ipv...
I have an embedded linux device hosting an access point, I set it up like this:
sudo apt install dnsmasq-base -y
nmcli connection add type wifi ifname wlan0 con-name access_point autoconnect yes ssid my_ssid
nmcli connection modify access_point 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli connection modify access_point wifi-sec.key-mgmt wpa-psk
nmcli connection modify access_point wifi-sec.psk "my_password"
nmcli connection up access_point
I am able to connect to the access point and get an IP address. I am then able to ssh to the device hosting the access point using IP like:
ssh user@IP
I want to host a small web server on the embedded device that devices can access while connected to the access point. I would like to be able to hit the server with a hostname rather than an IP. Is this possible with only making changes to the embedded device, I don't want each device that connects to the access point to have to put an entry in their hosts file for example.
av4625 (101 rep)
Mar 27, 2023, 12:41 PM
0 votes
0 answers
177 views
Access point and working DNS
I want to organize an access point in `Kali Linux OS`. I do it with the command tool: `sudo berate_ap -n wlan0 Testing 12345678`. The access point is working well. A new interface appears in the network settings: `ap0`. Clients also successfully connect to this access point and receive the following...
I want to organize an access point in Kali Linux OS. I do it with the command tool: sudo berate_ap -n wlan0 Testing 12345678. The access point is working well. A new interface appears in the network settings: ap0. Clients also successfully connect to this access point and receive the following network settings: IP: 192.168.12.*/24 Gateway: 192.168.12.1 DNS: 192.168.12.1 My task is as follows: so that the laptop on which this access point is accessible from the phone (i.e. from the client device that is connected to this dsoup point) by domain name, i.e. so that from the phone I typed into the browser, for example, testing.net, I got to this laptop, or rather, to the service that is spinning there, I can log in by IP, but I can’t by the domain name. Could you tell me please, how can I implement such a task? I tried to do something through the bind9 utility, but nothing worked for me. too complicated setup and it is not clear what's what. Maybe there is a faster and easier way. Thank you very much!
Alex Rebell (172 rep)
Feb 28, 2023, 02:02 PM
2 votes
0 answers
424 views
ubuntu/ath10k: regdomain has no effect
Summary: PCEngines APU2 board with 2 identical Compex WLE600VX wireless cards. Ubuntu 22.04 with 5.19 (hwe) kernel. I'm trying to make them work as an access points using `hostapd`, usual way. Both cards come with US (0x0) regdomain in EEPROM, so it should work fine (in `world` regdomain all channel...
Summary: PCEngines APU2 board with 2 identical Compex WLE600VX wireless cards. Ubuntu 22.04 with 5.19 (hwe) kernel. I'm trying to make them work as an access points using hostapd, usual way. Both cards come with US (0x0) regdomain in EEPROM, so it should work fine (in world regdomain all channels are marked as No-IR -> no AP for ya):
# dmesg | grep regdomain
[   22.933786] ath: EEPROM regdomain: 0x0
[   23.093868] ath: EEPROM regdomain: 0x0
Problem is I can't set the regdomain for the 1st card:
# iw reg get
global
country 98: DFS-UNSET
        (902 - 904 @ 2), (N/A, 20), (N/A), PASSIVE-SCAN
        (904 - 920 @ 2), (N/A, 20), (N/A), PASSIVE-SCAN
        (920 - 928 @ 2), (N/A, 20), (N/A), PASSIVE-SCAN
        (2402 - 2472 @ 40), (N/A, 20), (N/A)
        (2457 - 2472 @ 15), (N/A, 20), (N/A), PASSIVE-SCAN
        (5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
        (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
        (5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, PASSIVE-SCAN
        (5735 - 5835 @ 80), (N/A, 20), (N/A), PASSIVE-SCAN
        (57240 - 63720 @ 2160), (N/A, 0), (N/A)

phy#1
country US: DFS-FCC
        (902 - 904 @ 2), (N/A, 30), (N/A)
        (904 - 920 @ 16), (N/A, 30), (N/A)
        (920 - 928 @ 8), (N/A, 30), (N/A)
        (2400 - 2472 @ 40), (N/A, 30), (N/A)
        (5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
        (5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
        (5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
        (5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
        (5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
        (5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
        (57240 - 71000 @ 2160), (N/A, 40), (N/A)

phy#0
country 99: DFS-UNSET
        (2402 - 2472 @ 40), (N/A, 20), (N/A)
        (5140 - 5360 @ 80), (N/A, 30), (N/A), PASSIVE-SCAN
        (5715 - 5860 @ 80), (N/A, 30), (N/A), PASSIVE-SCAN
phy0 always stays 99 even after doing iw reg set US. Consequently I cannot use any 5Ghz frequencies on it in AP mode. Any idea what I miss? The cards are the same, regdomain same, why they are treated differently? I can even swap them in PCI-E slots but the result stays the same. P.S. If I add option ieee80211_regdom=US to module cfg80211 the regdomain is shown as US in iw reg get, but the frequencies are anyway blocked in iw list (marked as No-IR):
Frequencies:
                        * 5180 MHz  (30.0 dBm) (no IR)
                        * 5200 MHz  (30.0 dBm) (no IR)
                        * 5220 MHz  (30.0 dBm) (no IR)
                        * 5240 MHz  (30.0 dBm) (no IR)
                        * 5260 MHz  (30.0 dBm) (no IR, radar detection)
                        * 5280 MHz  (30.0 dBm) (no IR, radar detection)
                        * 5300 MHz  (30.0 dBm) (no IR, radar detection)
                        * 5320 MHz  (30.0 dBm) (no IR, radar detection)
                        * 5500 MHz  (disabled)
                        * 5520 MHz  (disabled)
                        * 5540 MHz  (disabled)
                        * 5560 MHz  (disabled)
                        * 5580 MHz  (disabled)
                        * 5600 MHz  (disabled)
                        * 5620 MHz  (disabled)
                        * 5640 MHz  (disabled)
                        * 5660 MHz  (disabled)
                        * 5680 MHz  (disabled)
                        * 5700 MHz  (disabled)
                        * 5720 MHz  (disabled)
                        * 5745 MHz  (30.0 dBm) (no IR)
                        * 5765 MHz  (30.0 dBm) (no IR)
                        * 5785 MHz  (30.0 dBm) (no IR)
                        * 5805 MHz  (30.0 dBm) (no IR)
                        * 5825 MHz  (30.0 dBm) (no IR)
                        * 5845 MHz  (30.0 dBm) (no IR)
                        * 5865 MHz  (disabled)
Igor Novgorodov (131 rep)
Feb 18, 2023, 07:53 PM
0 votes
1 answers
141 views
Why can't set the wireless access point in my debian?
My wireless adapter: lsusb | rg -i wireless Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter List my network interface: iwconfig lo no wireless extensions. enp6s0 no wireless extensions. wlx38a28c80c24f IEEE 802.11 Mode:Master Tx-Power=20 dBm Retry short long limit:2...
My wireless adapter: lsusb | rg -i wireless Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter List my network interface: iwconfig lo no wireless extensions. enp6s0 no wireless extensions. wlx38a28c80c24f IEEE 802.11 Mode:Master Tx-Power=20 dBm Retry short long limit:2 RTS thr:off Fragment thr:off Power Management:off Install hostapd and set up configuration: sudo apt-get install hostapd sudo vim /etc/hostapd/hostapd.conf interface=wlx38a28c80c24f driver=nl80211 ssid=myap hw_mode=g channel=7 macaddr_acl=0 auth_algs=3 ignore_broadcast_ssid=0 wmm_enabled=1 ieee80211n=1 ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40] wpa=2 wpa_passphrase=linuxprobe macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP Install dnsmasq and set up configuration: sudo apt-get install dnsmasq sudo vim /etc/dnsmasq.conf resolv-file=/etc/resolv.dnsmasq.conf server=/cn/114.114.114.114 server=/taobao.com/114.114.114.114 listen-address=127.0.0.1,192.168.11.1 dhcp-range=192.168.11.50,192.168.11.150,12h dhcp-option=3,192.168.11.1 dhcp-option=6,192.168.11.1 cache-size=1024 conf-dir=/etc/dnsmasq.d sudo vim /etc/resolv.dnsmasq.conf nameserver 114.114.114.114 sudo vim /etc/resolv.conf nameserver 127.0.0.1 Start the services: sudo systemctl start dnsmasq.service sudo systemctl start hostapd.service Now connect myap with password linuxprobe,why the access point can't be accessed via my android phone?
newview (205 rep)
Dec 13, 2022, 01:44 PM • Last activity: Dec 14, 2022, 10:46 AM
Showing page 1 of 20 total questions