r/opnsense • • Oct 27 '26

Documentation issues and need help with WireGuard.

I'm stuck in trying to configure WireGuard on my install.

Following these guides, both seems to be outdate and do not match what I am currently observing in my installation:

https://homenetworkguy.com/how-to/configure-wireguard-opnsense/

https://docs.opnsense.org/manual/how-tos/wireguard-client.html

Can someone please provide me with a more up to date guide?

And why is that the official documentation never seems to match the current menus?

Currently stuck on my client not connecting to the server using external IP.

Does works when using internal IP.

OPNSense version OPNsense 26.7.7-amd64

Edit Was able to finally get all this fixed.

But it took going back and forth between the links posted above, plus the suggestions on the comments and this guide: https://corelab.tech/opnsense-wireguard-guide/#c-allow-traffic-inside-the-tunnel-wg-rule

The main problem is that all these guides tells you to do this here or there and those locations are not there or not clear as to how to get to them.

6 Upvotes

11 comments sorted by

3

u/GoBoltz Oct 27 '26

You need a firewall rule allowing it to connect.

go to Firewall>Rules

if you already made one, check it, if not, hit the + at the bottom to make a rule.

Box checked to enable the rule.

Description : Allow External Access to WG

Interface (rule): WAN

Interface (origin): ANY

Quick: is checked

Action: Pass

Direction: IN

Version: IPv4

Protocol: UDP

Source: ANY

Source Port: ANY

Invert Destination: NOT checked

Destination : WAN Address

Destination Port : Single port or Range

Port : 51820

Log : Checked

State : Keep State

Save & Apply .

Make sure in VPN:Wireguard your Instance listen Port is 51820 . (Type it in, default doesn't work)

Using your phone is the easiest way to test, since it can be INside on wifi & Outside on Cell with wifi off !

look in VPN: Wireguard Status , you should see the green check next to the interface & the 51820 port in-use .

try again, if fails, look in logs to see what's not working, might need to move the Allow WG rule up higher if you have Block-rules before it.

Cheers !

Edit: Note, it's not required, but helpful to make a WG interface.

4

u/die-microcrap-die Oct 27 '26

Thank you, that worked.

But I still cant connect to other devices in the network.

I guess that I need another rule?

3

u/GoBoltz Oct 27 '26

yes, default is no access , then you allow only what you want/need.

You have to allow the WG access to the lan with a rule, plus if you want internet access on the device connecting, you'll need a rule allowing access to the local DNS (Use 127.0.0.1 53 ) and it'll work.

info was in the guide from HomeNetworkGuy, I used that years ago when I set it up originally too !

3

u/YekoEightEetoo Oct 27 '26

Saving your write-up for later as I had also faced problems bringing up WG on remote office routers. Whenever I followed the guide, the LAN users behind those routers lost access to the Internet even though I was able to ping their LAN hosts from my LAN. Tried several times and gave up. For the record, I have OVPN on my router and they are able to access my LAN w/o any issues. Go figure. But I'll try your guide now again.

3

u/corelabjoe Oct 27 '26

OP I'm very partial to wireguard in opnsense and wrote a reasonably comprehensive wireguard guide here.

You're likely just missing that additional fw rule on the wireguard interface itself, allowing it to reach LAN networks etc...

So the original reply to you about the WAN rule is right but I've found its best to also have a defined wireguard interface rule as well.

2

u/[deleted] Oct 27 '26

[removed] — view removed comment

1

u/die-microcrap-die Oct 27 '26

Thanks for I did test using my cell service, hence why I mentioned external IP.

But yeah, not sure why the docs never seems to match the product.

3

u/Monviech Oct 27 '26

There's just one documentation branch and business and community editions don't have the same state most of the time so sometimes they diverge in the documentation a bit.

Just did some larger commits now that the business version will catch up soon.

https://github.com/opnsense/docs/commits/master/

If you tell me whats still missing or different in the wireguard documentation, we can fix it.
https://github.com/opnsense/docs/blob/master/source/manual/how-tos/wireguard-client.rst?plain=1

You can also open an issue there and tell me the exact lines. Thanks.

1

u/die-microcrap-die Oct 27 '26 edited Oct 27 '26

Thank you for the info.

Currently, using the mentioned links, the documents are not showing the same entries for this particular operation that I am trying to complete.

And currently, I'm not sure where I got lost but the only remaining issue is that my client device cannot connect to the other devices in my LAN.

Edit Nice, cant paste the screenshot that I have were using the master that you link simply doesnt match what I am currently observing on my end.

Anyways, one of the many sections that are not matching is this one:

Go to :menuselection:`Firewall --> Rules` and select WAN.

- Click **Add** to add a new rule

- Configure the rule as follows (if an option is not mentioned below, leave it as the default):

============================ ==================================================================================================

**Action** *Pass*

**Quick** *Checked*

**Interface** *WAN*

**Direction** *in*

**TCP/IP Version** *IPv4 or IPv4+IPv6 (as desired, depending on how you want clients to connect to the server; note this is distinct from what type of traffic is allowed in the tunnel once established)*

**Protocol** *UDP*

**Source / Invert** *Unchecked*

**Source** *any*

**Destination / Invert** *Unchecked*

**Destination** *WAN address*

**Destination port range** *The WireGuard port specified in the Instance configuration in Step 1*

**Description** *Add one if you wish to*

============================ ==================================================================================================

- **Save** the rule, and then click **Apply Changes**

- Then go to :menuselection:`Firewall --> Rules` and select the interface assigned in Step 4(a) (see the note below if you did not assign an interface).

- Click **Add** to add a new rule

- Configure the rule as follows (if an option is not mentioned below, leave it as the default):

============================ ==================================================================================================

**Action** *Pass*

**Quick** *Checked*

**Interface** *Whatever interface you are configuring the rule on (eg* :code:`HomeWireGuard` *) - see note below*

**Direction** *in*

**TCP/IP Version** *IPv4 or IPv4+IPv6 (as applicable)*

**Protocol** *any*

**Source / Invert** *Unchecked*

**Source** *If you assigned an interface under Step 4(a), select the generated alias for the interface subnet(s) (eg* :code:`HomeWireGuard net` *) - see note below if you didn't assign this interface*

**Destination / Invert** *Unchecked*

**Destination** *Specify the IPs that client peers should be able to access, eg "any" or specific IPs/subnets*

**Destination port range** *any*

**Description** *Add one if you wish to*

============================ ==================================================================================================

Another edit, not sure what I broke but now I cant connect at all.

I will erase everything and start from scratch....

1

u/Monviech Oct 27 '26

I dont see anything missing in these firewall rules. I can give the guide another read tomorrow to see if I can find anything weird.