Fix iptables not recognizing flags to forward ports (`--to-destination` unknown)

I made a github issue trying to figure this out: Cannot forward ports; iptables does not recognize `--to-destination` option · Issue #120069 · NixOS/nixpkgs · GitHub

I’m trying to use a small linux box as my router for my house. Right now I don’t trust it enough yet to actual serve traffic for my house so it has it’s own network (192.168.3.0/24) within my house (192.168.2.0/24) until I get it to the point that I feel comfortable with it.

I have a NAS behind it right now that I want to access in my larger network via port forwarding. However, I’m running into issues similar to when I posted about tc_cake which seems like something is not enabled which allows iptables to recognize the --to-destination flags.

If anyone has ideas of what I should look for I would greatly appreciate the help.

I answer appears to have been

  1. I had my kernel modules locked which required restarts to make things work properly
  2. I needed to specifically enable ipt_dnat and xt_nat which I incorrectly thought were already being loaded.

Then everything worked fine.