Infini-FRAMEWORK: move NAT into specialisation

This commit is contained in:
Infinidoge 2024-11-26 20:41:55 -05:00
parent f62d790ab2
commit 47f7641de4
Signed by: Infinidoge
SSH key fingerprint: SHA256:oAMyvotlNFraMmZmr+p6AxnNfW/GioTs1pOn3V4tQ7A

View file

@ -101,53 +101,54 @@
} }
]; ];
networking = { specialisation.router.configuration = {
interfaces = { networking = {
"wlp170s0".useDHCP = true; interfaces."enp0s13f0u1" = {
"enp0s13f0u1" = {
ipv4.addresses = [{ ipv4.addresses = [{
address = "192.168.100.1"; address = "192.168.100.1";
prefixLength = 24; prefixLength = 24;
}]; }];
}; };
};
firewall.interfaces = { firewall.interfaces."enp0s13f0u1" = {
"enp0s13f0u1".allowedTCPPorts = [ 53 ]; allowedTCPPorts = [ 53 ];
"enp0s13f0u1".allowedUDPPorts = [ 53 67 ]; allowedUDPPorts = [ 53 67 ];
};
nat = {
enable = true;
internalInterfaces = [ "enp0s13f0u1" ];
externalInterface = "wlp170s0";
};
}; };
nat = { services.dnsmasq = {
enable = true; enable = true;
internalInterfaces = [ "enp0s13f0u1" ]; settings = {
externalInterface = "wlp170s0"; server = [ "8.8.8.8" "1.1.1.1" ];
domain-needed = true;
bogus-priv = true;
no-resolv = true;
cache-size = 1000;
dhcp-range = [ "enp0s13f0u1,192.168.100.10,192.168.100.100" ];
interface = "enp0s13f0u1";
dhcp-host = "192.168.100.1";
local = "/lan/";
domain = "lan";
expand-hosts = true;
no-hosts = true;
address = "/infini-framework.lan/192.168.100.1";
};
}; };
};
services.dnsmasq = { boot.kernel.sysctl = {
enable = true; "net.ipv4.conf.all.forwarding" = true;
settings = { "net.ipv6.conf.all.forwarding" = true;
server = [ "8.8.8.8" "1.1.1.1" ];
domain-needed = true;
bogus-priv = true;
no-resolv = true;
cache-size = 1000;
dhcp-range = [ "enp0s13f0u1,192.168.100.10,192.168.100.100" ];
interface = "enp0s13f0u1";
dhcp-host = "192.168.100.1";
local = "/lan/";
domain = "lan";
expand-hosts = true;
no-hosts = true;
address = "/infini-framework.lan/192.168.100.1";
}; };
};
boot.kernel.sysctl = {
"net.ipv4.conf.all.forwarding" = true;
"net.ipv6.conf.all.forwarding" = true;
}; };
} }