Internet Connection Sharing: Difference between revisions

From NixOS Wiki
imported>Onny
Init page
 
imported>Jooooscha
m replace nix-env with nix shell
Line 6: Line 6:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
nix-env -iA nixos.linux-wifi-hotspot
nix shell nixpkgs#linux-wifi-hotspot
sudo create_ap wlan0 eth0 MyAccessPoint
sudo create_ap wlan0 eth0 MyAccessPoint
</syntaxhighlight>
</syntaxhighlight>

Revision as of 20:26, 6 February 2023

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 shell nixpkgs#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";
  };
};