Install NixOS on Liteserver: Difference between revisions
imported>Hugo-Heagren mNo edit summary |
imported>Hugo-Heagren Change networking config to allow for SSH. |
||
| Line 69: | Line 69: | ||
==== Networking ==== | ==== Networking ==== | ||
The below setup does not include DHCP, and instead statically configures both IPV6 and IPV4. The IPV4 is especially important if you want to ssh into your server (which you almost certainly will -- the qemu portal offered by liteserver is not particularly nice to work with). We disable DHCP because it inteferes with such static configuration. | |||
You can find your IPV4 address listed as the 'Primary IP' on the front dashboard after you login to Liteserver's client area. It will look something like "192.0.2.0". Your IPV4 gateway is your IPV4, with a '1' instead of the final number. So if your IPV4 address is '192.0.2.0', then your gateway is '192.0.2.1'. | |||
<syntaxhighlight lang="nix"> | |||
# We have to use static config (no DHCP) | |||
# to deal with Liteserver and enable proper SSH | |||
networking.useDHCP = false; | |||
systemd.network.enable = true; | |||
systemd.network.networks."10-wan" = { | |||
matchConfig.Name = "ens3"; | |||
address = [ | |||
"<YOUR IPV4 ADDRESS>/24" | |||
"<YOUR MODIFIED SUBNET (from above)>" # e.g. 2a04:52c0:118:fe87::2/48 | |||
"2a04:52c0:118:fe87::2/48" | |||
]; | |||
gateway = [ | |||
"<YOUR IPV4 GATEWAY>" | |||
"<YOUR GATEWAY (from above)>" | |||
]; | |||
}; | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="shell"> | <syntaxhighlight lang="shell"> | ||