Created
June 22, 2016 03:09
-
-
Save timyhac/bce0b76805f9e5e22fefe7ac9c599867 to your computer and use it in GitHub Desktop.
Set up and teardown port forwarding to a remote target PC on a VPN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set LISTENADDRESS=10.40.1.10 | |
set CONNECTADDRESS=10.1.1.20 | |
netsh interface portproxy add v4tov4 listenport=80 listenaddress=%LISTENADDRESS% connectport=63000 connectaddress=%CONNECTADDRESS% | |
netsh interface portproxy add v4tov4 listenport=2222 listenaddress=%LISTENADDRESS% connectport=63001 connectaddress=%CONNECTADDRESS% | |
netsh interface portproxy add v4tov4 listenport=44818 listenaddress=%LISTENADDRESS% connectport=63002 connectaddress=%CONNECTADDRESS% | |
netsh interface portproxy show all | |
pause | |
netsh interface portproxy delete v4tov4 listenport=80 listenaddress=%LISTENADDRESS% | |
netsh interface portproxy delete v4tov4 listenport=2222 listenaddress=%LISTENADDRESS% | |
netsh interface portproxy delete v4tov4 listenport=44818 listenaddress=%LISTENADDRESS% | |
netsh interface portproxy show all | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment