winse@DESKTOP-ADH7K1Q:~/bigendian$ cat VPN-Route.bat
@setlocal enableextensions enabledelayedexpansion
rem teamviewer.exe -i <ID> -P <Password> [-m fileTransfer/vpn]
start "teamviewer" "C:\Program Files (x86)\TeamViewer\TeamViewer.exe"
ping -n 1 !teamvpnipaddr! | find "TTL"
if not errorlevel 1 goto :run
if errorlevel 1 goto :endloop
ping -n 2 127.0.0.1 >nul: 2>nul:
route delete 192.168.193.0
route add 192.168.193.0 mask 255.255.255.0 !teamvpnipaddr! metric 1
Hello everybody, I investigated a lot for this issue.
Establish a VPN session with TeamViewer to my home pc (remote side) and try to get access to this local network from my working place (local side).
I found an solution i never read anywhere before. Since Windows 7 has removed NAT option using netsh it is difficult to solve it with windows on board tools only.
- Install TeamViewer incl. VPN driver on both sides, activate unattended access on the remote side (my home pc). Use the button Show advanced options, and go to Advanced network options … Install VPN driver
- Install WinPkFilter Device Driver on remote side (my home pc) and restart (http://www.nat32.com/v2/install.htm Download installer: http://www.ntkernel.com/downloads/winpkflt_rtl.zip . NAT32 you don't need. This WinPkFilter package contains a simple GUI to configure the NAT between the VPN interface (client) and the remote side LAN interface (provider). see following hints ...
- Windows: Start RemoteAccess - service 'Routing an Remote Access' and set to automatic (local/remote side).
- Optional: On the remote side (my home pc), the registry has to be modified. Start the registry editor for example by Regedt32, and browse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters Set the parameter IPEnableRouter to “1”. Using console or batch as admin: reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "IPEnableRouter" /t REG_DWORD /d "1". On my system it worked without this option, but according internet forums it seems to be recommended.
- Now create a remote desktop session to your home pc and start also the VPN connection within this TeamViewer session (Menu / Extras / VPN). I created a free TeamViewer account and added all pc's to my computers to make the access to my machines easier.
- On remode side (my home pc) where WinPkFilter is installed start the Internet Gateway GUI of WinPkFilter: Start / Programms / WinpkFilter / Internet Gateway. Select (double click) the ethernet adapter of your local privat lan and set NAT Status to 'Provider'. Select the TeamViewer VPN adapter and set NAT Status to 'client'. Press 'Start NAT'
- On local side (my working place) Add a route to the local side (my working place) to give access to several devices that have the same subnet, add the route like this:
route add <base IP of remote devices> mask 255.255.255.0 <IP of Teamviewer VPN on remote PC>
Example (home lan ip range: 192.168.2.x / TeamViewer VPN IP in home pc (remote side) 126.96.36.199
route add 192.168.2.0 mask 255.255.255.0 188.8.131.52 metric 1 <ENTER>
route add 192.168.2.0 mask 255.255.255.0 184.108.40.206 metric 1 -p <ENTER> (if persistent)
Do delete the route route delete 192.168.2.0
Now you should have access to your private home network. Good luck and have fun.