Openvpn client Netz ereichbar machen
Guten Tag ich bin neu hier!
Habe des öfteren schon hier im Forum mitgelesen und bin begeistert.
Jetzt möchte ich mich mit einen Problem direkt an Euch wenden!
Ich verwende für unsere Familie Openvpn damit wir auf unsere Daten von überall zugreifen könnten.
Ich habe in meiner Wohnung eine Nas die ich gerne auch zu unseren openvpn Netz ankoppeln möchte.
Leider ist diese nas nicht Openvpn tauglich. Da dachte ich mir ich nehme einen Raspberry und nutze diesen als biligen Stromsparenden Adabter.
Nun habe ich zwar zugriff auf Raspberry aber nicht auf das Netzwerk wo auch die Nas sitzt.
Ich habe im CCD File mit iroute das Netzwerk dem Openvpn Server mitgeteilt und mit route auf dem Server Das clientnetz auch eingetragen.
Fakt ist ich kann von jeder beliebigen Client einen Ping auf den Raspberry machen(client Netz) jedoch nicht zur Nas!
Mein verdacht ist das ich auf dem Raspberry irgend eine config noch fehlt
Was sagt ihr? Was mache ich falsch?
Lg
Habe des öfteren schon hier im Forum mitgelesen und bin begeistert.
Jetzt möchte ich mich mit einen Problem direkt an Euch wenden!
Ich verwende für unsere Familie Openvpn damit wir auf unsere Daten von überall zugreifen könnten.
Ich habe in meiner Wohnung eine Nas die ich gerne auch zu unseren openvpn Netz ankoppeln möchte.
Leider ist diese nas nicht Openvpn tauglich. Da dachte ich mir ich nehme einen Raspberry und nutze diesen als biligen Stromsparenden Adabter.
Nun habe ich zwar zugriff auf Raspberry aber nicht auf das Netzwerk wo auch die Nas sitzt.
Ich habe im CCD File mit iroute das Netzwerk dem Openvpn Server mitgeteilt und mit route auf dem Server Das clientnetz auch eingetragen.
Fakt ist ich kann von jeder beliebigen Client einen Ping auf den Raspberry machen(client Netz) jedoch nicht zur Nas!
Mein verdacht ist das ich auf dem Raspberry irgend eine config noch fehlt
Was sagt ihr? Was mache ich falsch?
Lg
Please also mark the comments that contributed to the solution of the article
Content-Key: 312555
Url: https://administrator.de/contentid/312555
Printed on: April 23, 2024 at 12:04 o'clock
33 Comments
Latest comment
Hi
as simple as adding a static route to the OpenVPN network on your default gateway of your LAN (router).
Otherwise the packets don't find it's way back to the VPN-Clients!
Also be sure that IP-Forwarding is enabled on your raspi.
For running system
For permanent activation
Alternative for this is to masquerade (SRC-NAT) traffic on the OpenVPN-Server which leaves the tunnel, but routing should always be preferred if possible.
Regards
as simple as adding a static route to the OpenVPN network on your default gateway of your LAN (router).
Network : 10.0.8.x/24 (replace with your OVPN Network and Mask)
Gateway : 192.168.?.? (LAN IP of your raspberry)
Also be sure that IP-Forwarding is enabled on your raspi.
For running system
sudo echo 1 >/proc/sys/net/ipv4/ip_forward
sudo nano /etc/sysctl.conf
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
Alternative for this is to masquerade (SRC-NAT) traffic on the OpenVPN-Server which leaves the tunnel, but routing should always be preferred if possible.
Regards
Zitat von @schlamp:
Also die IP von meinem OPENVPN Server ist 10.98.0.1 die VPN Ip des Raspberry ist 10.98.113.1 und die Ip im localem Netz ist 192.168.20.16
Also muss ich in meinem Router (Netgear D500) folgendes einstellen
ist das richtig?
No it's not, target (destination) network is the internal OpenVPN Network (10.98.0.0/24) and the GW IP is the 192.168.20.16(Raspi in your LAN)Also die IP von meinem OPENVPN Server ist 10.98.0.1 die VPN Ip des Raspberry ist 10.98.113.1 und die Ip im localem Netz ist 192.168.20.16
Also muss ich in meinem Router (Netgear D500) folgendes einstellen
> Destination IP Address 192.168.20.16
> IP Subnet Mask 255.255.255.0
> Gateway IP Address 10.98.0.1
> Metric 10
>
ist das richtig?
Be sure to enter a network address as destination, not a single host ip !!
Du meinst also umgekehrt?
Correct, but enter a network address! .0 at the end for the destination:Destination Network : 10.98.0.0
Netmask: 255.255.255.0
Gateway: 192.168.20.16
the clients in your net don't know anything about your VPN network so this route makes sure that your router knows where to find this network -> on your raspberry , so that the packets find their way back to the VPN, simple routing knowledge.
Then you are telling us something wrong ...
Destination is always your internal OpenVPN Network-Address and the gateway is the host where the OpenVPN-Server is located in your LAN!!! Works a 100%.
Draw us a picture what is what please ...
Destination is always your internal OpenVPN Network-Address and the gateway is the host where the OpenVPN-Server is located in your LAN!!! Works a 100%.
Draw us a picture what is what please ...
Draw us a picture of your network with the IPs of your devices please!
You're not using the right terms for your devices and we cannot see your infrastructure
You're not using the right terms for your devices and we cannot see your infrastructure
And please read the basics to understand what you're doing:
OpenVPN Server installieren auf pfSense Firewall, Mikrotik. DD-WRT oder GL.inet Router
You simply have to make sure that packets in the target LAN find its way back, so the LAN where the OpenVPN Server resides needs a static route on the gateway which points to the OpenVPN-Server. if you understand this you know what to do and why the static route is needed !!!
OpenVPN Server installieren auf pfSense Firewall, Mikrotik. DD-WRT oder GL.inet Router
You simply have to make sure that packets in the target LAN find its way back, so the LAN where the OpenVPN Server resides needs a static route on the gateway which points to the OpenVPN-Server. if you understand this you know what to do and why the static route is needed !!!
It's like I said above. Otherwise your router is configured incorrectly has a Bug or you are on the wrong page...or entering false information.
ehh, your OpenVPN IP network is not the one you told us ....on the picture it's 10.99.113.0 ?????
And your router and Raspi have the same IP??? that doesn't work
And your router and Raspi have the same IP??? that doesn't work
Like I said your openVPN network IPs on your first picture and on this thread doesn't match ???
Second: if the router doesn't accept such a static route, it has a bug (Netgear: really no wonder ...), go and get a better one, or directly enter the route on your NAS
Otherwise take the alternative with masquerading on the raspi in my first post.
See the tutorial posted above.
Good luck.
Bye
Second: if the router doesn't accept such a static route, it has a bug (Netgear: really no wonder ...), go and get a better one, or directly enter the route on your NAS
Otherwise take the alternative with masquerading on the raspi in my first post.
See the tutorial posted above.
Good luck.
Bye
OK so you are instead using a 255.255.0.0 mask in your OpenVPN network (why?) when the IPs are correct
so
If this is not accepted by your router i have an idea, perhaps this old hardware uses and forces the old private subnet class model where the 10.x.x.x net was a CLASS C network with a mask of 255.0.0.0.
If this would be the case try these settings, to route the whole 10.x.x.x net to the raspi:
If this is also not accepted it definitely has a bug !!
If you only want to reach the NAS , you could also put the static route directly onto the NAS itself.
so
Destination 10.98.0.0
Mask 255.255.0.0
Gateway 192.168.20.16
If this would be the case try these settings, to route the whole 10.x.x.x net to the raspi:
Destination 10.0.0.0
Mask 255.0.0.0
Gateway 192.168.20.16
If you only want to reach the NAS , you could also put the static route directly onto the NAS itself.
Hallo,
Poste deine Bilder bitte direkt hier ins Forum Das Icon links neben deiner Kommentare ist doch nicht zu übersehen. Formatting instructions in the posts
Destination IP: dein Ziel Netz (Netze haben immer eine 0 am ende) 10.98.0.0
Subnet Mask: deine gwählte Maske 255.255.255.0
Gateway: Dein Raspberry 192.168.20.3
Warum dein Raspberry PI nicht selbst dein VPN Server macht wird uns wohl ein Rätsel bleiben. Viel Komplizierter geht es kaum.
Gruß,
Peter
Poste deine Bilder bitte direkt hier ins Forum Das Icon links neben deiner Kommentare ist doch nicht zu übersehen. Formatting instructions in the posts
Kann es wirklich sein das mein Netgear Router einen Bug hat?
Selbst NetGear weiß das Routen immer zu Netzen - selten zu IPs gemacht werden. Daher hinterfrage warum dort (NetGear Menü) nur ein IP zulässig erscheint (aber nicht zwingend ist). Seite 75 deines Handbuchs hat auch ein valides Beispiel: http://www.downloads.netgear.com/files/GDC/D500/D500-D1500_UM_22Aug2014 ...Destination IP: dein Ziel Netz (Netze haben immer eine 0 am ende) 10.98.0.0
Subnet Mask: deine gwählte Maske 255.255.255.0
Gateway: Dein Raspberry 192.168.20.3
Warum dein Raspberry PI nicht selbst dein VPN Server macht wird uns wohl ein Rätsel bleiben. Viel Komplizierter geht es kaum.
Gruß,
Peter
Have you read my other comments in my very first post ?
IP-Forwarding on your raspberry must be enabled and your OpenVPN-Server also needs to know where the 20.x Subnet is reachable so it must have a route to the raspberry.
IP-Forwarding on your raspberry must be enabled and your OpenVPN-Server also needs to know where the 20.x Subnet is reachable so it must have a route to the raspberry.
Man muss sich wirklich manchmal fragen wie groß die Tomaten sein müssen auf den Augen um die Bilder Upload Funktion hier zu übersehen. Jeder Erstklässler erkennt das anstatt sinnlose Extraklicks auf Google zu erzwingen...
Zurück zum Thema.
Du kannst das nur lösen mit einer LAN zu LAN Kopplung des RasPi sprich indem du dem Server ein ip route Kommando konfigurierst auf das 192.168.20.0er Netz, so das Clients im VPN Netz wissen das Pakete für dieses Netz auch in den Tunnel geroutet werden.
route print zeigt dir an ob es richtig konfiguriert ist.
Zusätzlich natürlich die statische Route in deine Netgear Router.
Mit der Distribution der 192.168.20er Route im VPN Netz klappt das dann auch Anhieb.
Zurück zum Thema.
Du kannst das nur lösen mit einer LAN zu LAN Kopplung des RasPi sprich indem du dem Server ein ip route Kommando konfigurierst auf das 192.168.20.0er Netz, so das Clients im VPN Netz wissen das Pakete für dieses Netz auch in den Tunnel geroutet werden.
route print zeigt dir an ob es richtig konfiguriert ist.
Zusätzlich natürlich die statische Route in deine Netgear Router.
Mit der Distribution der 192.168.20er Route im VPN Netz klappt das dann auch Anhieb.
We never told you this ! I told you to create a static route to your raspi (which is the local gateway to your VPN network) with the subnet the VPN Clients are using internally.
Wireshark, or a little bit thinking how the packets are traveling, would have told you this too
Wireshark, or a little bit thinking how the packets are traveling, would have told you this too
Ziemlich traurig, denn Englisch ist in der IT ja nun mal die Lingua Franca wie jeder weiß und das zu verstehen sollten die Grundschulkenntnisse reichen, die ja nun mal jeder haben sollte.. !
Was will man erwarten wenn schon das Erkennen eines Kamerasymbols zum Problem wird. (Man kann das übrigens noch nachträglich anpassen mitt ... und Bearbeiten) Aber egal...andere Baustelle ! Zurück zum Thema.
Letztlich steht dadrin das du sowohl die statische Route im Router auf das RasPi VPN Netzdefinieren musst als auch die Route aus dem Client Netz mit dem zusätzlichen iroute... oder route Kommando im OVPN Setup distribuieren musst !!
route 192.168.20.0/24 in der Server Konfig solte reichen.
Wie gesagt sieh dir immer die Routing Tabelle im Client UND im Server an damit du weisst wo und wie diese Routen bekannt sind.
Bei unixoiden OS ist das netstat -r -n bzw. auch ip route show und bei Winblows route print.
Das sagt dir ob diese Zielnetze auf der einen oder anderen Seite bekannt sind.
Was will man erwarten wenn schon das Erkennen eines Kamerasymbols zum Problem wird. (Man kann das übrigens noch nachträglich anpassen mitt ... und Bearbeiten) Aber egal...andere Baustelle ! Zurück zum Thema.
Letztlich steht dadrin das du sowohl die statische Route im Router auf das RasPi VPN Netzdefinieren musst als auch die Route aus dem Client Netz mit dem zusätzlichen iroute... oder route Kommando im OVPN Setup distribuieren musst !!
route 192.168.20.0/24 in der Server Konfig solte reichen.
Wie gesagt sieh dir immer die Routing Tabelle im Client UND im Server an damit du weisst wo und wie diese Routen bekannt sind.
Bei unixoiden OS ist das netstat -r -n bzw. auch ip route show und bei Winblows route print.
Das sagt dir ob diese Zielnetze auf der einen oder anderen Seite bekannt sind.
Hallo,
Meine übersetzung:
Ich hoffe es korrekt wiedergegeben habe
Hättest du einen VPN Server auf dein Raspi gemacht, hättest du diese Probleme nicht gehabt nur um an dein NAS im Lokalen LAN zu kommen...
Gruß,
Peter
Zitat von @schlamp:
Leider verstehe ich nur einen Bruchteil von dem was du schreibst! (google translate ist für solche spezifischen sachen zu schwach)
Schon mal andere Übersetzer versucht? Und ja, alleine schon der erste Satz lässt google translate schwach aussehenLeider verstehe ich nur einen Bruchteil von dem was du schreibst! (google translate ist für solche spezifischen sachen zu schwach)
Meine übersetzung:
Wir haben dir dies niemals gesagt! Ich sagte dir du sollst eine Statische Route zu dein Raspi (welches das Lokale Gateway zu dein VPN Netzwerk darstellt) mit dem Subnetz welche deine internen VPN Clients nutzen erstellen.
Wireshark, oder ein wenig nachdenken wie die Pakete laufen, hätten dir es ebenfalls gesagt.
Ich hoffe es korrekt wiedergegeben habe
Hättest du einen VPN Server auf dein Raspi gemacht, hättest du diese Probleme nicht gehabt nur um an dein NAS im Lokalen LAN zu kommen...
Gruß,
Peter
Hallo,
[1/2 OT]
Bilder: Formatting instructions in the posts
Grüner Balken: How can I mark a post as solved?
[End 1/2 OT]
Gruß,
Peter
Zitat von @schlamp:
Da aber alle meine Familien Mitglieder auch eine Nas haben und man ja nicht ständig auf andere Vpn Netze einloggen will ist das aus meiner Sicht die bessere Lösung!
Es gibt auch Benutzernamen und Passwörter um das zu regeln....Da aber alle meine Familien Mitglieder auch eine Nas haben und man ja nicht ständig auf andere Vpn Netze einloggen will ist das aus meiner Sicht die bessere Lösung!
[1/2 OT]
Ps Normalerweise wird man in Foren begrüßt
Nett gebrüllt kitty, dann solltest du aber erst noch deine Bilder hier direkt ins Forum reinstellen und am ende noch einen grünen Balken spenden. Die von dir durchgelesenen und zugestimmten Forenregeln sind ja schließlich in Deutsch Bilder: Formatting instructions in the posts
Grüner Balken: How can I mark a post as solved?
[End 1/2 OT]
Gruß,
Peter