Internet Connection Sharing

From NixOS Wiki
Revision as of 09:06, 4 February 2023 by imported>Onny (Init page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Short example configurations for internet connection sharing.

Usage

Share an existing internet connection of a wired interface eth0 using a wifi hotspot on wlan0 with the access point name MyAccessPoint.

nix-env -iA nixos.linux-wifi-hotspot
sudo create_ap wlan0 eth0 MyAccessPoint

Configuration

Persistent share an existing internet connection of a wired interface eth0 using a wifi hotspot on wlan0 with the access point name My Wifi Hotspot. The network is protected with a simple WPA2 pre-shared key 12345678.

services.create_ap = {
  enable = true;
  settings = {
    INTERNET_IFACE = "eth0";
    WIFI_IFACE = "wlan0";
    SSID = "My Wifi Hotspot";
    PASSPHRASE = "12345678";
  };
};