lakinduakash / linux-wifi-hotspot

Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
BSD 2-Clause "Simplified" License
3.21k stars 295 forks source link

No IP Allocated Error #209

Closed incrypto32 closed 2 years ago

incrypto32 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create a wifi hostpot
  2. Connect from another device to the hotspot

Expected behavior Expected to get connected

Screenshots photo_2021-11-08_10-11-17

Desktop (please complete the following information):

Additional context Seems like an issue with my laptop only. Works fine when I checked from another system

lakinduakash commented 2 years ago

This is strange. Can you run the wihotspot command in terminal and post the output. Also try connecting another device and check whether working (ip get assigned). DHCP must work fine.

incrypto32 commented 2 years ago

Here @lakinduakash here is the screenshot 2021-11-08_11-50

incrypto32 commented 2 years ago

@lakinduakash I also tried from another phone and it didn't work too Same issue.

lakinduakash commented 2 years ago

I can suggest as a temporary fix, assigning an IP to the device from the network setting. I think your DHCP server not working properly. This is the first time this issue came up.

arimgibson commented 2 years ago

Potential fix in new comment below

I'm experiencing the same issue, Fedora 35 built from source at https://github.com/lakinduakash/linux-wifi-hotspot/commit/04dae5083320fed55d4622af64bb1b1de0785a5b. Currently troubleshooting and will edit this post as I learn some new information. So far, I'm getting errors running create_ap but the GUI will start just fine and let me connect via static IP as you suggested. I don't have internet when connecting with static IP, but I think that's my fault for assigning the wrong IP.

Edit 1: Here are some logs. It looks like it used NAT, which I'm not sure if that's the default behavior. Not a networking pro haha. Because of that, I checked for dnsmasq and iptables, both installed. [ari@ari-laptop ~]$ sudo create_ap wlp2s0 wlp2s0 accesspnt ariariari --freq-band 2.4 Config dir: /tmp/create_ap.wlp2s0.conf.MRtRTTqD PID: 6139 Network Manager found, set ap0 as unmanaged device... DONE Custom frequency band set with 2.4Mhz with channel 1 Creating a virtual WiFi interface... ap0 created. Sharing Internet using method: nat hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlp2s0.conf.MRtRTTqD/hostapd_ctrl ap0: interface state UNINITIALIZED->ENABLED ap0: AP-ENABLED ap0: STA 52:7f:4a:aa:c7:ff IEEE 802.11: authenticated ap0: STA 52:7f:4a:aa:c7:ff IEEE 802.11: associated (aid 1) ap0: AP-STA-CONNECTED 52:7f:4a:aa:c7:ff ap0: STA 52:7f:4a:aa:c7:ff RADIUS: starting accounting session 2CCF21460F920469 ap0: STA 52:7f:4a:aa:c7:ff WPA: pairwise key handshake completed (RSN) ap0: EAPOL-4WAY-HS-COMPLETED 52:7f:4a:aa:c7:ff ap0: AP-STA-DISCONNECTED 52:7f:4a:aa:c7:ff

arimgibson commented 2 years ago

Okay, I might have your fix @incrypto32! At least this worked for me, and I have no clue why. A simple removal (or purge, depending on your package manager) of dnsmasq and iptables did it for me. I'm wondering if by chance our OS's ship with a version of those two software that is initialized with some config that just doesn't work for linux-wifi-hotspot. I don't think I had any software that would've installed those otherwise; just the built-in wifi hotspot feature in my Fedora. Anyways, good luck!

lakinduakash commented 2 years ago

Thanks for helping troubleshoot. Even I had no way to reproduce it

huzhifeng commented 1 year ago

I also encountered the problem of not able to get IP address on Fedora 36, it's caused by firewall-cmd. My solution: sudo firewall-cmd --zone=FedoraWorkstation --add-port=67/udp

VenomousSteam81 commented 1 year ago

Same. But I took @huzhifeng command and modified it to be sudo firewall-cmd --permanent --zone=public --add-port=67/udp. Edit: Make sure to run sudo firewall-cmd --reload after running either mine or huzhifeng's command

laur89 commented 1 year ago

If you don't have any other service listening on some ports, then switching the firewalld off for the hotspot duration may also be an option: sudo systemctl stop firewalld assuming you're using systemd. Or can also brute force by sudo killall firewalld