ehnoah
Goto Top

Ganzer Traffic durch OpenVPN?

Hey Leute,

ich hab heute auf meinem Linux Server OpenVPN installiert und konfiguriert:

local 65.21.183.31
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
server-ipv6 fddd:1194:1194:1194::/64
push "redirect-gateway def1"  
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 10.8.0.1"  
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
verb 3
crl-verify crl.pem
explicit-exit-notify

Wenn ich mich jetzt über Windows mit dem OpenVPN und der Config Datei verbinde, gibt er mir immer noch die "alte" IP aus, wenn ich nen IP check mache. Sprich es wird nicht alles oder gar nichts? Durch den VPN getunnelt.

push "redirect-gateway def1"  


Hab ich extra schon hinzugefügt, da ich vorher schon etwas gegoogled habe.

IP Forward hab ich ebenfalls aktiviert. Ich meine hier dazu gelesen zu haben, dsas für das Forwarding noch ein Service laufen muss, den hat mein System jedoch nicht gefunden. Eventuell liegt es auch schon daran?
net.ipv4.ip_forward = 1

Hoffe ihr findet den Fehler =/ Danke <3

Content-Key: 1443434466

Url: https://administrator.de/contentid/1443434466

Printed on: July 26, 2024 at 23:07 o'clock

Member: farddwalling
farddwalling Oct 29, 2021 at 05:19:49 (UTC)
Goto Top
Wer gibt dir denn die alte IP aus?? Und welche IP meinst du damit? Die Lokale vom PC?
Member: BirdyB
BirdyB Oct 29, 2021 at 06:29:50 (UTC)
Goto Top
Moin,

was sagt denn die Routing-Tabelle auf deinem Client?

VG
Member: ehnoah
ehnoah Oct 29, 2021 at 08:10:14 (UTC)
Goto Top
Heyho,

an der Routing-Tabelle hab ich gar nichts gemacht, ehrlich gesagt, dachte ich das OpenVPN wie ein "normaler" VPN läuft, also wie NordVPN und Co.

Da ich gern auf einen IPv4 Server zugreifen möchte auf meinem "HomePC" hab ich mir ein Server mit ner Static IP gemietet und wollte jetzt den Traffic über den VPN laufen lassen, sodass ich auf den Server via Static IP zugreifen kann.
Member: BirdyB
BirdyB Oct 29, 2021 at 08:32:31 (UTC)
Goto Top
Es geht nicht darum was du gemacht hast, sondern ob die entsprechende Route automatisch angelegt wurde.
Member: ehnoah
ehnoah Oct 29, 2021 at 08:45:34 (UTC)
Goto Top
Zitat von @BirdyB:

Es geht nicht darum was du gemacht hast, sondern ob die entsprechende Route automatisch angelegt wurde.

Ich schätze mal nicht, da es ja immer noch meine "Public" IPv4 anzeigt. Sprich, ich muss den ganzen Traffic manuell über OpenVPN routen? Oder gibt es da ein "großen" Befehl?
Member: BirdyB
BirdyB Oct 29, 2021 updated at 08:50:30 (UTC)
Goto Top
Wie wäre es denn, wenn du einfach mal die Routing-Table postest, anstelle irgendwelcher Annahmen?
P.S.: Was sagt denn das Logfile?
Member: ehnoah
ehnoah Oct 29, 2021 updated at 08:54:50 (UTC)
Goto Top
Edit: Logfile sagt:

Fri Oct 29 10:51:48 2021 DEPRECATED OPTION: --cipher set to 'AES-256-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM). Future OpenVPN version will ignore --cipher for cipher negotiations. Add 'AES-256-CBC' to --data-ciphers or change --cipher 'AES-256-CBC' to --data-ciphers-fallback 'AES-256-CBC' to silence this warning.  
Fri Oct 29 10:51:48 2021 OpenVPN 2.5.4 Windows-MSVC [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Oct 20 2021
Fri Oct 29 10:51:48 2021 Windows version 10.0 (Windows 10 or greater) 64bit
Fri Oct 29 10:51:48 2021 library versions: OpenSSL 1.1.1l  24 Aug 2021, LZO 2.10
Fri Oct 29 10:51:48 2021 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Fri Oct 29 10:51:48 2021 Need hold release from management interface, waiting...
Fri Oct 29 10:51:49 2021 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Fri Oct 29 10:51:49 2021 MANAGEMENT: CMD 'state on'  
Fri Oct 29 10:51:49 2021 MANAGEMENT: CMD 'log all on'  
Fri Oct 29 10:51:49 2021 MANAGEMENT: CMD 'echo all on'  
Fri Oct 29 10:51:49 2021 MANAGEMENT: CMD 'bytecount 5'  
Fri Oct 29 10:51:49 2021 MANAGEMENT: CMD 'hold off'  
Fri Oct 29 10:51:49 2021 MANAGEMENT: CMD 'hold release'  
Fri Oct 29 10:51:49 2021 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key  
Fri Oct 29 10:51:49 2021 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication  
Fri Oct 29 10:51:49 2021 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key  
Fri Oct 29 10:51:49 2021 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication  
Fri Oct 29 10:51:49 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]65.21.183.31:1194
Fri Oct 29 10:51:49 2021 Socket Buffers: R=[65536->65536] S=[65536->65536]
Fri Oct 29 10:51:49 2021 UDP link local: (not bound)
Fri Oct 29 10:51:49 2021 UDP link remote: [AF_INET]65.21.183.31:1194
Fri Oct 29 10:51:49 2021 MANAGEMENT: >STATE:1635497509,WAIT,,,,,,
Fri Oct 29 10:51:49 2021 MANAGEMENT: >STATE:1635497509,AUTH,,,,,,
Fri Oct 29 10:51:49 2021 TLS: Initial packet from [AF_INET]65.21.183.31:1194, sid=eedb5631 8473c394
Fri Oct 29 10:51:49 2021 VERIFY OK: depth=1, CN=ChangeMe
Fri Oct 29 10:51:49 2021 VERIFY KU OK
Fri Oct 29 10:51:49 2021 Validating certificate extended key usage
Fri Oct 29 10:51:49 2021 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Fri Oct 29 10:51:49 2021 VERIFY EKU OK
Fri Oct 29 10:51:49 2021 VERIFY OK: depth=0, CN=server
Fri Oct 29 10:52:49 2021 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Oct 29 10:52:49 2021 TLS Error: TLS handshake failed
Fri Oct 29 10:52:49 2021 SIGUSR1[soft,tls-error] received, process restarting
Fri Oct 29 10:52:49 2021 MANAGEMENT: >STATE:1635497569,RECONNECTING,tls-error,,,,,
Fri Oct 29 10:52:49 2021 Restart pause, 5 second(s)
Fri Oct 29 10:52:54 2021 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key  
Fri Oct 29 10:52:54 2021 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication  
Fri Oct 29 10:52:54 2021 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key  
Fri Oct 29 10:52:54 2021 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication  
Fri Oct 29 10:52:54 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]65.21.183.31:1194
Fri Oct 29 10:52:54 2021 Socket Buffers: R=[65536->65536] S=[65536->65536]
Fri Oct 29 10:52:54 2021 UDP link local: (not bound)
Fri Oct 29 10:52:54 2021 UDP link remote: [AF_INET]65.21.183.31:1194
Fri Oct 29 10:52:54 2021 MANAGEMENT: >STATE:1635497574,WAIT,,,,,,
Fri Oct 29 10:52:54 2021 MANAGEMENT: >STATE:1635497574,AUTH,,,,,,
Fri Oct 29 10:52:54 2021 TLS: Initial packet from [AF_INET]65.21.183.31:1194, sid=a0959021 6f899a54
Fri Oct 29 10:52:54 2021 VERIFY OK: depth=1, CN=ChangeMe
Fri Oct 29 10:52:54 2021 VERIFY KU OK
Fri Oct 29 10:52:54 2021 Validating certificate extended key usage
Fri Oct 29 10:52:54 2021 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Fri Oct 29 10:52:54 2021 VERIFY EKU OK
Fri Oct 29 10:52:54 2021 VERIFY OK: depth=0, CN=server
Fri Oct 29 10:53:55 2021 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Oct 29 10:53:55 2021 TLS Error: TLS handshake failed
Fri Oct 29 10:53:55 2021 SIGUSR1[soft,tls-error] received, process restarting
Fri Oct 29 10:53:55 2021 MANAGEMENT: >STATE:1635497635,RECONNECTING,tls-error,,,,,
Fri Oct 29 10:53:55 2021 Restart pause, 5 second(s)
Fri Oct 29 10:54:00 2021 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key  
Fri Oct 29 10:54:00 2021 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication  
Fri Oct 29 10:54:00 2021 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key  
Fri Oct 29 10:54:00 2021 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication  
Fri Oct 29 10:54:00 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]65.21.183.31:1194
Fri Oct 29 10:54:00 2021 Socket Buffers: R=[65536->65536] S=[65536->65536]
Fri Oct 29 10:54:00 2021 UDP link local: (not bound)
Fri Oct 29 10:54:00 2021 UDP link remote: [AF_INET]65.21.183.31:1194
Fri Oct 29 10:54:00 2021 MANAGEMENT: >STATE:1635497640,WAIT,,,,,,
Fri Oct 29 10:54:00 2021 MANAGEMENT: >STATE:1635497640,AUTH,,,,,,
Fri Oct 29 10:54:00 2021 TLS: Initial packet from [AF_INET]65.21.183.31:1194, sid=9f00a582 8d25388e
Fri Oct 29 10:54:00 2021 VERIFY OK: depth=1, CN=ChangeMe
Fri Oct 29 10:54:00 2021 VERIFY KU OK
Fri Oct 29 10:54:00 2021 Validating certificate extended key usage
Fri Oct 29 10:54:00 2021 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Fri Oct 29 10:54:00 2021 VERIFY EKU OK
Fri Oct 29 10:54:00 2021 VERIFY OK: depth=0, CN=server


Schnittstellenliste
  4...bc e9 2f ba a8 38 ......Realtek Gaming GbE Family Controller
 17...........................Wintun Userspace Tunnel
 24...00 ff aa 52 c2 5a ......TAP-NordVPN Windows Adapter V9
 14...0a 00 27 00 00 0e ......VirtualBox Host-Only Ethernet Adapter
 20...00 ff 81 9c 0e 85 ......TAP-ProtonVPN Windows Adapter V9
 11...00 ff 3f 7a 6f f3 ......TAP-Windows Adapter V9
  7...72 66 55 e1 d0 5d ......Microsoft Wi-Fi Direct Virtual Adapter #3
 23...f2 66 55 e1 d0 5d ......Microsoft Wi-Fi Direct Virtual Adapter #4
 21...00 50 56 c0 00 01 ......VMware Virtual Ethernet Adapter for VMnet1
  5...00 50 56 c0 00 08 ......VMware Virtual Ethernet Adapter for VMnet8
 19...70 66 55 e1 d0 5d ......Realtek RTL8822CE 802.11ac PCIe Adapter
 13...70 66 55 e1 d0 5c ......Bluetooth Device (Personal Area Network)
  1...........................Software Loopback Interface 1
===========================================================================

IPv4-Routentabelle
===========================================================================
Aktive Routen:
     Netzwerkziel    Netzwerkmaske          Gateway    Schnittstelle Metrik
          0.0.0.0          0.0.0.0    192.168.178.1   192.168.178.46     50
        127.0.0.0        255.0.0.0   Auf Verbindung         127.0.0.1    331
        127.0.0.1  255.255.255.255   Auf Verbindung         127.0.0.1    331
  127.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    331
     192.168.18.0    255.255.255.0   Auf Verbindung      192.168.18.1    291
     192.168.18.1  255.255.255.255   Auf Verbindung      192.168.18.1    291
   192.168.18.255  255.255.255.255   Auf Verbindung      192.168.18.1    291
     192.168.56.0    255.255.255.0   Auf Verbindung      192.168.56.1    281
     192.168.56.1  255.255.255.255   Auf Verbindung      192.168.56.1    281
   192.168.56.255  255.255.255.255   Auf Verbindung      192.168.56.1    281
    192.168.178.0    255.255.255.0   Auf Verbindung    192.168.178.46    306
   192.168.178.46  255.255.255.255   Auf Verbindung    192.168.178.46    306
  192.168.178.255  255.255.255.255   Auf Verbindung    192.168.178.46    306
    192.168.235.0    255.255.255.0   Auf Verbindung     192.168.235.1    291
    192.168.235.1  255.255.255.255   Auf Verbindung     192.168.235.1    291
  192.168.235.255  255.255.255.255   Auf Verbindung     192.168.235.1    291
        224.0.0.0        240.0.0.0   Auf Verbindung         127.0.0.1    331
        224.0.0.0        240.0.0.0   Auf Verbindung     192.168.235.1    291
        224.0.0.0        240.0.0.0   Auf Verbindung      192.168.56.1    281
        224.0.0.0        240.0.0.0   Auf Verbindung      192.168.18.1    291
        224.0.0.0        240.0.0.0   Auf Verbindung    192.168.178.46    306
  255.255.255.255  255.255.255.255   Auf Verbindung         127.0.0.1    331
  255.255.255.255  255.255.255.255   Auf Verbindung     192.168.235.1    291
  255.255.255.255  255.255.255.255   Auf Verbindung      192.168.56.1    281
  255.255.255.255  255.255.255.255   Auf Verbindung      192.168.18.1    291
  255.255.255.255  255.255.255.255   Auf Verbindung    192.168.178.46    306
===========================================================================
Ständige Routen:
  Keine

IPv6-Routentabelle
===========================================================================
Aktive Routen:
 If Metrik Netzwerkziel             Gateway
  1    331 ::1/128                  Auf Verbindung
 21    291 fe80::/64                Auf Verbindung
 14    281 fe80::/64                Auf Verbindung
  5    291 fe80::/64                Auf Verbindung
  5    291 fe80::9141:d9e3:d4b0:d550/128
                                    Auf Verbindung
 14    281 fe80::9cb6:ae30:7ecd:e6ad/128
                                    Auf Verbindung
 21    291 fe80::f42c:d070:ab67:22a7/128
                                    Auf Verbindung
  1    331 ff00::/8                 Auf Verbindung
 21    291 ff00::/8                 Auf Verbindung
 14    281 ff00::/8                 Auf Verbindung
  5    291 ff00::/8                 Auf Verbindung
===========================================================================
Ständige Routen:
  Keine
Member: aqui
aqui Oct 29, 2021 updated at 09:03:48 (UTC)
Goto Top
Sprich es wird nicht alles oder gar nichts? Durch den VPN getunnelt.
Nein, das wäre natürlich Quatsch in einem VPN Design !
Natürlich supportet OpenVPN auch Split Tunneling was NUR den Traffic für entsprechend konfigurierte remote IP Netze in den Tunnel forwardet. (push route... Kommando).
Damit geht dann auch nur dieser relevante Traffic an dein Ziel zum Hetzner Rechenzentrum in Finnland. Alles andere bleibt lokal.

Einfach mal das hiesige Tutorial dazu lesen wo das alles umfassend erklärt wird !
Merkzettel: VPN Installation mit OpenVPN

Nebenbei.
Öffentliche VPN Provider wie NordVPN zu nutzen ist immer ein NoGo. Diese Verbindungen sind unsicher und an deren Tunnelendpunkten sind besonders viele Schnüffler und Schlapphüte. Damit erweist man sich immer einen Bärendienst wenn einem die persönliche Datensicherheit etwas wert ist.
Sehr lesenswert dazu: https://www.heise.de/select/ct/archiv/2021/18/seite-18
Member: ehnoah
ehnoah Oct 29, 2021 at 09:48:27 (UTC)
Goto Top
Was auch immer ich geändert habe, aber jetzt läuft es.

Ich bekomme eine IP zugewießen und die "externe" IP ist nun auch die richtige.
Member: aqui
aqui Nov 17, 2021 at 09:29:38 (UTC)
Goto Top
Wenn's das denn nun war bitte den Thread hier dann auch als erledigt schliessen !!
How can I mark a post as solved?