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).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No IP Allocated Error

incrypto32 opened this issue · comments

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):

  • OS: Manjaro

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

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.

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

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

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.

Potential fix in new comment below

I'm experiencing the same issue, Fedora 35 built from source at 04dae50. 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

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!

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

@arimgibson Thanks for Fix
On Fedora 35, removal of iptables-nft(It removed packages related to firewalld) fixes ip issue, also Allow internet access to connected devices
Edit: @lakinduakash Firewalld is causing whole problem , simply disabling it fixes problem, I don't know how to allow connections for wihotspot in firewalld
For adding firewall rules instructions are available at #166

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

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

commented

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