Basic interface and bridge config.
This commit is contained in:
parent
958e9bf84a
commit
dba72ebe37
1 changed files with 38 additions and 17 deletions
|
@ -22,34 +22,55 @@
|
||||||
supportedFilesystems = [ "zfs" ];
|
supportedFilesystems = [ "zfs" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "router";
|
|
||||||
hostId = "91312b0b";
|
|
||||||
# nat = {
|
|
||||||
# enable = true;
|
|
||||||
# internalInterfaces = [ "ve-+" ];
|
|
||||||
# externalInterface = "enp5s0";
|
|
||||||
# enableIPv6 = true;
|
|
||||||
# };
|
|
||||||
useNetworkd = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "America/Detroit";
|
time.timeZone = "America/Detroit";
|
||||||
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
console.keyMap = "us";
|
console.keyMap = "us";
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
hostName = "router";
|
||||||
|
hostId = "91312b0b";
|
||||||
|
firewall.allowedTCPPorts = [
|
||||||
|
80
|
||||||
|
443
|
||||||
|
];
|
||||||
|
useNetworkd = true;
|
||||||
|
bridges = {
|
||||||
|
lan = {
|
||||||
|
interfaces = [
|
||||||
|
"LAN0"
|
||||||
|
"LAN1"
|
||||||
|
"LAN2"
|
||||||
|
"LAN3"
|
||||||
|
"LAN4"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
nat = {
|
||||||
|
enable = true;
|
||||||
|
externalInterface = "WAN";
|
||||||
|
internalInterfaces = [ "lan" ];
|
||||||
|
internalIPs = [ "192.168.0.0/16" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
udev.extraRules = ''
|
||||||
|
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="00:e2:69:96:fb:67", NAME="WAN"
|
||||||
|
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="00:e2:69:96:fb:68", NAME="LAN0"
|
||||||
|
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="00:e2:69:96:fb:69", NAME="LAN1"
|
||||||
|
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="00:e2:69:96:fb:6a", NAME="LAN2"
|
||||||
|
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="00:e2:69:96:fb:6b", NAME="LAN3"
|
||||||
|
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="00:e2:69:96:fb:6c", NAME="LAN4"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# Enable the Flakes feature and the accompanying new nix command-line tool
|
# Enable the Flakes feature and the accompanying new nix command-line tool
|
||||||
nix.settings.experimental-features = [
|
nix.settings.experimental-features = [
|
||||||
"nix-command"
|
"nix-command"
|
||||||
"flakes"
|
"flakes"
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
|
||||||
80
|
|
||||||
443
|
|
||||||
];
|
|
||||||
|
|
||||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue