0

On my Windows PC (192.168.1.123) , I have an application that connects to 1.2.3.4 on port 3333 by default, I would like to redirect the traffic to 127.0.0.1 port 2222.

Under Linux, this can be accomplished by entering this on my PC.

iptables -t nat -A OUTPUT -s 192.168.1.123 -p tcp -d 1.2.3.4 --dport 3333 -j DNAT --to-destination 127.0.0.1:2222 

Is there a way to do the above on Windows?

2
  • What version of windows are you running? I'm not sure this is possible without additional software on windows (if at all).
    – Seth
    Dec 1, 2016 at 8:35
  • on linux this is possible with nc like nc -l 1234 | nc 1.2.3.4 5678 and you can get nc on windows with cygwin and possibly with gow. Another way in windows is with the netsh command , something like netsh add v4tov4 listenport.......... . you can google that netsh command.
    – barlop
    Dec 1, 2016 at 11:31

1 Answer 1

0

on linux this is possible with nc like nc -l 1234 | nc 1.2.3.4 5678 and you can get nc on windows with cygwin

An alternative to nc is in windows with the netsh command

it's mentioned here

https://stackoverflow.com/questions/11525703/port-forwarding-in-windows

netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=80 connectaddress=192.168.0.33

1
  • Ive read somewhere that the netsh solution only works if you're receiving then forwarding traffic. Did I interpret it wrong by any chance? I'll try the nc command in abit.
    – leroy627
    Dec 4, 2016 at 10:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .