Posts mit dem Label HowTo werden angezeigt. Alle Posts anzeigen
Posts mit dem Label HowTo werden angezeigt. Alle Posts anzeigen

Mittwoch, 24. April 2019

OpenVPN Server unter Windows 10 bei IPv6 Anschlüssen mit feste-ip.net als Portmapper und einer Fritzbox

Irgendwie fand ich im Internet nur sehr verteilt die Informationen, welche man für einen OpenVPN-Server mit Passwort und Zertikaten unter Windows benötigt. Skripte die wegen kleiner Fehler nicht liefen, auf den meisten Seiten nur ein oder zwei der drei Einstellungen die fürs Routing benötigt werden unter Windows 10, wenn der gesamte Internetverkehr der Clients durch den Server rausgehen soll. Auch das Passwortauth ist nicht gerade selbsterklärend unter Windows. Dazu kam, dass dies hinter einem Kabel Deutschland Anschluss mit DualStack-Lite (öffentliche IPv6-Adresse) laufen sollte und von IPv4 Anschlüssen, wie o2 Handys, erreichbar sein sollte, inkl. externem Provider der eingehende Verbindungen auf IPv6 umsetzt und den FritzBox Einstellungen.

Momentan läuft es, ich kann mich innerhalb des LAN zum Testen via IPv4, als auch von extern via Handy durch den IPv6/IPv4-Tunnel verbinden, und dies sowohl von Android als auch von Windows 10, so dass der gesamte Netzwerk- und Internetverkehr über den VPN-Server ins LAN bzw Internet geleitet wird. Aus Sicherheitsgründen wollte ich Zertifikate + Benutzername/Passwort benutzen, der Rest der Konfiguration ist jedoch noch nicht auf Sicherheit optimiert, hier gibt es noch einige Tipps und HowTos via Google.

Zum Inhalt:
OpenVPN Server unter Windows 10
Windows 10 Einstellungen
FritzBox Einstellungen
Feste-IP.net Einstellungen
Windows-Client
Android-Client

OpenVPN Server:

Installation: Download Ich hab die aktuellste 2.4.7 genutzt. Bei der Installation bitte die easy-rsa Sachen mitinstallieren, diese werden für die Zertifikatserzeugung später benötigt.

Beispiel Serverconfig:(C:\Programme\OpenVPN\config\server.ovpn)

port 11934
proto tcp
dev tun

ca "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\server.crt"
key "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\server.key"

dh "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\dh2048.pem"

server 10.0.0.0 255.255.255.0

ifconfig-pool-persist "C:\\Program Files\\OpenVPN\\log\\ipp.txt"

push "route 192.168.178.0 255.255.255.0"
#push "dhcp-option DNS 192.168.178.1"
push "dhcp-option DNS 8.8.8.8"
push "redirect-gateway def1"


keepalive 10 120

cipher AES-128-CBC

persist-key
persist-tun

status "C:\\Program Files\\OpenVPN\\log\\openvpn-status.log"

verb 3
script-security 4

auth-user-pass-verify "C:\\Program Files\\OpenVPN\\config\\auth.bat" via-env

Die Route 192.168.178.0 ist mein LAN.
redirect-gateway ist sinnvoll mit def1, dies sichert die bisherige Defaultroute.
script-security muss größer 2 sein, damit ans auth-script via 'via-env' auch das Passwort übergeben wird.
10.0.0.0 ist das Netz für die Clients.
Der Rest ist ziemlich Standard bis auf den Port und das Protokoll, bei UDP hatte ich Probleme mit der Erreichbarkeit vom Portmapper aus, aber vielleicht funktioniert es ja bei euch.

Auth-Skript angepasst: (die meisten im Internet hatten Probleme mit dem Dateinamen und Pfaden, C:\Programme\OpenVPN\config\auth.bat)

@echo off 
set n_user=%username%-%password%#;
echo %n_user% >c:\tmp\txt.txt
set n_user=%username% %password%
find /n "%n_user%" "C:\Programme\OpenVPN\config\users.txt" > "C:\Programme\OpenVPN\config\result.txt"
for /f "skip=1" %%a in ("C:\Programme\OpenVPN\config\result.txt") do set n=%%a
if "%n%"=="----------" exit 1
exit 0

find ist eine Zeile, erst bei for fängt die nächste an.
Zum Debuggen wird der Username und das Passwort in c:\tmp\txt.txt geloggt, falls ihr c:\tmp habt.
Wichtig ist vollständige Pfade in der for-Schleife zu nutzen mit Anführungszeichen, da es bei nur dem Dateinamen zu Fehlern kommen kann.

Users File: (C:\Programme\OpenVPN\config\users.txt)

david Musterpasswort
(ein Leerzeichen)

Zertifikate erzeugen:

(Common Name muss rein und für jedes Cert (alle Clients und Server) verschieden sein, sonst sagt er es gibt schon ein Cert und generiert nur csr und key, aber kein crt!)

Ne cmd mit Adminrechten starten und ab ins Verzeichnis easy-rsa im OpenVPN Programmverzeichnis, dann folgende Befehle:
init-config.bat
dann die vars.bat editieren, hier ein Beispiel:

@echo off
rem Edit this variable to point to
rem the openssl.cnf file included
rem with easy-rsa.

rem Automatically set PATH to openssl.exe
FOR /F "tokens=2*" %%a IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\OpenVPN"') DO set "PATH=%PATH%;%%b\bin"

rem Alternatively define the PATH to openssl.exe manually
rem set "PATH=%PATH%;C:\Program Files\OpenVPN\bin"
set OPENSSL_CONF=C:\Program Files\OpenVPN\easy-rsa\openssl-1.0.0.cnf

set HOME=%ProgramFiles%\OpenVPN\easy-rsa
set KEY_CONFIG=openssl-1.0.0.cnf

rem Edit this variable to point to
rem your soon-to-be-created key
rem directory.
rem
rem WARNING: clean-all will do
rem a rm -rf on this directory
rem so make sure you define
rem it correctly!
set KEY_DIR=keys

rem Increase this if you
rem are paranoid.  This will slow
rem down TLS negotiation performance
rem as well as the one-time DH parms
rem generation process.
set DH_KEY_SIZE=2048

rem Private key size
set KEY_SIZE=4096

rem These are the default values for fields
rem which will be placed in the certificate.
rem Change these to reflect your site.
rem Don't leave any of these parms blank.

set KEY_COUNTRY=DE
set KEY_PROVINCE=RLP
set KEY_CITY=Kaiserslautern
set KEY_ORG=KulschIT
set KEY_EMAIL=the1andonlydave@gmail.com
set KEY_CN=xxx.feste-ip.net
set KEY_NAME=xxx
set KEY_OU=Wohnzimmer
set PKCS11_MODULE_PATH=Modulepfaedchen
set PKCS11_PIN=9876

Hier beugt set OPENSSL_CONF=C:\Program Files\OpenVPN\easy-rsa\openssl-1.0.0.cnf
weiteren Problemen vor, ansonsten sollten noch der untere Block angepasst werden, nichts sollte leer sein.
nun:
vars
clean-all (löscht den keys ordner, falls ihr schonmal Zertifikate erzeugt habt!)
vars
build-ca
vars
build-dh (dauert auf nem aktuellen Rechner ca 2 Minuten)
vars
build-key-server server
dann beliebig oft:
vars 
build-key BENUTZERNAME


Danach noch den Dienst OpenVPNService starten und in den Autostart:



Windows 10 Routingeinstellungen:

Hier muss einmal der Dienst Routing und RAS gestartet werden und der Starttyp auf automatisch gestellt werden:


Dann muss in der Registry mit regedit.exe folgende Änderung gemacht werden: (benötigt nen Reboot)
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters
IPEnableRouter=1


Und zuletzt muss die Freigabe der Internetverbindung am Adapter eingestellt werden:


Ausserdem muss geprüft werden ob der Adapter auch per IPv6 verbunden ist und Internet hat:


Und in der Firewall muss auch nochmal für TCP oder UDP eine Regel erstellt werden, je nachdem was ihr in eurer Config stehen habt. Ich nutze hier die Windows Standardfirewall:



FritzBox Einstellungen:

Prüfen ob ihr einen Internetzugang mit DS-Lite-Tunnel habt:


MyFritz Konto anlegen:




IPv6 Einstellungen bei mir: (alles Standard)


Bei lokalem DNSv6-Server ist der Standard eingestellt.

Freigaben:
Die erste Freigabe als MyFritz Freigabe anlegen wegen dem DNS-Namen. Diese MyFRITZ!-Adresse ohne den Prefix/Port müsst ihr dann bei feste-ip.net eintragen.

Weitere Freigaben gehen ganz normal, den DNS-Namen habt ihr ja nun.


PING6 reicht, die Firewall müsst ihr nicht weiter öffnen. Die Freigabe mit der LAN-IPv4 könnt ihr ignorieren.

Fertig:


MyFritz Weblogin zum Testen:


Feste-IP.net Einstellungen:

(Hier kann auch ein anderer Anbieter genutzt werden, aber feste-ip.net funktionierte in meinen Tests immer, hat ein Supportforum und liegt mit knapp unter 5€ (pro Jahr!) und der Möglichkeit es bis zu 50 Tage gratis zu testen, auch preislich sicher im Rahmen)

Übersicht:

Hier muss bei DNS-Name der Name im Format meinPC.meinefritzid.myfritz.net eingegeben werden, siehe obigen Screenshot vom MyFritz-Freigabe anlegen und bei Alias eine Wunschdomain, bei Port nur der VPN-Port.


Windows Client Config:

Hier kann der beim OpenVPN Installer enthaltene GUI-Client verwendet werden, ins Verzeichnis C:\Users\BENUTZERNAME\OpenVPN\config sollten:
ca.crt
BENUTZERNAME.crt
BENUTZERNAME.key
client.ovpn:
client

dev tun

proto tcp

remote 192.168.178.27 11934

resolv-retry infinite

nobind

persist-key
persist-tun

ca ca.crt
cert peter.crt
key peter.key

remote-cert-tls server

cipher AES-128-CBC

verb 3

auth-user-pass

Bei remote dann xxx.feste-ip.net eingeben, wenn der Zugriff von Extern erfolgen soll, ansonsten die LAN-IP. Wichtig ist noch das auth-user-pass damit auch nach dem Passwort gefragt wird.

Hier könnte man nun mit TLS-Keys und anderem Fortfahren, um das VPN weiter abzusichern. Auch könnte man bei den Benutzerzertifikaten Challengepasswörter benutzen, die beim Verbindungsaufbau benötigt werden, da wir jedoch Zertifikate+Benutzerpasswort benutzen, würde ich davon abraten. So kann man nämlich ein Zertifikat pro Laptop erzeugen und jeder Benutzer kann sich mit jedem Laptop und seinen Logindaten einwählen theoretisch.

Android Client Config:

Config folgt, App gibt im Google Play
Beachtet, wenn Android und Laptop das gleiche Benutzerzertifikat nutzen und auf Auto-Reconnect stehen werfen sie sich dauernd gegenseitig aus der VPN.

Dienstag, 23. April 2019

Duplikate in Spotify entfernen ohne Playlists / Account zu teilen

Da ich einige Playlists beim Aufräumen meines Spotify Accounts zusammengelegt hab, wobei Duplikate auf Wunsch eigentlich entfernt werden sollten, hatte ich irgendwann eine Playlist mit über 9000 Titeln.
Ziel war diese auszusortieren und dann aufs Smartphone herunterzuladen, um nicht irgendwelche Lieder nur aus einer von vielen Downloadplaylisten zu löschen. Immerhin hat mein aktuelles Smartphone wesentlich weniger Speicherplatz als das letzte. Anscheinend läuft der Desktopclient von Spotify aber beim Kopieren von großen Playlists (bei mir bis zu 1500 Titel pro Liste) ineinander nicht ganz sauber und hängt teilweise, was bei mir dazu geführt hat dass einige Tausend Titel bis zu 3 mal in der neuen Playlist waren, trotz dass ich immer "Duplikate nicht übernehmen" gewählt hatte, was mir beim Aufräumen der Playlist auffiel ("Hach das hab ich doch vor 5 Minuten erst gelöscht?!").

Eine kurze Recherche fand eine sehr einfache Lösung, bei der man seine Playlists auch nirgends freigeben muss oder seine Spotify Accountdaten teilen. Man drückt in der Playlist einfach strg+a, strg+c und fügt dies in Excel / Google Tabellen ein und filtert auf Duplikate. Ich habe Google Tabellen genutzt, hier geht dies mit dem Add-On Remove Duplicates von ablebits.com (Link zum Chrome Webstore ), auch in der Gratis-Testversion. Erstmal hab ich auf Duplikate gefiltert und diese entfernt. Da ich nun jede Menge Lücken in der Liste hatte hab ich nochmal auf Uniques (Einzigartige) gefiltert und diese in ein neues Tabellenblatt verschoben. Soweit ich sehen konnte blieb die Reihenfolge wie vorher.

Zurück zu Spotify (ich nutze hierzu den offiziellen Windows Desktop Client), neue Playlist erstellen, strg+v und fertig.

Mittwoch, 22. Februar 2017

Asus eeebook x205ta Tipps n Tricks for Linux and Windows

Linux/Debian:

http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-rc6-vivid/
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759656
http://blog.einval.com/debian/CDs/Jessie-EFI_6.comments

Windows:

"For some reason they sent the drive encrypted, I went into Windows settings and Unencrypted it. Crystalmark scores went from ~60-80MB which I was pretty disappointed about, to 160MB. I have screens at home showing the change don't have them here to post. If you don't need it encrypted which I'm sure most won't, disable it immediately. Still trying to figure out the low sd speeds a 45MB per sec card is scoring between 12-20MB."

wimboot

turbo-enabled(locked) with charger plugged in

"For people still having problems where the smart gesture software stops working after resume, this seemed to work for me:

Create a .bat file with the following commands:

Code:
taskkill /f /im AsusTPCenter.exe
taskkill /f /im AsusTPHelper.exe
The problem seems to be with these and not AsusTPLauncher. After the .bat runs, AsusTPLauncher will automatically restart those applications.

Put the .bat somewhere where you won't mind leaving it permanently. I put mine in C:\Utility\Scripts\

Now you want to schedule this .bat to run every time the laptop resumes. Press Win + R and enter 'Taskschd.msc' to run the Task Scheduler. Click create basic task, and give it a name. Description is optional. Set trigger to 'When a specific event is logged'. Set log to 'System', source to 'Kernel-Power', and event ID to '507'. On my x205ta I found this event to happen every time it resumed from sleep. I assume it is the same for all x205ta laptops. If you find these instructions do not seem to work for you, if may be that this event does not happen on your x205ta. Try looking up how to use the Event Viewer to find an event that always happens upon resume for you.

Set action to 'start a program'. Set program/script to the .bat file you made. Click next. Check 'open the properties dialog for this task when I click finish'. Click finish.

Click 'change user or group'. If you are on an administrator account, type in 'system' and click ok. If you are not on an administrator account, type in the name of your admin account and click ok. Select 'run whether user is logged in or not'. Check 'run with highest privileges'.

Click on the 'conditions' tab. Uncheck 'start the task only if the computer is on AC power'.

It wouldn't hurt to go to the 'settings' tab and change 'stop the task if it runs longer than' to '1 hour', and 'if the task is already running, then the following rule applies' to 'stop the existing instance' just in case the .bat fails to close on it's own for whatever reason.

Click ok. Enter login credentials if necessary.

If you want to test it to make sure the .bat is actually running each time you resume, add a temporary third command to the .bat:
Code:
echo test>>C:\TEST.txt
Put it to sleep, wake it up, and then check for the TEST.txt file in the root directory of C:\. Subsequent resumes will add a line of text to the file each time.

I imagine this will work for other pc models having this issue with the ASUS SmartGesture software, though you might have to use a different event for the task scheduler.

Hope this helps."

Fix Crosh Window and start as many as you like at the same time

German: Die deutsche Version findet ihr weiter unten.

To Fix the non working Crosh Extension and even add the possibility to open multiple crosh windows and cycle them with alt+tab do this:

From the browser, press crtrl-alt-t. This will bring up crosh in a tab. Then in the upper right browser menu, select 'More Tools > Add to Shelf'. Then right click on the newly added icon in the app shelf, and select 'Open as Window'.

Btw. did you know you can also use the required Secure Shell Extension to open a crosh?
Add a connection for username "crosh" and hostname ">crosh". (Actually, the username can be anything).
credits to Dale Brayden and the ChromeOS Mailinglist

[German]

Momentan funktioniert in aktuellen Chrome OS Versionen die Crosh Erweiterung nicht mehr. Um sie zu reparieren und die Möglichkeit zu haben mehrere Fenster gleichzeitig zu haben und mit alt+tab wechseln zu können:
Startet die Crosh im Browser mit strg+alt+t . Wählt nun im Chrome Menü rechts oben (die drei Punkte bzw Striche) "Weitere Tools" -> "Zu Ablage hinzufügen..." und macht ein Häkchen bei "In neuem Fenster öffnen". Damit startet ihr nun die Crosh ohne Erweiterung. Soviele Fenster wie ihr wollt und die Shortcuts F1-F11 funktionieren auch.

Übrigens, wusstet ihr, dass ihr auch über die Secure Shell Extension eine Crosh starten könnt?
Verbindet euch einfach mit dem Nutzernamen "crosh" zum Hostnamen ">crosh". (Theoretisch ist der Nutzername beliebig)

Danke an Dale Brayden und die ChromeOS Mailingliste

Mittwoch, 17. August 2016

Wdmycloud Tipps n Tricks

This Article is a Guide to disable Thumbnailer/Mediaserver for more ressources and a mostly very-responsive WebUI, (half)automatic Backups to USB-Disk and somewhat hidden Twonkysettingspage.

Disable Thumbnailer and mediaserver for Mycloud-Feature files.mycloud.com and get rid of the generated Files: 

Stop them:
/etc/init.d/wdmcserverd stop 
/etc/init.d/wdphotodbmergerd stop 
Prevent them from restarting*:
chmod 644 /etc/init.d/wdmcserverd 
chmod 644 /etc/init.d/wdphotodbmergerd 
Delete Mediadatabase:
cd /mnt/HD/HD_a2/ 
(make sure you're switched inside the right folder with the command "pwd" if unsure, then:)
rm -rf .wdmc 

Of course you can combine this as one command, but accidentially wiping something other could be very bad. Also you can disable Mycloud Features fully if you don't need them, or use vpn and samba/nfs shares for example.

(Half-)*automated Backup to external disk:

mkdir a folder on localdisk or usbdisk (should be /mnt/HD/HD_a2/ and /mnt/USB/USB1_b2/, if not change the script below accordingly) and create a file there with vi /usr/local/config/backup-rsync.sh and insert this file:

(because this blog breaks some lines into two: if theres no empty line in between insert as a single line, especially the rsync line.)
#!/bin/bash 

mkdir /mnt/USB/USB1_b2/rsyncbackup/ 

touch /mnt/USB/USB1_b2/rsyncbackup.running 

rsync -avR --no-perms --no-owner --no-group --delete /mnt/HD/HD_a2/ /mnt/USB/USB1_b2/rsyncbackup/ 

echo "completed at" >> /mnt/USB/USB1_b2/rsyncbackup.log 

date >> /mnt/USB/USB1_b2/rsyncbackup.log 

rm /mnt/USB/USB1_b2/rsyncbackup.running 

Now edit crontab for autostart. First Number (10) marks the minutes, second number (0) the hour. So 18:10 or 6:10pm would be "10 18 * * *"
crontab -e: 
10 0 * * * /usr/local/config/backup-rsync.sh >> /mnt/USB/USB1_b2/rsyncbackup.log 2>&1 

 You can also start it only once by making a crontab entry for the next minute and deleting it from crontab while running. Because the installed linux don't have screen/tmux and so you don't need to stay connected till the rsync is finished (2TB could take 20-30 hours) on first sync... next syncs would be only incremental. 

Access Twonkysettings and Previewpage on Port 9000.

With defaultsettings this is http://wdmycloud:9000/


More Tipps soon if i find out more.
(credits to https://community.wd.com/t/hidden-wdmc-directories-created-by-mcserver-and-photodbmerger-and-the-deletion-of-them/91860/19 for wdmediaserver idea)
___
*Service will start again and Crontab gets deleted at reboot, because / is a ramdisk image. (Maybe we can rebuild this, but it would be needed to rebuild after every update - and if the updates are binary patches to this file this would be very bad).

Samstag, 27. September 2014

wlan anleitung n für intel centrino advanced-n 6200 karte

Da im Latitude e6410 unter anderem auch Intel Centrino Karten, genauer die Advanced-N 6200 verbaut werden, heute mal ein Tipp dazu.

Standardmäßig mit Windows 7 Treibern als auch Intel Treibern werden in N-Wlans nur ca 54mbit erreicht und angezeigt.

Nimmt man jedoch das "Wifi Connection Utility" im Startmenü unter "Intel PROSet Wireless" und fügt das(vorher gelöschte) Wlan damit neu hinzu, muss man nur ggf noch auf Profile -> Rechtsklick auf das Netzwerk -> Eigenschaften -> Erweitert -> Bandauswahl -> Gemischtes Band wählen und nach dem Verbinden sollte man nun mit der richtigen Geschwindigkeit verbinden können.
Getestet haben wir mit Windows 7 64 bit den Intel Treibern in Version Wireless_16.11.0_s64