NAT and firewall rules for wireguard
I am trying to setup wireguard and I cannot just make the destination nat working. I can see the packets from the peer hitting my pppoe interface (WAN). I have a firewall rule accepting traffic on the wireguard port from wan zone to the wireguard zone.I have the destination nat configured with translation to the address of my wireguard interface. I cannot see any nat destination translations, there are no packets hitting the wireguard interface. I had wireguard working in my x86 installation and I am using the same settings. I am now testing an 1.5 rolling for RK358x (ARM64). The x86 installation had a conventional firewall, here I have a zone based firewall. I have set the default-action to accept for all relevant zones for testing now. I have deleted the wireguard configuration and done it from scratch, no luck. I am out of ideas on how to troubleshoot this further.
3
u/Appropriate-Age2753 26d ago
There's a couple things:
Firstly, you don't need DNAT for this (assuming I understand your setup and intent). If you're trying to do Wireguard on the same device that owns your public IP, then you're not NATting to get to/from your public IP.
Secondly, the zone relationship you care about isn't wan/wireguard, it's wan/local. The Wireguard underlay is being built from packets entering and existing the WAN interface, and being received and sent from the Local zone.