3

I've been trying to get netsh forward a port on the lan interface to another port on 127.0.0.1 The reason for this is that I need external machines to ssh into my vagrant virtual machine and I don't want to configure vagrant with an extra interface (In some offices I have to work, the vagrant vm won't be allowed to get an ip from the lan)

So I want to listen from say 4444 on my lan or wireless connection and redirect that to 127.0.0.1:2222 which is the only interface/port vagrant listens to by default.

Despite seeing many examples and people reporting success, my attempts have failed. When I do:

C:\Windows\system32>netsh interface portproxy  add v4tov4 listenport=4444 connectport=2222 connectaddress=127.0.0.1

Things seem to work. See:

    C:\Windows\system32>netsh interface portproxy show all

Listen on ipv4:             Connect to ipv4:

Address         Port        Address         Port
--------------- ----------  --------------- ----------
*               4444        127.0.0.1       2222

this is windows 7 which should have ipv6 out of the box. I can see from the adapter properties that ipv6 is enabled for the adapter.

I've seen some responses in forums claiming 127.0.0.1 won't work with netsh but Google searches bring many result that claim success. So is it possible to do this with netsh under windows 7 or not?

UPDATE: For some reason I don't have the option to answer my own question. So I'm updating the question. I've given up on doing this via netsh and used PassPort. Works like a charm, but it must be run as Administrator under Windows 7.

0

You must log in to answer this question.

Browse other questions tagged .