Assign a static IP address

This commit is contained in:
coolneng 2021-05-13 12:32:10 +02:00
parent 1e49543907
commit 8392ac213b
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 20 additions and 11 deletions

View File

@ -32,9 +32,6 @@
# Cleanup tmp on startup
boot.cleanTmpDir = true;
# Set hostname
networking.hostName = "zion";
# Create coolneng user
users.users.coolneng = {
isNormalUser = true;
@ -54,7 +51,6 @@
services.timesyncd.enable = true;
# Enable ZFS support
networking.hostId = "4e74ea68";
boot.supportedFilesystems = [ "zfs" ];
# Scrub zpool monthly

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