Creating a UDP wireguard tunnel via Pangolin. Are the suggested instructions from the docs safe?
I'm trying to create a direct p2p connection from my home network to a remote network using Pangolin, which uses Wireguard as its back end.
The docs recommend adding a hybrid NAT rule:
>By default, OPNsense software rewrites the source port on all outgoing connections to enhance security and prevent direct exposure of internal port numbers. Static port mapping in OPNsense involves creating a fixed association between a specific external port number and an internal IP address and port, allowing incoming traffic to be directed to the correct destination within the local network.
>Go to Firewall > NAT, Outbound tab. Select Hybrid Outbound NAT rule generation. Select Save. Select ↑ Add to create a new NAT rule to the top of the list. Configure the rule to match UDP traffic. Note, for each rule, select the appropriate Address Family (IP version), IPv4 for one and IPv6 for the other.
I have enough knowledge to be dangerous, but not really enough to fully understand the implications of what I'm doing. I've created this rule, and tested that it does work, but I want to make sure its fundamentally safe, and I'm not creating any unnecessary security risks.
These are the settings for the Source NAT rule:
- Interface: WAN
- Version IPv4
- Protocol: UDP
- Source Address: LAN Network
- Destination address: any
- Destination port: any
- Translate Source IP: (default) Interface Address
- Translate Source Port: any
- Static Port: Yes