Routers
OPNsense OPNsense Jun 6, 2026
Posted Sat, Jun 6, 2026 2:01 PM

How to setup WireGuard on OPNsense

This guide was created by a community member and reviewed by us. Firmware and router interfaces may change over time, so some steps may differ depending on your device or version.

Prerequisites:

  1. OPNsense version must be 26.1 or newer
  2. You will need a WireGuard config for the location you selected in the WireGuard generator

Setup

  1. Open OPNsense at "192.168.1.1" (by default)
  2. Log In (username is "root" and password is "opnsense" by default)
  3. Go to VPN → WireGuard → Peers
  4. Add a Peer
  5. Enter the name of your WireGuard configuration in the "Name" (for example: xeovo-fi)
  6. Open your WireGuard config (for example: xeovo-fi.conf)
  7. Copy and paste the Public Key (for example: xfh8/RmqPebvYvYmO89L9mR6X0Ff+bU4aE8Vb3XWlzA=)
  8. Copy and paste the Allowed IPs (0.0.0.0/0,::/0)
  9. Copy and paste the Endpoint address without the port (for example: fi.gw.xeovo.com)
  10. Copy and paste the Endpoint port (for example: 51820)
  11. Save the Peer
  12. Go to the "Instances" tab
  13. Add an Instance
  14. Click the "Advanced Mode"
  15. Enter the name of your WireGuard configuration in the "Name" (for example: xeovo-fi)
  16. Copy and paste the PrivateKey into the "Private Key" (for example: gA3Xb8mR9KeVbYv2Om89L9mR6X0Ff+bU4aE8Vb3XWlzA=)
  17. Enter "51820" in the "Listen Port"
  18. Copy and paste the DNS into the "DNS servers" (for example: 10.0.0.20,fd64:e20:68a2::20)
  19. Copy and paste the Address into the "Tunnel Address" (for example: 10.134.162.183,fd64:e20:68a3::6:a2b7)
  20. In Peers, select the previously created Peer (for example: xeovo-fi)
  21. Save the Instance
  22. Check the "Enable WireGuard" box, then click "Apply"
  23. Go to VPN → WireGuard → Status
  24. Connection status must be OK, check the "Handshake Age", it should show a value
  25. Go to Firewall → NAT → Outbound
  26. Select the "Hybrid outbound NAT rule generation" mode and click "Save"
  27. Add a Rule
  28. In Interface, select "WireGuard (Group)"
  29. In Source address, select "LAN net"
  30. In Translation / target, select "Interface Address"
  31. Save the Rule
  32. Apply changes
  33. Verify VPN connection, visit DoesMyVPN.work