Linux Wifi Hotspot

repository·master·Indexed 26 days ago

https://github.com/lakinduakash/linux-wifi-hotspot

A tool to share a wifi connection or network interface as a hotspot on Linux, supporting simultaneous wifi connectivity, VPN tunneling, and QR code sharing. It provides both a GUI (wihotspot) and a CLI (create_ap) and is available for Debian, Ubuntu, Arch Linux, and Fedora.

Tokens
2.6K
Snippets
16
Records
22
Agent score
88%

What's inside linux-wifi-hotspot

  1. Install patched hostapd for Realtek drivers

    master

    Realtek's driver uses the wireless-extensions (wext) subsystem, whereas standard hostapd requires nl80211. You must install a patched version of hostapd to support these drivers.

    For ArchLinux: Install hostapd-rtl871xdrv from the AUR (e.g., using yaourt).

    For other distributions:

    1. Clone the patch repository.
    2. Download and extract the hostapd-2.2 source.
    3. Apply the rtlxdrv.patch.
    4. Copy the driver files into the source directory.
    5. Configure the build to enable CONFIG_DRIVER_RTW=y.
    6. Compile and install.
    # ArchLinux
    yaourt -S hostapd-rtl871xdrv
    
    # Other distributions
    git clone https://github.com/pritambaral/hostapd-rtl871xdrv.git
    wget http://w1.fi/releases/hostapd-2.2.tar.gz
    tar zxvf hostapd-2.2.tar.gz
    cd hostapd-2.2
    patch -p1 -i ../hostapd-rtl871xdrv/rtlxdrv.patch
    cp ../hostapd-rtl871xdrv/driver_* src/drivers
    cd hostapd
    cp defconfig .config
    echo CONFIG_DRIVER_RTW=y >> .config
    make
    make install
  2. Install Linux Wifi Hotspot on Debian/Ubuntu

    master

    You can install Linux Wifi Hotspot on Debian or Ubuntu-based systems using the official PPA or by downloading the latest Debian package from the GitHub releases page.

    sudo add-apt-repository ppa:lakinduakash/lwh
    sudo apt update
    sudo apt install linux-wifi-hotspot
  3. Use create_ap to create a WiFi hotspot

    master

    The create_ap command allows you to create an Access Point (AP) with various configurations including encryption, internet sharing methods, and client isolation.

    Basic Usage Patterns:

    • Open Network (No passphrase): create_ap <wifi_interface> <internet_interface> <SSID>
    • WPA/WPA2 Protected: create_ap <wifi_interface> <internet_interface> <SSID> <Passphrase>
    • No Internet Sharing: Use the -n flag.
    • Bridged Internet Sharing: Use the -m bridge flag.
    • Sharing from the same interface: Use the same interface for both arguments (e.g., wlan0 wlan0).
    • Client Isolation: Use the --isolate-clients flag to prevent communication between connected clients.
    # WPA + WPA2 passphrase
    create_ap wlan0 eth0 MyAccessPoint MyPassPhrase
    
    # AP without Internet sharing
    create_ap -n wlan0 MyAccessPoint MyPassPhrase
    
    # Bridged Internet sharing
    create_ap -m bridge wlan0 eth0 MyAccessPoint MyPassPhrase
    
    # Client Isolation
    create_ap --isolate-clients wlan0 eth0 MyAccessPoint MyPassPhrase
  4. Install fixed Realtek driver for 8192 chipsets

    master

    The mainline Linux kernel driver often performs poorly with 8192 adapters. To install a fixed version of the Realtek driver using DKMS, execute the following commands:

    1. Clone the fixes repository.
    2. Add and install the driver via DKMS.
    3. Copy the blacklist and power management configuration files to /etc/modprobe.d.
    4. Unload the previous driver and load the new one, or reboot the system.

    Note: This is specifically for Realtek adapters with the 8192 chipset.

    git clone https://github.com/pvaret/rtl8192cu-fixes.git
    dkms add rtl8192cu-fixes
    dkms install 8192cu/1.9
    cp rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d
    cp rtl8192cu-fixes/8192cu-disable-power-management.conf /etc/modprobe.d
  5. Prepare system for Realtek 8192 driver installation

    master

    Before installing the specialized Realtek driver, you must install build dependencies and remove the existing hostapd package to avoid conflicts.

    For ArchLinux:

    pacman -S base-devel linux-headers dkms git
    pacman -R hostapd

    For Debian, Ubuntu, or Debian-based distributions:

    apt-get install build-essential linux-headers-generic dkms git
    apt-get remove hostapd
    apt-get build-dep hostapd
    # ArchLinux
    pacman -S base-devel linux-headers dkms git
    pacman -R hostapd
    
    # Debian/Ubuntu
    apt-get install build-essential linux-headers-generic dkms git
    apt-get remove hostapd
    apt-get build-dep hostapd