OpenVPN client-to-client & Verbindung zum Internet / Pro

Post new topic   Reply to topic    DD-WRT Forum Index -> Allgemeine Fragen
Author Message
Nickelino
DD-WRT Novice


Joined: 22 Sep 2014
Posts: 6

PostPosted: Mon Sep 22, 2014 15:35    Post subject: OpenVPN client-to-client & Verbindung zum Internet / Pro Reply with quote
Hallo liebe DD-WRT-Gemeinde,

ich bin sehr überzeugt vom Konzept DD-WRT, weshalb ich einen Router mit dieser Firmware bei mir zu Huase implementiert habe. Ich bin relativ neu auf dem Gebiet Administration und bin gerade dabei mein Heimnetzwerk aufzumotzen. Neben NAS und Mediaserver bin ich gerade dabei ein VPN für mich einzurichten.

OpenVPN scheint mir da eine sehr gute Lösung zu sein und weil DD-WRT das gleich mitbringt, bin ich stark ambitioniert, dieses Projekt auch erfolgreich azuschließen und brauche da Hilfestellung und ein paar Tipps.

Die VPN-Verbindung konnte ich schon erfolgreich mit einem Windows-Client und einem Android-Client herstellen.

Mein Problem ist jetzt leider nur, dass die Clients sich untereinander nicht anpingen können. Da ICMP aktiviert ist, muss der Fehler woanders liegen.

Ich wollte ursprünglich, dass meine VPN-Clients in das selbe Subnetz, wie meine LAN-Clients zu Hause kommen. Die Vorstellung war folgende:

Netz-ID: 192.168.0.0
Subnetzmaske:255.255.255.0

192.168.0.1-10 sind statische Adressen, die ich selber vergebe
192.168.0.100-150 DHCP-Bereich für LAN
192.168.0.200-250 DHCP-Beriech für VPN-Clients

Da ich keine Anleitung im Internet gefunden habe, wie sich dies bewergstelligen lässt, bin ich dazu übergetreten, die VPN-Clients in ein anderes Netz zu stecken. Dafür habe ich mir dann das 192.168.10.0/24-Netz ausgesucht, um dann mit Hilfe des Routers mein LAN und das VPN zu verbinden.

192.168.0.0/24 <-> 192.168.10.0/24

Jetzt läuft es soweit auch. Die Zertifikate wurden erstellt und auf den Clients abgelegt. Sie kriegen eine Verbindung zum VPN und können jeweils mit dem Server sprechen. Das wars aber leider auch schon.

Ich kriege es nicht hin, dass die VPN-Clients untereinander sprechen und auch nicht, dass diese durch mein VPN ins Internet gelangen.

Ich habe mir schon diverse Sachen durchgelesen und auch an den Configs rumgebastelt, was zu keinem richtigen Ergebnis geführt hat. Da ich nicht alles dokumentiert habe, was ich getan hab und das ziemlich viel rumgebsatel war, schreib ich hier jetzt nicht rein, was im genauen alles gemacht habe, sondern poste euch nur die konfigs, mit denen es letztendlich funktioniert. Das müsste reichen, um mich auf den richtigen Weg zu leiten.

Server Config:

Config as: Server
Server mode: Router (TUN)
Network: 192.168.10.0
Netmask: 255.255.255.0
Port: 1194
Tunnel Protocol: UDP
Encryption Cipher: None
Hash Algorithm: None
TLS Cipher: None
LZO Compression: Adaptive
Redirect default Gateway: Enable
Allow Client to Client: Enable
Allow dublicate cn: Disable
Tunnel MTU Setting: 1400

Additional Config:
dev tun0
push "route 192.168.0.1 255.255.255.0"
push "dhcp-option DNS 8.8.8.8"

Zertifikate und Schlüssel funktionieren ja soweit, deswegen Poste ich das ganze hier jetzt nicht!

Client-Config (Windows 7 - 64-Bit):

client
dev tun
proto udp
remote meine-domäne.de 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca C:/Programme/OpenVPN/easy-rsa/keys/ca.crt
cert C:/Programme/OpenVPN/easy-rsa/keys/horst.crt
key C:/Programme/OpenVPN/easy-rsa/keys/horst.key
ns-cert-type server
comp-lzo
verb 3

Ich hoffe das langt. Wenn Ihr noch weitere Informationen braucht, dann fragt einfach danach. Ich hoffe wir finden gemeinsam einen Weg, dieses problem zu beheben.

Liebe Grüße

Nicke
Sponsor
Nickelino
DD-WRT Novice


Joined: 22 Sep 2014
Posts: 6

PostPosted: Mon Sep 22, 2014 15:39    Post subject: Reply with quote
Ergänzend dazu muss man ja noch die Firewall anpassen. Dafür habe ich folgendes unter Administration -> Commands eingefügt:

# Accepts incoming traffic via port 1194 UDP
iptables -I INPUT 1 -p udp --dport 1194 -j ACCEPT

# Allows the VPN client access to router intern
# processes, e.g. Web admin, SSH etc
iptables -I INPUT 3 -i tun0 -j ACCEPT

# Allows connections between VPN clients, if
# client-to-client is enabled in OpenVPN server
iptables -I FORWARD 3 -i tun0 -o tun0 -j ACCEPT

# Allows connection from local VPN to the internet
iptables -I FORWARD 1 --source 192.168.10.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -j MASQUERADE

# Allows connections from local network to VPN network
# and other way around (br0 is LAN and WIFI)
iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o br0 -j ACCEPT

Dabei stellt sich für mich die Frage, wann der Router diese Eintsellungen übernimmt. Ich weiß nicht wie man das prüft und ob ein Klick auf "Run Commands" und "Save Firewall" reicht, weiß ich nicht.
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Tue Sep 23, 2014 13:08    Post subject: Reply with quote
1: wiki: openvpn

2. logs

_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
Nickelino
DD-WRT Novice


Joined: 22 Sep 2014
Posts: 6

PostPosted: Tue Sep 23, 2014 13:49    Post subject: Reply with quote
Zu Punkt 1:Auf diese Wiki-Seite bin ich auch schon gestoßen und habe sie mir merhmals durchgelesen, um die Funktionsweise besser verstehen zu können.

Dabei ist mir der Bridging-Modus aufgefallen. Ich habe mich allerdings wieder davon entfernt, weil das umständlicher sein soll und weil ich auch hier die VPN-Clients nicht ins Internet, geschweige denn in andere Netze bekommen habe.

Das Wiki hat mir leider nicht geholfen.

Zu Punkt 2:

Serverlog 20140923 15:44:03 I OpenVPN 2.3.2 mips-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Apr 18 2014
20140923 15:44:03 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:14
20140923 15:44:03 W NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
20140923 15:44:04 Diffie-Hellman initialized with 2048 bit key
20140923 15:44:04 W ******* WARNING *******: null cipher specified no encryption will be used
20140923 15:44:04 W ******* WARNING *******: null MAC specified no authentication will be used
20140923 15:44:04 W WARNING: normally if you use --mssfix and/or --fragment you should also set --tun-mtu 1500 (currently it is 1400)
20140923 15:44:04 Socket Buffers: R=[172032->131072] S=[172032->131072]
20140923 15:44:04 I TUN/TAP device tun0 opened
20140923 15:44:04 TUN/TAP TX queue length set to 100
20140923 15:44:04 I do_ifconfig tt->ipv6=1 tt->did_ifconfig_ipv6_setup=0
20140923 15:44:04 I /sbin/ifconfig tun0 192.168.10.1 netmask 255.255.255.0 mtu 1400 broadcast 192.168.10.255
20140923 15:44:08 I UDPv4 link local (bound): [undef]
20140923 15:44:08 I UDPv4 link remote: [undef]
20140923 15:44:08 MULTI: multi_init called r=256 v=256
20140923 15:44:08 IFCONFIG POOL: base=192.168.10.2 size=252 ipv6=0
20140923 15:44:08 IFCONFIG POOL LIST
20140923 15:44:08 I Initialization Sequence Completed
20140923 15:46:15 W 46.59.204.208:60133 WARNING: normally if you use --mssfix and/or --fragment you should also set --tun-mtu 1500 (currently it is 1400)
20140923 15:46:15 46.59.204.208:60133 TLS: Initial packet from [AF_INET]46.59.204.208:60133 sid=9a4f257c 6f1bd849
20140923 15:46:15 46.59.204.208:60133 VERIFY OK: depth=1 C=DE ST=HH L=Hamburg O=meine-domäne.de OU=ca-bjoern CN=tp-link.ca name=changeme emailAddress=admin@meine-domäne.de
20140923 15:46:15 46.59.204.208:60133 VERIFY OK: depth=0 C=DE ST=HH L=Hamburg O=meine-domäne.de OU=ca-bjoern CN=horst name=changeme emailAddress=admin@meine-domäne.de
20140923 15:46:16 W 46.59.204.208:60133 WARNING: 'dev-type' is used inconsistently local='dev-type tun' remote='dev-type tap'
20140923 15:46:16 W 46.59.204.208:60133 WARNING: 'link-mtu' is used inconsistently local='link-mtu 1406' remote='link-mtu 1574'
20140923 15:46:16 W 46.59.204.208:60133 WARNING: 'tun-mtu' is used inconsistently local='tun-mtu 1400' remote='tun-mtu 1532'
20140923 15:46:16 W 46.59.204.208:60133 WARNING: 'cipher' is used inconsistently local='cipher [null-cipher]' remote='cipher BF-CBC'
20140923 15:46:16 W 46.59.204.208:60133 WARNING: 'auth' is used inconsistently local='auth [null-digest]' remote='auth SHA1'
20140923 15:46:16 W 46.59.204.208:60133 WARNING: 'keysize' is used inconsistently local='keysize 0' remote='keysize 128'
20140923 15:46:16 46.59.204.208:60133 Control Channel: TLSv1 cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA 2048 bit RSA
20140923 15:46:16 I 46.59.204.208:60133 [horst] Peer Connection Initiated with [AF_INET]46.59.204.208:60133
20140923 15:46:16 I horst/46.59.204.208:60133 MULTI_sva: pool returned IPv4=192.168.10.2 IPv6=(Not enabled)
20140923 15:46:16 horst/46.59.204.208:60133 MULTI: Learn: 192.168.10.2 -> horst/46.59.204.208:60133
20140923 15:46:16 horst/46.59.204.208:60133 MULTI: primary virtual IP for horst/46.59.204.208:60133: 192.168.10.2
20140923 15:46:18 horst/46.59.204.208:60133 PUSH: Received control message: 'PUSH_REQUEST'
20140923 15:46:18 I horst/46.59.204.208:60133 send_push_reply(): safe_cap=940
20140923 15:46:18 horst/46.59.204.208:60133 SENT CONTROL [horst]: 'PUSH_REPLY redirect-gateway def1 route 192.168.0.1 255.255.255.0 dhcp-option DNS 8.8.8.8 route-gateway 192.168.10.1 topology subnet ping 10 ping-restart 120 ifconfig 192.168.10.2 255.255.255.0' (status=1)
20140923 15:46:18 N horst/46.59.204.208:60133 Bad LZO decompression header byte: 210
20140923 15:46:18 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #2037046891 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:18 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #2825248351 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:18 N horst/46.59.204.208:60133 Bad LZO decompression header byte: 150
20140923 15:46:18 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #2932028065 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:18 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #3749767744 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:18 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #1176228691 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:18 horst/46.59.204.208:60133 NOTE: --mute triggered...
20140923 15:46:19 horst/46.59.204.208:60133 21 variation(s) on previous 3 message(s) suppressed by --mute
20140923 15:46:19 N horst/46.59.204.208:60133 Bad LZO decompression header byte: 192
20140923 15:46:19 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #1795292207 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:19 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #2596580087 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:19 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #751274543 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:19 horst/46.59.204.208:60133 NOTE: --mute triggered...
20140923 15:46:19 horst/46.59.204.208:60133 11 variation(s) on previous 3 message(s) suppressed by --mute
20140923 15:46:19 N horst/46.59.204.208:60133 Bad LZO decompression header byte: 69
20140923 15:46:19 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #2828104636 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:20 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #3704303874 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:20 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #4259523997 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:20 horst/46.59.204.208:60133 NOTE: --mute triggered...
20140923 15:46:27 69 variation(s) on previous 3 message(s) suppressed by --mute
20140923 15:46:27 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20140923 15:46:27 D MANAGEMENT: CMD 'state'
20140923 15:46:27 MANAGEMENT: Client disconnected
20140923 15:46:27 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20140923 15:46:27 D MANAGEMENT: CMD 'state'
20140923 15:46:27 MANAGEMENT: Client disconnected
20140923 15:46:27 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20140923 15:46:27 D MANAGEMENT: CMD 'state'
20140923 15:46:27 MANAGEMENT: Client disconnected
20140923 15:46:27 N horst/46.59.204.208:60133 Authenticate/Decrypt packet error: bad packet ID (may be a replay): [ #3670603747 ] -- see the man page entry for --no-replay and --replay-window for more info or silence this warning with --mute-replay-warnings
20140923 15:46:27 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20140923 15:46:27 D MANAGEMENT: CMD 'status 2'
20140923 15:46:27 MANAGEMENT: Client disconnected
20140923 15:46:27 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:14
20140923 15:46:27 D MANAGEMENT: CMD 'log 500'
19700101 00:00:00
dh /tmp/openvpn/dh.pem ca /tmp/openvpn/ca.crt cert /tmp/openvpn/cert.pem key /tmp/openvpn/key.pem keepalive 10 120 verb 3 mute 3 syslog writepid /var/run/openvpnd.pid management 127.0.0.1 14 management-log-cache 100 topology subnet script-security 2 port 1194 proto udp cipher none auth none client-config-dir /tmp/openvpn/ccd comp-lzo yes ifconfig-pool-persist /tmp/openvpn/ip-pool 86400 client-to-client push "redirect-gateway def1" fast-io tun-mtu 1400 mtu-disc yes server 192.168.10.0 255.255.255.0 dev tun2 tun-ipv6 dev tun0 push "route 192.168.0.1 255.255.255.0" push "dhcp-option DNS 8.8.8.8" Clientlog
Nickelino
DD-WRT Novice


Joined: 22 Sep 2014
Posts: 6

PostPosted: Wed Sep 24, 2014 16:55    Post subject: Reply with quote
Ich habe es jetzt geschafft den OVPN-Server als server-bridge laufen zu lassen und auch hier habe ich es geschafft eine Verbindung aufzubauen.

Jedoch habe ich das selbe Problem wie vorher, nämlich, dass sich die VPN-Clients untereinander nicht kommunizieren, auch nicht mit dem LAN, obwohl alle Clients jetzt im selben Subnetz waren (192.168.0.0/24).

Ich denke, dass es irgendwie mit dem Router selbst zu tun hat. Hier einmal die Routingtabelle, der Router läuft unter "Setup->Advanced Routing" im Gatewaymodus:

0.0.0.0 0.0.0.0 192.168.55.1 UG 0 WAN
169.254.0.0 255.255.0.0 0.0.0.0 U 0 LAN & WLAN
192.168.0.0 255.255.255.0 0.0.0.0 U 0 LAN & WLAN
192.168.10.0 255.255.255.0 192.168.10.1 UG 0 tun0
192.168.10.0 255.255.255.0 0.0.0.0 U 0 tun0
192.168.55.0 255.255.255.0 0.0.0.0 U 0 WAN


Der OVPN-Server läuft jetzt wieder im Server-Modus, deswegen das 192.168.10.0/24-Netz

cya
Nickelino
DD-WRT Novice


Joined: 22 Sep 2014
Posts: 6

PostPosted: Thu Oct 02, 2014 13:41    Post subject: Reply with quote
So, ich habe alles ordnungsgemäß zum laufen bekommen.

Bei allen meinen Versuchen, habe ich mich strikt an das Tutorial von Administrator.de gehalten.

http://www.administrator.de/wissen/openvpn-server-installieren-auf-dd-wrt-router-oder-pfsense-firewall-123285.html

Das Problem., weshalb es beim ersten mal nicht geklappt hat, kann ich nicht wirklich nachvollziehen, da ich beide male zum Schluss die selben Einstellungen getroffen habe. Ich könnte mir nur vorstellen, dass ich irgendetwas beim ersten Versuch durch rumprobieren kaputt gespielt habe.

Der Punkt ist, dass ich nach dem setzen auf die Werksienstellungen NUR das Turtorial abgearbeitet habe, sprich, ich habe wirklich nur strikt die Einstellungen getroffen und sonst nichts rumprobiert oder an irgendetwas rumgespielt.

Deswegen sage ich hier nocheinmal in aller deutlichkeit, weil das sont niemand macht:

Beim Einrichten eines DD-WRT-OpenVPN-Servers unbedingt den Router einmal zurücksetzen, wenn es nach der Abarbeitung eines Tutorials Probleme gibt.

@Sash: Ich finde es gut, dass du mir den Hinweis gibts, nochmal ins wiki zu schauen und die logs hier zu posten. Ich musste feststellen, dass das wenig Sinn gemacht hat. Vor allem war deine Antwort ziemlich grob. Ich denke wenn du Hilfe brauchst, wäre so eine Antwort auch das letzte, was du lesen möchtest.

Du schreibst in deine Signatur: I'm NOT rude, just offer pure facts!

Das ist keine Entschuldigung dafür, so unhöflich zu sein, wie du es in diesem Beitrag hier gemacht hast. Aber, da du schriebst, dass du nur Pur Fakten darlegst, dann wirst du hoffentlich diese Nachricht an dich nicht als Persönlichen Angriff werten, sondern als Kritik. Was du daruas machst, ist dien Ding. Ich für meinen Teil nehme Abstand von diesem Forum hier, weil ich hier keine Hilfe erhalte. Du und kein anderer haben reagiert, als ich mein Log hie rgepostet habe. Ich war mir nicht mal sicher, ob es der richtige war.

Ich bin weder frustriert noch will ich das Forum hier schlecht machen. Ich habe ja erreicht, was ich wollte.

Um das hier jetzt abzuschließen, da ich keine Antwort erwarte: Das war ein reiner Erfahrungwert und ich hoffe ihr arbeitet dran.

LG Nicke
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Thu Dec 18, 2014 8:07    Post subject: Reply with quote
da sind ja so viele warnings im log....wuasi alles flasch was falsch einzustellen geht.

geh jedes warning von oben nach untern durch und behebe das problem.

wiki und google hilft auch.

_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Allgemeine Fragen All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum