I’m attempting to set up a source NAT rule for IPv6 on my router. I need any outgoing packets on the interface enp1s0 to be modified to have a specific IPv6 address.
you need the ip6 family table, not inet. try nft add rule ip6 nat postrouting oifname "enp1s0" masquerade first to test if ipv6 nat works at all. if that’s good then use snat to 2401:fb00:0:1ff::32d - don’t put the /64 suffix there.
But what exactly are you trying to achieve? Prefix translation or just masquerading? Understanding your end goal would help figure out the best approach.
Also, does ip -6 addr show enp1s0 show that target address is actually configured on that interface?
Those syntax errors happen because IPv6 NAT needs specific table and chain setup. You’re trying to add rules to tables that don’t exist yet - been there, done that. Spent hours debugging the same thing when I started with IPv6 SNAT. Here’s what fixed it for me: First, create the ip6 nat table if it’s missing: nft add table ip6 natnft add chain ip6 nat postrouting { type nat hook postrouting priority 100 \; policy accept \; } Then add your SNAT rule: nft add rule ip6 nat postrouting oifname "enp1s0" snat to 2401:fb00:0:1ff::32d Key differences: use ip6 family, create the nat table first, and drop the /64 prefix from your SNAT target. Also double-check that target IPv6 address is actually assigned to your system with ip -6 addr show. SNAT breaks if the kernel can’t route return traffic through that address.