Fast and easy connection with WireGuard - Mit WireGuard schnelle und einfache Verbindung
EN
Hello dear community,
A while ago, I treated myself to a new PC, which I reported on. Now I had to set everything up again, piece by piece.
What I hadn't felt like doing until now, because it wasn't so easy back then (without AI), was to establish an OpenVPN connection to a server. I have a database running there that I can only access internally, i.e., no access from external IPs.
OpenVPN allowed me to establish a connection and create a shared network, giving me access to the database via an IP such as 10.0.0.1.
At the time, I shared the database with other people, but that is no longer necessary.
It's not difficult to set up OpenVPN, especially if you know what you're doing. But you have to manually create certificates for the server and for the user. It was a bit time-consuming to set it up for everyone so that it worked for everyone.
I had already figured that simply taking the old files from my PC wouldn't work.
Of course not, the new OpenVPN version gave me errors. And Chat GPT also told me to create new certificates.
I didn't feel like doing that, especially since I was afraid that I wouldn't even be able to access it from my old PC anymore.
So I needed an alternative, and Chat GPT suggested WireGuard.
The setup was super easy, just install it on both devices.
Click on “Add Tunnel” at the bottom, then on “Add an empty tunnel.”
A key pair is generated immediately, with the public key at the top and the private key at the bottom.
But you still need to make a few settings:
PC
[Interface]
PrivateKey = PrivateKeyPC
Address = 10.0.0.2/24
[Peer]
PublicKey = PublicKeyServer
AllowedIPs = 10.0.0.1/32
Endpoint = 192.198.177.199:51820 <-IP address of the server
PersistentKeepalive = 25
Server:
[Interface]
PrivateKey = PrivateKeyServer
ListenPort = 51820
Address = 10.900.1/24
[Peer]
PublicKey = PublicKeyPC
AllowedIPs = 10.0.0.2/32
That's it, it worked perfectly.
Please note that you can also use a domain that refers to the server instead of the IP, but then you won't be able to access this domain from your PC because it runs in an endless loop.
You could get around this by using different settings, but I simply entered the IP.
DE
Hallo liebe Community,
ich hatte mir vor einiger Zeit einen neuen PC gegönnt, worüber ich berichtet hatte. Da musste ich nun Stück für Stück wieder alles einrichten.
Worauf ich bisher keine Lust hatte, weil es damals nicht so einfach war (ohne KI), war eine OpenVPN Verbindung zu einem Server herzustellen. Ich habe da eine Datenbank laufen, auf die ich nur Intern Zugriff habe, also kein Zugriff von externen IPs.
Durch Open VPN konnte ich eine Verbindung herstellen und ein gemeinsames Netzwerk schaffen, sodass ich dann über eine IP wie z.B. 10.0.0.1 Zugriff auf die Datenbank hatte.
Damals noch mit weiteren Personen die Datenbank geteilt , was aber inzwischen nicht nötig ist.
Schwer ist es nicht OpenVPN einzurichten, vor allem wenn man sich damit auskennt. Aber man muss manuell Zertifikate erstellen und das für Server und für den User. War schon etwas aufwendig für alle es einzurichten, damit es dann für alle klappte.
Ich hatte mir schon gedacht, dass es nicht klappen wird, einfach die alten Dateien von meinem PC zu nehmen.
Natürlich nicht, die neue OpenVPN Version gab mir Fehler aus. Und Chat GPT sagte mir auch, ich solle neue Zertifikate erstellen.
Darauf hatte ich keine Lust, vor allem hatte ich Angst, dass ich dann nicht mal mehr von meinem alten PC drauf zugreifen könnte.
Daher musste eine alternative her und Chat GPT schlug mir WireGuard vor.
Die Einrichtung war mega einfach, einfach auf beiden Geräten installieren.
Unten auf "Tunnel hinzufügen" dann auf "Einen leeren Tunnel hinzufügen"
Es wird direkt ein Schlüsselpaar erzeugt, oben steht der öffentliche und unten der private Schlüssel.
Aber man muss noch ein paar Einstellungen vornehmen:
PC
[Interface]
PrivateKey = PrivaterSchlüsselPC
Address = 10.0.0.2/24
[Peer]
PublicKey = ÖffentlicherSchlüsselServer
AllowedIPs = 10.0.0.1/32
Endpoint = 192.198.177.199:51820 <-IPadresse des Servers
PersistentKeepalive = 25
Server:
[Interface]
PrivateKey = PrivaterSchlüsselServer
ListenPort = 51820
Address = 10.900.1/24
[Peer]
PublicKey = ÖffentlicherSchlüsselPC
AllowedIPs = 10.0.0.2/32
Das wars, damit hat es wunderbar geklappt.
Achtung, man kann auch statt der IP eine Domain nehmen, die auf den Server verweist, aber dann klappt es nicht diese Domain vom PC aufzurufen, weil es in einer Endlosschleife läuft.
Das könnte man umgehen durch andere Einstellungen, aber ich hatte dann doch einfach die IP eingetragen.
Posted Using INLEO