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.2k stars 296 forks source link

AppImage or Flatpak Distribution #231

Open ShrirajHegde opened 2 years ago

ShrirajHegde commented 2 years ago

Is your feature request related to a problem? Please describe. linux-wifi-hotspot Does not work on Fedora 34/35

Describe the solution you'd like Appimage / Flatpak distribution (preferrably appimage since it's standalone)

Describe alternatives you've considered Troubleshooting and different config options

Additional context On fedora 35, hotspot creation works, but DHCP doesn't work. Same laptop with ubuntu, LWH works fine

lakinduakash commented 2 years ago

Can you please send the logs by executing the tool in the command line? So we can identify why doesn't it work. AppImage/Flatpak won't fix the issue.

ShrirajHegde commented 2 years ago

Excluding GTK warnings,

pkexec --user root create_ap wlo1 wlo1 'test' '12345678' --mkconfig /etc/create_ap.conf --freq-band 2.4 
Config options written to '/etc/create_ap.conf'

contents of /etc/create_ap.conf:

❯ cat '/etc/create_ap.conf'
CHANNEL=default
GATEWAY=192.168.12.1
WPA_VERSION=2
ETC_HOSTS=0
DHCP_DNS=gateway
NO_DNS=0
NO_DNSMASQ=0
HIDDEN=0
MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
ISOLATE_CLIENTS=0
SHARE_METHOD=nat
IEEE80211N=0
IEEE80211AC=0
HT_CAPAB=[HT40+]
VHT_CAPAB=
DRIVER=nl80211
NO_VIRT=0
COUNTRY=
FREQ_BAND=2.4
NEW_MACADDR=
DAEMONIZE=0
DAEMON_PIDFILE=
DAEMON_LOGFILE=/dev/null
NO_HAVEGED=0
WIFI_IFACE=wlo1
INTERNET_IFACE=wlo1
SSID=test
PASSPHRASE=12345678
USE_PSK=0

This successfully creates a hotspot which is visible on my phone. But DHCP doesn't seem to work.

image

I have tried setting static IP on phone, getting IP and gateway from ip addr | grep inet and selecting inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 and setting something in 192.168.122.x as static IP for phone connects, but no internet.

ShrirajHegde commented 2 years ago

Log from create_ap

❯ sudo create_ap wlo1 wlo1 'test' '12345678'  
Config dir: /tmp/create_ap.wlo1.conf.k1Nl5cEY
PID: 37422
Network Manager found, set ap0 as unmanaged device... DONE
wlo1 is already associated with channel 11 (2462 MHz)
multiple channels supported
Creating a virtual WiFi interface... ap0 created.
Sharing Internet using method: nat
hostapd command-line interface: hostapd_cli -p /tmp/create_ap.wlo1.conf.k1Nl5cEY/hostapd_ctrl
ap0: interface state UNINITIALIZED->ENABLED
ap0: AP-ENABLED 
ap0: STA 2a:92:27:c5:39:b8 IEEE 802.11: authenticated
ap0: STA 2a:92:27:c5:39:b8 IEEE 802.11: associated (aid 1)
ap0: AP-STA-CONNECTED 2a:92:27:c5:39:b8
ap0: STA 2a:92:27:c5:39:b8 RADIUS: starting accounting session 5CDBCB5FA4951FF6
ap0: STA 2a:92:27:c5:39:b8 WPA: pairwise key handshake completed (RSN)
ap0: EAPOL-4WAY-HS-COMPLETED 2a:92:27:c5:39:b8
ap0: AP-STA-DISCONNECTED 2a:92:27:c5:39:b8
ap0: STA 2a:92:27:c5:39:b8 IEEE 802.11: authenticated
ap0: STA 2a:92:27:c5:39:b8 IEEE 802.11: associated (aid 1)
ap0: AP-STA-CONNECTED 2a:92:27:c5:39:b8
ap0: STA 2a:92:27:c5:39:b8 RADIUS: starting accounting session C2AE8C51C2F0493F
ap0: STA 2a:92:27:c5:39:b8 WPA: pairwise key handshake completed (RSN)
ap0: EAPOL-4WAY-HS-COMPLETED 2a:92:27:c5:39:b8
ShrirajHegde commented 2 years ago

@lakinduakash Are there any testers/people who have confirmed it to be working on Fedora? since README has compile instructions for fedora.

Still stuck with the same problem while it works fine on ubuntu

ShrirajHegde commented 2 years ago

@Luciogi Thank you very much ! That was the problem. I stopped firewalld service temporarily, and it worked like a charm.

ShrirajHegde commented 2 years ago

@Luciogi is there anyway that linux-wifi-hotspot could handle the rules described in #166 internally?

RokeJulianLockhart commented 1 year ago

Although the problem that caused the user to want this has been remediated, I believe that evaluating whether the proposed packaging methods are useful is sensible, not leastly because this software is not available for me via dnf, despite having added rpmfusion.

(Have you considered a copr repository?)

ShrirajHegde commented 1 year ago

Edit: There are many firewall applications, it may not worth to add functionality for all. Firewall users should configure firewall applications

How about running these commands once during installation?

sudo firewall-cmd --zone=FedoraWorkstation --add-masquerade
sudo firewall-cmd --zone=trusted --add-masquerade
sudo firewall-cmd --zone=trusted --add-interface=ap0
ShrirajHegde commented 1 year ago

Something like this, in a single shell.

if grep -qi fedora /etc/os-release  || which firewall-cmd >/dev/null 2>&1 ; then

sudo firewall-cmd --zone=FedoraWorkstation --add-masquerade
sudo firewall-cmd --zone=trusted --add-masquerade
sudo firewall-cmd --zone=trusted --add-interface=ap0

fi

Or at least warn users.

If you can put the COPR repo in the README, I am ready to make and maintain it. It would solve all these problems.