router: add nf_tables module, use regular kernel for now.

This commit is contained in:
Aaron Bieber 2022-10-16 10:10:13 -06:00
parent f314cafa5c
commit 0399a3ba21
No known key found for this signature in database
4 changed files with 8 additions and 3 deletions

View File

@ -14,7 +14,8 @@
nixos-hardware = { url = "github:NixOS/nixos-hardware/master"; };
emacs-overlay = {
url = "github:nix-community/emacs-overlay/08445dd7824253ee8580f06127460a7d14e942cf";
url =
"github:nix-community/emacs-overlay/08445dd7824253ee8580f06127460a7d14e942cf";
inputs.nixpkgs.follows = "stable";
};

View File

@ -11,6 +11,8 @@ in {
_module.args.isUnstable = false;
imports = [ ./hardware-configuration.nix ];
boot.kernelPackages = pkgs.linuxPackages;
boot.kernel.sysctl = {
"net.ipv4.conf.all.forwarding" = true;
"net.ipv6.conf.all.forwarding" = true;
@ -29,7 +31,7 @@ in {
firewall.enable = false;
nftables = {
enable = false;
enable = true;
rulesetFile = ./router.nft;
};

View File

@ -13,7 +13,7 @@
boot.initrd.availableKernelModules =
[ "ehci_pci" "ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.kernelModules = [ "nf_tables" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {

View File

@ -1,3 +1,5 @@
add table ip nat
table ip nat {
chain postrouting {
type nat hook postrouting priority 100