Forward Traffic to Another IP Address

How to Forward Traffic from a Hosting Server to the Virtual Machine using Powershell

When developing a web application, it is important to know how to transfer or forward ports or traffic (Pockets) from a main hosting client to another computer across the network. This is important for setting up a testing environment, for example when you want the Quality Assurance team to access the project you are working on for testing purposes, they will be able to send HTTP request to one specific machine and that machine acts like a proxy that forwards the traffic to another Virtual Machine. The pockets can be then analyzed on the main client (Computer) for security purposes.

Solution:

  1.  Open Powershell as an admin
  2. type: netsh interface portproxy add v4tov4 listenport=5555 connectport=80 connectaddress= 157.166.226.25 protocol=tcp
    This will forward the traffic to the address 157.166.226.25 on port 80, however, the main computer would listen for traffic on port 5555.

    Documentation can be found here.