oblique / create_ap

[NOT MAINTAINED] This script creates a NATed or Bridged WiFi Access Point.
BSD 2-Clause "Simplified" License
4.43k stars 998 forks source link

device cannot connect and stuck at `Obtaining IP address...` #455

Closed basilrabi closed 4 years ago

basilrabi commented 4 years ago

I was able to use create_ap in fedora 31 without issues. However in fedora 32, I can't connect to the wifi anymore. I can see the wifi but when I connect my android phone to my shared wifi, it only says Obtaining IP address... and after a while it says IP Configuration Failure. How can I debug this? Is there some configuration needed?

Below is the terminal output.

# create_ap wlp13s0 wlp13s0 $SSID $PASSWD
Config dir: /tmp/create_ap.wlp13s0.conf.x8Jk2eyr
PID: 9314
Network Manager found, set ap0 as unmanaged device... DONE
wlp13s0 is already associated with channel 1 (2412 MHz)
Creating a virtual WiFi interface... ap0 created.
Sharing Internet using method: nat
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlp13s0.conf.x8Jk2eyr/hostapd_ctrl
Configuration file: /tmp/create_ap.wlp13s0.conf.x8Jk2eyr/hostapd.conf
Using interface ap0 with hwaddr 34:23:87:ae:8a:6a and ssid "$SSID"
ap0: interface state UNINITIALIZED->ENABLED
ap0: AP-ENABLED 
ap0: STA 40:b0:76:19:c0:03 IEEE 802.11: authenticated
ap0: STA 40:b0:76:19:c0:03 IEEE 802.11: associated (aid 1)
ap0: AP-STA-CONNECTED 40:b0:76:19:c0:03
ap0: STA 40:b0:76:19:c0:03 RADIUS: starting accounting session 8A869AAA0DB2A41E
ap0: STA 40:b0:76:19:c0:03 WPA: pairwise key handshake completed (RSN)
ap0: AP-STA-DISCONNECTED 40:b0:76:19:c0:03
ap0: STA 40:b0:76:19:c0:03 IEEE 802.11: authenticated
ap0: STA 40:b0:76:19:c0:03 IEEE 802.11: associated (aid 1)
ap0: AP-STA-CONNECTED 40:b0:76:19:c0:03
ap0: STA 40:b0:76:19:c0:03 RADIUS: starting accounting session E0EFB1A7016EF630
ap0: STA 40:b0:76:19:c0:03 WPA: pairwise key handshake completed (RSN)
johnnyjacq16 commented 4 years ago

@basilrabi Fedora has a firewall that is installed by default. do systemctl status firewalld you can either disable the firewall or use the firewall-cmd to add ports to a zone which has been applied to the interface.

basilrabi commented 4 years ago

@johnnyjacq16 , thank you for the guidance! After activating the access point, I needed to add the interface to the firewalld in the zone nm-shared which seems to be zone also for wifi-hotspot:

firewall-cmd --zone=nm-shared --add-interface=ap0