Gateway (create a zone)
A zone is a subnet, which has a gateway, behind which you can connect as many machines as you want.
Hardware
Section titled “Hardware”The gateway is ideally installed on a mini-computer that is always on, with at least two network interfaces: one to the ISP box (WAN), the others to the local network (LAN, ethernet or wifi).
Declare the zone
Section titled “Declare the zone”The zone and its gateway are described in etc/config.yaml:
zones: maison: description: "Home network" ipPrefix: "10.0" # zone in 10.0.0.0/16 gateway: wan: interface: "enp1s0" # to the ISP box lan: interfaces: ["enp2s0"] # to the local network
hosts: - hostname: "gw" name: "Gateway" zone: "maison:1.1" # fixed IP 10.0.1.1 profile: "gateway" services: adguardhome: # DNS + ad blocking homepage: # service portal disko: profile: "server-1-disk" devices: main: "/dev/sda"Install the gateway
Section titled “Install the gateway”Installation is often done remotely: someone on site prepares the machine, the administrator installs over SSH.
-
Prepare the gateway (on site)
- Plug the gateway into the box.
- Boot from the USB stick (image
just build-iso). - Note the gateway’s IP address.
- Forward port 22 of the box to the gateway.
-
Install (administrator)
A single command chains disk formatting, hardware configuration, deployment, and cleanup :
Fenêtre de terminal just full-install gw nixos <ip>gw: host name declared inetc/config.yaml.nixos: user of the live USB stick (DNF image).<ip>: address noted at the previous step.
Install from another zone
Section titled “Install from another zone”A gateway is often prepared somewhere other than its destination. Plug its WAN interface into the local network of the hosting zone : it receives the roaming address that this zone reserves for it based on its MAC.
Three conditions :
- the gateway’s
mackey is declared inetc/config.yaml; - the gateway of the hosting zone has been redeployed since that declaration;
- the administration machine too, so that SSH reads the forwarding set up during the installation.
Then, just full-install gw does without an address : the tooling computes the target and tracks it from start to finish. The principle is described in Machines outside their zone.
Register the gateway on the VPN
Section titled “Register the gateway on the VPN”A gateway is a Tailscale client: it advertises its zone’s subnet in the Headscale mesh. Until it is registered on the tailnet, other zones cannot see it.
Follow the dedicated procedure: Register a gateway.
Connecting other machines
Section titled “Connecting other machines”- Linux workstations : same procedure as the first workstation, see Initial installation.
- Smartphones, tablets, third-party PCs : connect automatically to the gateway’s network.
Replacing the hardware
Section titled “Replacing the hardware”Replacing the computer of a gateway in service is a distinct procedure : the machine is new, but its state is not. See Migrating a gateway’s hardware.