OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Virtual private networks »
  • WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
« previous next »
  • Print
Pages: [1]

Author Topic: WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN  (Read 3210 times)

sos_opnsense

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
    • View Profile
WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
« on: March 20, 2021, 05:52:12 am »
I have wireguard set up with a local server (10.1.1.1, DNS 1.1.1.1, port 51820). Pretty standard stuff.

When I added a peer with an allowed IP of '0.0.0.0/0', saved and re-enabled the local wg server, I lost all WAN access across the LAN and firewall itself. In other words, the opnSense router could no longer ping out e.g. 1.1.1.1 times out.

As soon as I remove the peer from the WireGuard server's list of peers, or change the allowed IP to "10.1.1.0/24" and restart wg-0, WAN comes back up.

Bizarre.
« Last Edit: March 20, 2021, 06:14:52 am by sos_opnsense »
Logged
Alder Lake N100
4 x 2.5GbE Intel NIC
16GB, 500GB nvme
OPNsense 24.1_1

Greelan

  • Hero Member
  • *****
  • Posts: 1028
  • Karma: 72
    • View Profile
Re: WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
« Reply #1 on: March 20, 2021, 07:06:06 am »
Why is it bizarre? You are routing everything down the tunnel
Logged

sos_opnsense

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
    • View Profile
Re: WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
« Reply #2 on: March 20, 2021, 07:42:39 am »
No, I'm not connecting to or through the wg tunnel, merely adding a remote peer with a 0.0.0.0/0 available IP to the list of potential wg peers using the web GUI.

I'm not even connecting or activating the tunnel or trying to access WAN through the peer, and yet it's taking out the firewall's access to WAN. As soon as I hit 'save' localhost OPNsense can't ping any WAN address from shell.
« Last Edit: March 20, 2021, 07:46:23 am by sos_opnsense »
Logged
Alder Lake N100
4 x 2.5GbE Intel NIC
16GB, 500GB nvme
OPNsense 24.1_1

stefanpf

  • Jr. Member
  • **
  • Posts: 75
  • Karma: 5
    • View Profile
Re: WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
« Reply #3 on: March 20, 2021, 08:47:58 am »
The routes are added immediately after activating the Wireguard service.
This seems to be logical, since a request must also trigger a connection startup.

But at least with my setup:
- If Wireguard is disabled, no routes are added.
- If a peer is disabled, no routes are added for that peer
Logged

sos_opnsense

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
    • View Profile
Re: WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
« Reply #4 on: March 20, 2021, 10:17:34 am »
Thanks for your replies.

I'll do some more learning so I can try to understand why this is happening when the same values didn't take out my other similar BSD-based firewall running wireguard in an equivalent way.
Logged
Alder Lake N100
4 x 2.5GbE Intel NIC
16GB, 500GB nvme
OPNsense 24.1_1

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
« Reply #5 on: March 20, 2021, 12:05:11 pm »
On the Server side when you add endpoint, only enter the remote Tunnel IP with /32 there. On endpoint itself you can add 0.0.0.0/0 as allowed ip
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

Aerowinder

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
Re: WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
« Reply #6 on: March 25, 2021, 12:12:37 pm »
Quote from: mimugmail on March 20, 2021, 12:05:11 pm
On the Server side when you add endpoint, only enter the remote Tunnel IP with /32 there. On endpoint itself you can add 0.0.0.0/0 as allowed ip

I found this to be super unintuitive with WireGuard. This exact thing caught me at first, too. When shown the correct way to set the configuration, it makes sense. To make things worse, there's a ton of misinformation out there.
Logged

sos_opnsense

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
    • View Profile
Re: WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
« Reply #7 on: March 25, 2021, 09:49:28 pm »
Quote from: Aerowinder on March 25, 2021, 12:12:37 pm
To make things worse, there's a ton of misinformation out there.

Yep, and I think the OPNsense guide for WireGuard has more recently been edited to make the distinction between /24 and /32 endpoints clearer, for example.

Anyway, all up and running now, thanks all.
Logged
Alder Lake N100
4 x 2.5GbE Intel NIC
16GB, 500GB nvme
OPNsense 24.1_1

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Virtual private networks »
  • WireGuard - adding peer with 0.0.0.0/0 causes loss of WAN
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2