Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Z0idberg

#1
I finally got it solved:

In the outbound NAT rule, I accidently had as source "any" instead of "WG net".

Now everything seems to work flawlessly.

That gave me such headakes...
#2
Ah, you mean I should use a separate rule? I disabled "reply-to" completely in the firewall advanced settings. So, an additional rule is still needed?

Just for clarification: When you talk about WAN, you really mean WAN? Because the traffic should be routet through WG (wireguard net). And as far as I can tell, this works more or less fine probably with the execption of the "reply-to" topic.

Another clarification: You think this problem is on the OPNSense side? Because from the second network to the OPNSense network all traffic and connections are fine. Also the connection from the OPNSense network to the specific wg-client works perfectly fine. Only connections from the OPNSense network to a client that is routed through the wg-client (raspi) does not work.

To me (and my very limited kowledge) this sounds to me that something like the reply-to policy is not working properly on the raspi in the second network rather on the OPNSense?

Sorry for the thousand questions and clarifications. I am still far from being an expert in these topics :(
#3
Indeed this sounds like this problem.

As transfer from the network b to network a (with opnsense as fw) works well, but the other way round does not work, where do I have to change things?

I disabled the reply-to rule in the opnsense as indicated in the link, but it does not work.

To my pretty limited knowledge that also should not work, because the issue that the answer is going a different route is on the side of network b (the one without opnsense). Does that sound right?

And if so, do you have any idea where to start to fix this? Is there something in iptables to change?
#4
The raspi is connected to a router (fritzbox) as LAN device. The raspi connects to the OPNSense through WAN.

The VPN connection itself works.

Just transfer of larger files in one direction does not work, like: linux machine -> opnsense (network a) -> wg tunnel through WAN -> router network b (fritzbox) -> raspi (wg client) -> other linux machine.

The same transfer in exactly the opposite direction works fine.

Maybe as a note: I did not do any fort forwarding in the network b. So far, I thought that is not needed.
#5
Hi everyone,

I am not completely sure whether this topic belongs here, as it is probably not the fault of the wireguard.

I have the following issue:

I connected two local networks through wireguard. Network A has OPNSense and the "wg-server". Network B has a raspberry pi behind a router with the "wg-client" and iptables to route the traffic.

One key thing I want to do with this setup is to push backups through rsync in both directions.

The basics work well: traffic is routed (I think) correctly in both directions. I can reach the machines in both networks from both sides. But one thing just does not want to work...

Here the problem:

I can backup with rsync from Network B to network A - no problem. I also can use rsync to backup from Network A to the raspberry pi in network B.

But:

  • I cannot use rsync to transfer the backup from network A to the synology box or any other pc in network B.
  • It only transfers tiny files (like a few KB), but any larger file will not be transferred and rsync gets stuck and eventually times out.
  • Also a NFS share can be mountet, but larger files cannot be transferred.
  • This I tried with multiple machines on both networks - no luck, unless the target is the raspberry pi itself.
Thus, I suspect iptables to be the bad guy here.

Any suggestions to fix this would be really appreciated. Also I do not find any really helpful log messages that could indicate the problem. Therefore, hints to track down the issue would already be very helpful.

Thank you so much in advance!

Best,

Thorsten

#6
German - Deutsch / Re: Netzwerke per Wireguard verbinden
December 21, 2020, 01:16:49 PM
Ich bin nun ein gutes Stück weiter:

192.168.2.0/24 als allowed ip beim local endpoint in OPNSense und im Pi eingetragen.

Nun klappt das Routing erstmal wie es soll. Ich kann aus dem Netzwerk A auf das Netzwerk B nun auch zugreifen.

Jetzt kommt aber eine neue seltsame Sache:

Dienste zum Datenaustausch funktionieren nicht: rsync oder NFS Shares hängen nach kurzer Zeit (ein paar Sekunden).

Mal wieder gleiches Spiel: Aus Netzwerk B in Richtung Netzwerk A ist alles ok.

Irgend eine Idee? Firewall zeigt soweit ich das sehen kann nichts auffälliges. Auch geht ja die prinzipielle Erreichbarkeit der Dienste, nur scheint es sehr schnell einen Timeout zu geben...

Nochmal vielen Dank für Ideen :)
#7
German - Deutsch / Re: Netzwerke per Wireguard verbinden
December 17, 2020, 08:53:39 PM
Ja, habe den Haken hier wieder weg gemacht. Bzw. es sowohl mit als auch ohne probiert.

Kein Erfolg...

Was mit nur aufgefallen ist: Wenn ich meine eigene Route nach 192.168.2.xx deaktiviere und nur die von WG automatisch erstellte drin lassen, dann geht er über WAN Richtung 192.168.2.xx, was natürlich nicht klappt.

Also Interface assigned: Ich denke Du meinst beim Gateway, oder? Da habe ich WG assigned. Aber auch mal LAN probiert, aber dann war WG auf dem Rasperry Pi tot...
#8
German - Deutsch / Re: Netzwerke per Wireguard verbinden
December 17, 2020, 07:01:49 PM
Habe ich jetzt auch probiert. Ändert aber auch nix.

Gibt es denn einen guten Weg herauszufinden, ob er überhaupt die Route nutzt, die ich definiert habe?

Traceroute zeigt nur an, dass er über den OPNSense geht und dann ist die Verbindung tot.

Der Pi im Netzwerk B zeigt auch keinen eingehenden Traffic an. Die Firewall lässt alles raus.

Irgend eine Idee wie ich zumindest etwas weiter eingrenzen kann, woran es liegt?
#9
German - Deutsch / Re: Netzwerke per Wireguard verbinden
December 17, 2020, 12:54:58 PM
Anbei Screenshots von der Server-Config und dem Endpoint für den Pi.

Vielleicht noch zu den Allowed IPs: Wenn ich 192.168.2.0/24 auf dem Pi eingetragen hatte, war der Pi nicht mehr erreichbar aus dem lokalen Netzwerk, weil es wohl den Traffic zu 192.168.2.xx über WG geroutet hatte.

PS: Auf der Serverseite hatte ich Disable routes aktiviert und deaktiviert gehabt. Scheint keinen Einfluss zu haben.
#10
German - Deutsch / Re: Netzwerke per Wireguard verbinden
December 17, 2020, 12:01:15 PM
Ich habe im Netzwerk B auf der Fritzbox eine statische Route eingerichtet: 192.168.178.0/24 geht durch den Pi (192.168.2.49) der es durch 10.0.0.5 zu 10.0.0.1 (OPNSense in Netzwerk A) routet.

Das klappt auch problemlos! Also in die Richtung ist alles super. Auch von jedem beliebigen Gerät des Netzwerks.

Nur andersherum: Netzwerk A zu Netzwerk B funktioniert nicht. Weder von irgend einem Gerät im Netzwerk oder nicht mal vom OPNSense selber.

Es scheint so zu sein, dass OPNSense die Route nicht richtig übernimmt. Wenn ich Traceroute 192.168.2.xx verwende geht es zum OPNSense und dann ist es tot. Er zeigt auch nicht, dass es überhaupt zu 10.0.0.5 geht, wie es eingestellt ist.

Hoffe das ist verständlich was ich hier so tippe  :)
#11
German - Deutsch / Netzwerke per Wireguard verbinden
December 16, 2020, 11:56:28 PM
Hallo zusammen,

ich bin schon seit einiger Zeit auf der Suche nach einer Lösung, aber bis jetzt hat nichts funktioniert. Daher wende ich mich an Euch mit der etwas verzweifelten Hoffnung auf Hilfe  :-\

Hier die Beschreibung des Problems


Ziel: Zwei Netzwerke über Internet und Wireguard zusammenschalten und so es zu erlauben, dass man aus Netzwerk A auf Netzwerk B zugreifen kann und andersherum

Setup:

Netzwerk A:

  • OPNSense auf Proxmox incl. Wireguard-Plugin agiert als WG Server
  • IP Range für WG: 10.0.0.1/24
  • IP Range für Netzwerk: 192.168.178.0/24

Netzwerk B:

  • Raspberry Pi hinter Fritzbox als WG client
  • IP Range für Netzwerk: 192.168.2.0/24
  • Netzwerkadresse des Pi 192.168.2.49 und WG Adresse 10.0.0.5

OPNSense config:

  • Gateway ist 10.0.0.5 (der Pi im Netzwerk B) und als interface WG0
  • Static Route für 192.168.0.2/24 nutzt den Gateway
  • Outbound NAT (aktiviert und deaktiviert proviert): Source any mit interface und NAT Adress WG zu 192.168.2.0/24

WG Client config auf Raspberry Pi in Netzwerk B:

[Interface]
Address = 10.0.0.5/24
ListenPort = 51820
PrivateKey = xxx
DNS = 192.168.178.2, 192.168.2.1

PostUp = iptables -t nat -A POSTROUTING -o wg0 -j MASQUERADE; iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j A>
PostDown = iptables -t nat -D POSTROUTING -o wg0 -j MASQUERADE; iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j>

[Peer]
PublicKey = xxx
AllowedIPs = 192.168.178.0/24, 10.0.0.0/24
Endpoint = xxx.dyndns.org:51820
PersistentKeepalive=25

Status und Problem:
Aus Netzwerk B kann ich Netzwerk A perfekt erreichen. Hier funktioniert alles wie es soll. Nur aus Netzwerk A kann ich Netzwerk B  nicht erreichen. Ich kann auch einfach nicht nachvollziehen, ob die definierte Route überhaupt verwendet wird. Auch kann 10.0.0.1 (OPNSense in Netzwerk A) 10.0.0.5 (Pi in Netzwerk B, der den Gateway geben soll) erreichen, nur scheint OPNSense den nicht als Gateway zu verwenden.

Falls Ihr mehr Infos braucht, sagt gerne Bescheid.

Ich würde mich über jeden Input und jede Hilfe freuen!  :)


Vielen Dank und viele Grüße

Thorsten