Last active
October 5, 2024 00:01
-
-
Save alirezanet/6994199a56194a23fa31916857726878 to your computer and use it in GitHub Desktop.
netsh ip/port forwarding sample
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
add forwarding interface: | |
netsh interface portproxy add v4tov4 listenport={srcPort} listenaddress={srcIp} connectport={DesPort} connectaddress={DesIp} | |
show interface: | |
netsh interface portproxy show v4tov4 | |
delete interface: | |
netsh interface portproxy delete v4tov4 listenport={srcPort} listenaddress={srcIp} | |
----------------------------- | |
add firewall rule: | |
netsh advfirewall firewall add rule name="{ruleName}" protocol=TCP dir=in localip={srcIp} localport={srcPort} action=allow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment