Skip to content

Instantly share code, notes, and snippets.

@manueldev
Last active June 3, 2024 05:32
Show Gist options
  • Save manueldev/2e4b45766abd584754ad6d537c95a64c to your computer and use it in GitHub Desktop.
Save manueldev/2e4b45766abd584754ad6d537c95a64c to your computer and use it in GitHub Desktop.
netsh interface portproxy add v4tov4 listenport=8001 connectport=80 connectaddress=127.0.0.1
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name="Open Port 443" dir=in action=allow protocol=TCP localport=443
netsh interface portproxy add v4tov4 listenport=9001 connectport=443 connectaddress=192.168.168.1
netsh advfirewall firewall add rule name="Open Port 9001" dir=in action=allow protocol=TCP localport=9001
netsh advfirewall firewall add rule name="Open Port 8888" dir=in action=allow protocol=TCP localport=8888
netsh advfirewall firewall add rule name="Open Port 15179" dir=in action=allow protocol=TCP localport=15179
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=9002 connectport=22 connectaddress=192.168.168.1
netsh advfirewall firewall add rule name="Open Port 9002" dir=in action=allow protocol=TCP localport=9002
netsh interface portproxy add v4tov4 listenport=9003 connectport=443 connectaddress=192.168.8.1
netsh advfirewall firewall add rule name="Open Port 9003" dir=in action=allow protocol=TCP localport=9003
netsh interface portproxy add v4tov4 listenport=9004 connectport=443 connectaddress=192.168.9.1
netsh advfirewall firewall add rule name="Open Port 9004" dir=in action=allow protocol=TCP localport=9004
@manueldev
Copy link
Author

netsh interface portproxy add v4tov4 listenport=9005 connectport=80 connectaddress=192.168.168.40
netsh advfirewall firewall add rule name="Open Port 9005" dir=in action=allow protocol=TCP localport=9005

@manueldev
Copy link
Author

duplicate port

netsh interface portproxy add v4tov4 listenport=10001 connectport=10000 connectaddress=127.0.0.1
netsh advfirewall firewall add rule name="Open Port 10001" dir=in action=allow protocol=TCP localport=10001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment