OPNsense Forum

International Forums => Italian - Italiano => Topic started by: pierinhood on February 21, 2020, 05:54:55 PM

Title: Site2Site wireguard su OPNSense
Post by: pierinhood on February 21, 2020, 05:54:55 PM
Buongiorno ragazzi,

ho un problema che mi sta facendo impazzire e spero vivamente che qualcuno sappia indirizzarmi verso la soluzione.
Sto eseguendo dei test per implementare una VPN site2site con OPNSense e wireguard.

Allego un disegno per comodità:

https://ibb.co/dtDNJxc

Il primo firewall è OPNSense, il secondo è una macchina debian 10.
La rete interna dietro OPNSense vede tranquillamente la rete interna dietro il router con Debian 10.
Ho abilitato tutto il traffico sull'interfaccia wireguard su OPNSense

Dov'è il problema?
Ho creato sulla configurazione Wireguard su OPNSense un secondo Peer che consente la connessione da parte del client connesso con ip wireguard 10.80.80.3
Tale client vede la rete interna dietro l'OPNSense ma non vede la rete interna dietro Debian 10

Per una migliore comprensione, allego configurazioni:

OPNSense router:

interface: wg0
  public key: EqPshBAZRv89dMd2jW7Ow1Llnz+FrUTSU8kHFZKF2Fc=
  private key: (hidden)
  listening port: 51820

peer: OqA+fX8D43Kzgk6ShnNKayS2CGe834p6Lh8+PU1mES8=
  endpoint: 172.20.1.201:51820
  allowed ips: 10.80.80.2/32, 172.31.1.0/24

peer: FLkclZEuUG0zq5lB1K59Bf2IOjlbmmAA1AXLHYQqWiw=
  allowed ips: 10.80.80.3/32



Debian 10 router

[Interface]
PrivateKey = <hidden>
ListenPort = 51820
Address = 10.80.80.2/24

[Peer]
Endpoint = 172.20.1.200:51820
PublicKey = EqPshBAZRv89dMd2jW7Ow1Llnz+FrUTSU8kHFZKF2Fc=
AllowedIPs = 10.80.80.1/32, 10.0.0.0/24, 10.80.80.2/32


Client

[Interface]
PrivateKey = <hidden>
Address = 10.80.80.3/24

[Peer]
PublicKey = EqPshBAZRv89dMd2jW7Ow1Llnz+FrUTSU8kHFZKF2Fc=
AllowedIPs = 10.80.80.0/24, 172.31.1.0/24, 10.0.0.0/24
Endpoint = 172.20.1.200:51820


Chiaramente sono a disopsizione per rilasciare altre info che possano essere utili.

PS Di seguito le regole di routing sul router Debian 10:

iptables --table nat --append POSTROUTING --out-interface enp0s3 -j MASQUERADE
iptables --table nat --append POSTROUTING --out-interface wg0 -j MASQUERADE
iptables --append FORWARD --in-interface enp0s8 -j ACCEPT

Grazie per il supporto.