[1] 2 >>> MLD-5.x / General / Einfache Anleitung Einrichtung VPN?
 

Offline horatio

  • Newbie
  • *
  • Posts: 47
    • View Profile
Einfache Anleitung Einrichtung VPN?
« on: March 02, 2022, 12:37:30 »
Ich würde gerne einen IPTV-Dienst aus der Schweiz nutzen, dazu brauche ich einer dauerhafte VPN-Verbindung.
Wie ist der einfachste Weg?

Habe gesehen, dass es ein openVPN Systempaket gibt? Ist das okay? Gibt es eine Anleitung?

Mein VPN Provider bietet folgende Möglichkeiten an:
OpenVPN
L2TP/IPsec
Wireguard
IKE V1 und V2

MLD 5,5 Unstable
Asus 170 Deluxe, I7

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #1 on: March 02, 2022, 18:36:40 »
Yes, you can install openvpn package.
config files goes to /etc/openvpn

Offline horatio

  • Newbie
  • *
  • Posts: 47
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #2 on: March 03, 2022, 15:56:33 »
I never did that. Do you have a link to an how to?
MLD 5,5 Unstable
Asus 170 Deluxe, I7

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #3 on: March 03, 2022, 16:43:26 »
Hi,

You don't need any guide, just install openvpn package.
Put your .ovpn config files in /etc/openvpn
cd /etc/openvpn
Then run it manually as follows:

Code: [Select]
MLD> openvpn *.ovpn
Thu Mar  3 16:35:09 2022 OpenVPN 2.4.0 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Oct 14 2018
Thu Mar  3 16:35:09 2022 library versions: OpenSSL 1.0.2n  7 Dec 2017, LZO 2.10
Thu Mar  3 16:35:09 2022 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Thu Mar  3 16:35:09 2022 TCP/UDP: Preserving recently used remote address: [AF_INET]--:25000
Thu Mar  3 16:35:09 2022 Socket Buffers: R=[180224->180224] S=[180224->180224]
Thu Mar  3 16:35:09 2022 UDP link local: (not bound)
Thu Mar  3 16:35:09 2022 UDP link remote: [AF_INET]--:25000
Thu Mar  3 16:35:13 2022 TLS: Initial packet from [AF_INET]--:25000, sid=48ad5f99 43227113
Thu Mar  3 16:35:14 2022 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 1024 bit RSA
Thu Mar  3 16:35:14 2022  Peer Connection Initiated with [AF_INET]--:25000
Thu Mar  3 16:35:15 2022 SENT CONTROL : 'PUSH_REQUEST' (status=1)
Thu Mar  3 16:35:15 2022 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS  --,dhcp-option DNS  --,route 10.10.0.1,topology net30,ping 5,ping-restart 30,ifconfig 10.10.0.246 10.10.0.245,peer-id 5,cipher AES-256-GCM'
Thu Mar  3 16:35:15 2022 OPTIONS IMPORT: timers and/or timeouts modified
Thu Mar  3 16:35:15 2022 OPTIONS IMPORT: --ifconfig/up options modified
Thu Mar  3 16:35:15 2022 OPTIONS IMPORT: route options modified
Thu Mar  3 16:35:15 2022 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Thu Mar  3 16:35:15 2022 OPTIONS IMPORT: peer-id set
Thu Mar  3 16:35:15 2022 OPTIONS IMPORT: adjusting link_mtu to 1625
Thu Mar  3 16:35:15 2022 OPTIONS IMPORT: data channel crypto options modified
Thu Mar  3 16:35:15 2022 Data Channel Encrypt: Cipher 'AES-256-GCM' initialized with 256 bit key
Thu Mar  3 16:35:15 2022 Data Channel Decrypt: Cipher 'AES-256-GCM' initialized with 256 bit key
Thu Mar  3 16:35:15 2022 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=eth0 HWADDR=
Thu Mar  3 16:35:15 2022 TUN/TAP device tun2 opened
Thu Mar  3 16:35:15 2022 TUN/TAP TX queue length set to 100
Thu Mar  3 16:35:15 2022 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Thu Mar  3 16:35:15 2022 /sbin/ip link set dev tun2 up mtu 1500
Thu Mar  3 16:35:15 2022 /sbin/ip addr add dev tun2 local 10.10.0.246 peer 10.10.0.245
Thu Mar  3 16:35:17 2022 /sbin/ip route add --/32 via 192.168.1.1
Thu Mar  3 16:35:17 2022 /sbin/ip route add 0.0.0.0/1 via 10.10.0.245
Thu Mar  3 16:35:17 2022 /sbin/ip route add 128.0.0.0/1 via 10.10.0.245
Thu Mar  3 16:35:17 2022 /sbin/ip route add 10.10.0.1/32 via 10.10.0.245
Thu Mar  3 16:35:17 2022 Initialization Sequence Completed

By the way, i noticed there is Webif setup in Network – VPN but i didn't try it

Edit: you can upload vpn config in Webif using Upload vpn config option.


« Last Edit: March 03, 2022, 17:13:08 by gr4vity »

Offline horatio

  • Newbie
  • *
  • Posts: 47
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #4 on: March 03, 2022, 17:50:00 »
Well it's not that easy...

I did as you said, and startet the *ovpn from my provider.
There appeared a new device tun0 until next reboot

Code: [Select]
eth0      Link encap:Ethernet  HWaddr F8:32:E4:75:47:B4 
          inet addr:192.168.178.3  Bcast:192.168.178.255  Mask:255.255.255.0
          inet6 addr: 2003:c5:bf13:bf00:fa32:e4ff:fe75:47b4/64 Scope:Global
          inet6 addr: fe80::fa32:e4ff:fe75:47b4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28076 errors:0 dropped:12022 overruns:0 frame:0
          TX packets:5567 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7386228 (7.0 MiB)  TX bytes:1949078 (1.8 MiB)
          Memory:df100000-df11ffff

eth1      Link encap:Ethernet  HWaddr F8:32:E4:75:47:B5 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:16 Memory:df700000-df720000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:17639 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17639 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:128261705 (122.3 MiB)  TX bytes:128261705 (122.3 MiB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 
          inet addr:10.200.0.102  P-t-P:10.200.0.101  Mask:255.255.255.255
          inet6 addr: fe80::7f5d:978d:ab01:9903/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:22 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:3010 (2.9 KiB)  TX bytes:2096 (2.0 KiB)

I then tried to upload the openvpn file via mld-webportal. It seemed to work.
the ovpn file in /etc/openvpn was deleted then... (?). I do not know what happend, but it is gone!


After a reboot, I think, tun0 seems gone. and I supose i surf without vpn.
How can I see me external IP?
curl ifconfig.me is not working, since I cannot install curl

BTW: But I have noticed that in etc/network/if-down.d and if-up.de I have a file "openvpn"

So, I really do not know if after rebbot I am connected, and if not, how I make the changes persistent.
Thaks for your help

Edit: I could identify me external IP with: wget -O - -q https://api.ipify.org   => I was not connected to vpn after reboot!
« Last Edit: March 03, 2022, 18:02:00 by horatio »
MLD 5,5 Unstable
Asus 170 Deluxe, I7

Offline clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20225
    • View Profile
    • ClausMuus.de
Einfache Anleitung Einrichtung VPN?
« Reply #5 on: March 03, 2022, 18:14:49 »
Beim starten wird openvpn aufgerufen. Als einziger Parameter ist da per Voreinstellung angegeben das nach /var/log/openvpn.log geloggt werden soll.
Manuell kann das Startskript per "start openvpn" bzw. "stop openvpn" aufgerufen werden. Die Tools unter /etc/network/if-down.d/ machen nichts anderes.
Im Logfile /var/log/sysinit kannst Du sehen obopenvpn beim Booten gestartet wurde, und im genannten Logfile ob das erfolgreich war.
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #6 on: March 03, 2022, 18:22:23 »
I don't use openvpn, i installed it just to show you how it works  :D
If you want to be connected after boot you can search in google.
« Last Edit: March 03, 2022, 18:25:56 by gr4vity »

Offline horatio

  • Newbie
  • *
  • Posts: 47
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #7 on: March 03, 2022, 18:36:00 »
@ gr4vity: thanks for your help

@clausmuus:
Beim starten wird openvpn aufgerufen. Als einziger Parameter ist da per Voreinstellung angegeben das nach /var/log/openvpn.log geloggt werden soll.

Das verstehe ich nicht. also wird es schon automatisch gestartet? Meine IP zeigt etwas anderes.
Oder meinst Du, dass es per start automatisch gestartet werden kann?

Quote
Manuell kann das Startskript per "start openvpn" bzw. "stop openvpn" aufgerufen werden. Die Tools unter /etc/network/if-down.d/ machen nichts anderes.

Ich möchte es ja automatisch starten.

Quote
Im Logfile /var/log/sysinit kannst Du sehen obopenvpn beim Booten gestartet wurde, und im genannten Logfile ob das erfolgreich war.

Dort gibt es tatsächlich einen Eintrag: "Starting openvpn".
MLD 5,5 Unstable
Asus 170 Deluxe, I7

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #8 on: March 03, 2022, 19:33:10 »
@ gr4vity: thanks for your help

No problem,
I found this guide
https://www.smarthomebeginner.com/configure-openvpn-to-autostart-linux/
But it's for systemd Linux
You need to modify it to work in MLD.

Good luck  ;)
« Last Edit: March 03, 2022, 23:18:09 by gr4vity »

Offline rfehr

  • MLD-Developer
  • Expert Member
  • ******
  • Posts: 1467
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #9 on: March 03, 2022, 20:27:54 »
Hi Zusammen,

es gibt auch noch das vpnc paket.

Gruß,
  Roland
1x OctopusNet 4x DVB-C
1x Zotac ITX-A Atom 330
1x RPI2 als Client
1x BananaPi
1x Wetekplay
1x MCC 100
2x RPI3
2x RPi4
1x https://www.zotac.com/at/product/mini_pcs/pi335

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #10 on: March 03, 2022, 23:17:40 »
Okay, i figured it out.
In Webif Setup – Network – VPN
Startargs: --config /etc/openvpn/client.ovpn

Offline clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20225
    • View Profile
    • ClausMuus.de
Einfache Anleitung Einrichtung VPN?
« Reply #11 on: March 04, 2022, 14:28:39 »
Demnach fehlt bisher also die Angabe des config Pfades...

@horatio,
wenn es bei Dir mit dem Zusätzlichen Configurations-Parameter funktioniert, werde ich das Paket entsprechend erweitern, damit es in Zukunft auf Anhieb funktioniert.
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline horatio

  • Newbie
  • *
  • Posts: 47
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #12 on: March 04, 2022, 16:02:55 »
Seid mir nicht böse, aber ich bin noch komplett überfordert. Aber die Hilfe von so vielen ist wirklich sehr cool :)
Dank Euch!

Ich gehe mal durch, was ich verstanden habe.

ich poste erstmal die entscheidenden Abschnitte der beiden log-Dateien:

Sysinit;

Code: [Select]
Starting acpid
done


Starting webif:
done
Starting irkeytable
Old keytable cleared
Wrote 77 keycode(s) to driver
Protocols changed to other
done

Starting at daemon:
done
Starting openvpn:
done
Starting ssh:
  Listen on IP: 192.168.178.3

done


openvpn.log
Code: [Select]
Fri Mar  4 15:43:46 2022 disabling NCP mode (--ncp-disable) because not in P2MP client or server mode
Options error: You must define TUN/TAP device (--dev)
Use --help for more information.

Aha, also fehlt noch das Device

Daraufhin nun, wie empfohlen die Startparameter zugefügt:

Code: [Select]
In Webif Setup – Network – VPN
Startargs: --config /etc/openvpn/client.ovpn

Allerdings, was ist das für eine Datei "client.ovpn". Ist das die, die mein VPN-Provider generiert hatte? Die habe ich nun mal entsprechend umbenannt und dorthin kopiert.
Dann habe ich sie per Webif hochgeladen, mit den Parametern. Daraufhin bekam ich folgende Meldung:

Code: [Select]
Import configuration: 0D09C14B-620E-4B8C-AA66-B725F16FC572_ch_openvpn.ovpn
Archive:  /tmp/webserver.11984.POST_configfile
End-of-central-directory signature not found.  Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive.  In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/webserver.11984.POST_configfile or
/tmp/webserver.11984.POST_configfile.zip, and cannot find /tmp/webserver.11984.POST_configfile.ZIP, period.
failed
Stopping openvpn: failed
Starting openvpn: done

Ich habe nun mal neu gestartet. und siehe da, die Fehlermeldung in der openvpn.log ist nun eine andere.
Code: [Select]
Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/client.ovpn

Ich denke also, eine Kleinigkeit fehlt noch und die dreht sich um das client file.
MLD 5,5 Unstable
Asus 170 Deluxe, I7

Offline clausmuus

  • Administrator
  • Expert Member
  • ********
  • Posts: 20225
    • View Profile
    • ClausMuus.de
Einfache Anleitung Einrichtung VPN?
« Reply #13 on: March 04, 2022, 16:41:13 »
Die Funktion im Webif zum hochladen der Configuration get davon aus, dass Du ein Zip Archiv hochlädst, welches die Config Dateien enthält.
Die Start Argumente "--config /etc/openvpn/client.ovpn" sagen dem openvpn Tool, dass die Config Datei client.ovpn heißt. Dein zip Archiv das Du hochlädst, muss also eine so benannte Datei enthalten. Andernfalls Musst Du das Start Argument entsprechend der Namensgebung in Deinem Config Zip Archiv anpassen.
MLD 5.5 - Raspberry PI - 7" Touch TFT - Squeeze Play
MLD 5.5 - lirc yaUsbIR - OctopusNet - XFX GeForce 9300 mit Intel E3200 - 2GB RAM - 12TB HDD - Lian Li PC-C37B - Samsung LE40A559

Offline gr4vity

  • Expert Member
  • *****
  • Posts: 604
    • View Profile
Einfache Anleitung Einrichtung VPN?
« Reply #14 on: March 04, 2022, 19:37:05 »
@horatio
You can push client.ovpn to /etc/openvpn using SSH without using Webif at all.

By the way, Claus never gets angry with anyone   :D
« Last Edit: March 04, 2022, 20:08:59 by gr4vity »

[1] 2 >>> MLD-5.x / General / Einfache Anleitung Einrichtung VPN?
 



Users Online Users Online

0 Members and 1 Guest are viewing this topic.