nixos-server-config/networking.nix

77 lines
1.5 KiB
Nix
Raw Permalink Normal View History

2019-11-10 08:41:19 +00:00
{ config, pkgs, ... }:
{
networking = {
hostName = "nixos-server";
defaultGateway = {
address = "10.0.20.1";
interface = "bond0";
};
2019-11-10 08:41:19 +00:00
nameservers = [ "10.0.20.1" ];
bonds.bond0 = {
interfaces = [ "enp3s0f0" "enp3s0f1" ];
driverOptions = {
mode = "802.3ad";
};
2019-11-10 08:41:19 +00:00
};
interfaces = {
enp2s0.useDHCP = false;
bond0 = {
2019-11-10 08:41:19 +00:00
ipv4.addresses = [ {
address = "10.0.20.28";
prefixLength = 24;
} ];
ipv6.addresses = [ {
address = "2001:470:6a49:2a:31ad:b70d:49f4:75f2";
prefixLength = 128;
} ];
};
internal.useDHCP = true;
2019-11-10 08:41:19 +00:00
};
vlans = {
internal = {
id = 10;
interface = "bond0";
2019-11-10 08:41:19 +00:00
};
};
wireguard.interfaces = {
wg0 = {
ips = [ "10.0.24.1" ];
privateKeyFile = "/home/michael/wireguard/privkey";
listenPort = 45904;
};
};
2019-11-10 08:41:19 +00:00
firewall = {
enable = true;
allowPing = true;
2019-11-10 08:41:19 +00:00
allowedTCPPorts = [
22 # ssh
2019-11-10 08:41:19 +00:00
];
interfaces = {
internal = {
allowedTCPPorts = [
873 # rsync
139 # samba
445 # samba
2049 # nfs
];
allowedUDPPorts = [
137 # samba
138 # samba
];
};
};
2019-11-10 08:41:19 +00:00
};
/*proxy = {
default = "http://10.0.20.1:8118";
noProxy = "127.0.0.1,localhost,internal.domain";
};*/
2019-11-10 08:41:19 +00:00
};
}