Assign a static IP address

This commit is contained in:
2021-05-13 12:32:10 +02:00
parent 1e49543907
commit 8392ac213b
2 changed files with 20 additions and 11 deletions

View File

@@ -3,6 +3,25 @@
let password = builtins.readFile /var/keys/ddclient;
in {
# Assign a static IP
networking = {
hostName = "zion";
hostId = "4e74ea68";
interfaces.eth0 = {
useDHCP = false;
ipv4.addresses = [{
address = "192.168.13.2";
prefixLength = 24;
}];
};
defaultGateway = {
address = "192.168.13.1";
interface = "eth0";
};
nameservers = [ "195.10.195.195" "165.22.224.164" ];
enableIPv6 = false;
};
# Enable zeroconf
services.avahi = {
enable = true;
@@ -42,12 +61,6 @@ in {
'';
};
# Disable IPv6
networking.enableIPv6 = false;
# Disable WiFi
networking.interfaces."eth0".useDHCP = true;
# Enable NAT for wireguard
networking.nat = {
enable = true;
@@ -79,7 +92,7 @@ in {
# DNS server with ad-block
services.dnsmasq = {
enable = true;
servers = [ "195.10.195.195" "165.22.224.164" ];
servers = config.networking.nameservers;
extraConfig = ''
domain-needed
bogus-priv