OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 20.7 Legacy Series »
  • Wireguard site-to-site from OPNSense to other wireguard server
« previous next »
  • Print
Pages: [1]

Author Topic: Wireguard site-to-site from OPNSense to other wireguard server  (Read 2835 times)

Bytechanger

  • Full Member
  • ***
  • Posts: 240
  • Karma: 0
    • View Profile
Wireguard site-to-site from OPNSense to other wireguard server
« on: January 20, 2021, 09:36:44 am »
Hi,

I want to connect my OPNSense-Wireguard as "vpn-client" to an other wireguard-server.
I´ve aleready read wireguard docu site to site, but it doesn´t work.

This ist my config file, on windows-wireguard-connector it runs perfectly
Now I want to connect with OPNSense to the server
Code: [Select]
[Interface]
ListenPort = 55522
PrivateKey = pv123
Address = 10.100.100.37/31

[Peer]
PublicKey = pub123
EndPoint = XX.XX.XX.XX:55522
AllowedIPs = 10.1.3.0/24
PersistentKeepalive = 10

I created at Local->Server:
Code: [Select]
Public Key    pub123 (Key from Config file)
Private Key   pv123   (Key from Config file)
ListenPort     55522
TunnelAddress 10.100.100.37/31
Peers              MyPeer

I created at Endpoints:
Code: [Select]
Name       MyPeer
PublicKey  pub123 (Key from Config file)
Allowed IPs 10.1.3.0/24
Endpoint Address  XX.XX.XX.XX:55522
Enpoint Port          55522
Keepalive 10

But it doesn´t work...

On Firewall I set Rule Wireguard pass all

Pls help.


Greets

Byte
Logged

Gauss23

  • Hero Member
  • *****
  • Posts: 766
  • Karma: 39
    • View Profile
    • BackendMedia
Re: Wireguard site-to-site from OPNSense to other wireguard server
« Reply #1 on: January 20, 2021, 10:42:13 am »
Do you see any traffic on that connection?
Are there any handshakes in VPN: WireGuard in the tab Handshakes?
Logged
„The S in IoT stands for Security!“ :)

Bytechanger

  • Full Member
  • ***
  • Posts: 240
  • Karma: 0
    • View Profile
Re: Wireguard site-to-site from OPNSense to other wireguard server
« Reply #2 on: January 20, 2021, 10:50:48 am »
Nope,

Handshakes:
Code: [Select]
wg1 pub123 0

List Configuration
Code: [Select]
interface: wg1
  public key: anohter pubkey!
  private key: (hidden)
  listening port: 55522

peer: pub123
  endpoint: XX.XX.XX.XX:55522
  allowed ips: 10.1.3.0/24
  transfer: 0 B received, 3.76 KiB sent
  persistent keepalive: every 10 seconds

All Howtos I saw was to set site2site to OPNSense and nothing got config to set on ONE OPNSense.
An Wireguard-Server I can´t set anything.

Greets

Byte
Logged

Gauss23

  • Hero Member
  • *****
  • Posts: 766
  • Karma: 39
    • View Profile
    • BackendMedia
Re: Wireguard site-to-site from OPNSense to other wireguard server
« Reply #3 on: January 20, 2021, 11:04:58 am »
Did you enable the WireGuard service in the general tab?
Do you allow traffic on the WAN interface to the WireGuard port?
Logged
„The S in IoT stands for Security!“ :)

Bytechanger

  • Full Member
  • ***
  • Posts: 240
  • Karma: 0
    • View Profile
Re: Wireguard site-to-site from OPNSense to other wireguard server
« Reply #4 on: January 20, 2021, 11:21:42 am »
Wireguard is enabled, I have a second wireguard server running on OPNSense as roadwarrior, this works fine.

And NO I don´t want allow Traffic over WAN to THIS wireguard, because it´s should be a wireguard client!

Traffic should go OUT over WAN to Wireguard-server and backwards it´s allowed by default (stateless firewall).
So when I start wireguard on my desktop-pc, I don´t have to open a WAN port to get a connection, it´s an outgoing connection.

OPNSense should connect AS CLIENT to the wireguard server on the other side!


Greets

Byte
« Last Edit: January 20, 2021, 11:24:03 am by Bytechanger »
Logged

Bytechanger

  • Full Member
  • ***
  • Posts: 240
  • Karma: 0
    • View Profile
Re: Wireguard site-to-site from OPNSense to other wireguard server
« Reply #5 on: January 20, 2021, 12:03:18 pm »
OK,
looking at the intern config of wireguard in OPNSense looks good:

Code: [Select]
sudo cat ls /usr/local/etc/wireguard/wg1.conf

[Interface]
Address = 10.100.100.37/31
ListenPort = 55522
PrivateKey = pv123

[Peer]
PublicKey = pub123
AllowedIPs = 0.1.3.0/24
Endpoint = XX.XX.XX.XX:55522
PersistentKeepalive = 10
Logged

Gauss23

  • Hero Member
  • *****
  • Posts: 766
  • Karma: 39
    • View Profile
    • BackendMedia
Re: Wireguard site-to-site from OPNSense to other wireguard server
« Reply #6 on: January 20, 2021, 12:24:09 pm »
You should see traffic leaving your OPNsense box then. Have a look in the Firewall: Log Files: Live View

There should be traffic towards the endpoint you defined. It should be covered by the "Let out anything from firewall host itself".
Logged
„The S in IoT stands for Security!“ :)

chemlud

  • Hero Member
  • *****
  • Posts: 2488
  • Karma: 112
    • View Profile
Re: Wireguard site-to-site from OPNSense to other wireguard server
« Reply #7 on: January 20, 2021, 02:05:59 pm »
Mildyl OT, but is "PersistentKeepalive = 10" the standard used by opnsense?

Logged
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

dmmincrjr

  • Newbie
  • *
  • Posts: 12
  • Karma: 1
    • View Profile
Re: Wireguard site-to-site from OPNSense to other wireguard server
« Reply #8 on: January 20, 2021, 08:13:21 pm »
Make sure you don't have any other site to site VPN's enabled while trying to get this to work between the sites. I had an OpenVPN vpn between the two sites up while trying to get this to work and no traffic would pass through the Wireguard VPN. Once I disabled the OpenVPN vpn everything worked.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 20.7 Legacy Series »
  • Wireguard site-to-site from OPNSense to other wireguard server
 

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