TRS TRS
asked on
Port forward using netsh.exe is not working
Hi guys,
I want to enable port forward on a windows 7 machine using netsh.exe.
IPv6 is enabled.
Firewall is disabled.
I want to redirect traffic from the port 2372 (all interfaces) to 127.0.0.1:2372 .
Actually I want to access to a web service running on 127.0.0.1:2372 from another host on the same LAN.
So I am running as admin cmd and then I am using the following command:
netsh interface portproxy add v4tov4 listenport=2372 connectport=2372 connectaddress=127.0.0.1 protocol=tcp
netsh interface portproxy>show v4tov4
Listen on ipv4: Connect to ipv4:
Address Port Address Port
--------------- ---------- --------------- ----------
* 2372 127.0.0.1 2372
netsh interface portproxy>show helper
Helper GUID DLL Filename Command
-------------------------- ---------- -- ------------ -------
{02BC1F81-D927-4EC5-8CBC-8 DD65E3E38E 8} AUTHFWCFG.DLL advfirewall
{FB10CBCA-5430-46CE-B732-0 79B4E23BE2 4} AUTHFWCFG.DLL consec
{35342B49-83B4-4FCC-A90D-2 78533D5BEA 2} AUTHFWCFG.DLL firewall
{4BD827F7-1E83-462D-B893-F 33A80C5DE1 D} AUTHFWCFG.DLL mainmode
{4D0FEFCB-8C3E-4CDE-B39B-3 2593372729 7} AUTHFWCFG.DLL monitor
{A31CB05A-1213-4F4E-B420-0 EE908B896C B} PEERDISTSH.DLL branchcache
{555EA58E-72B1-4F0A-9055-7 79D0F5400B 2} PEERDISTSH.DLL smb
{00770721-44EA-11D5-93BA-0 0B0D022DD1 F} HNETMON.DLL bridge
{6DC31EC5-3583-4901-9E28-3 7C28113656 A} DHCPCMONITOR.DLL dhcpclient
{8A6D23B3-0AF2-4101-BC6E-8 114B325FE1 7} NETIOHLP.DLL dnsclient
{8B3A0D7F-1F30-4402-B753-C 4B2C7607C9 7} FWCFG.DLL firewall
{44F3288B-DBFF-4B31-A86E-6 33F50D706B 3} NSHHTTP.DLL http
{0705ECA1-7AAC-11D2-89DC-0 06008B0E5B 9} IFMON.DLL interface
{1C151866-F35B-4780-8CD2-E 1924E9F03E 1} NETIOHLP.DLL 6to4
{97C192DB-A774-43E6-BE78-1 FABD795EEA B} NETIOHLP.DLL httpstunnel
{725588AC-7A11-4220-A121-C 92C915E8B7 3} NETIOHLP.DLL ipv4
{500F32FD-7064-476B-8FD6-2 171EA46428 F} NETIOHLP.DLL ipv6
{90E1CBE1-01D9-4174-BB4D-E B97F3F6150 D} NETIOHLP.DLL 6to4
{90E1CBE1-01D9-4174-BB4D-E B97F3F6150 D} NETIOHLP.DLL isatap
{1C151866-F35B-4780-8CD2-E 1924E9F03E 1} NETIOHLP.DLL isatap
{1C151866-F35B-4780-8CD2-E 1924E9F03E 1} NETIOHLP.DLL portproxy
{78197B47-2BEF-49CA-ACEB-D 8816371BAA 8} NETIOHLP.DLL tcp
{1C151866-F35B-4780-8CD2-E 1924E9F03E 1} NETIOHLP.DLL teredo
{F7E0BC27-BA6E-4145-A123-0 12F1922F3F 1} NSHIPSEC.DLL ipsec
{F7E0BC29-BA6E-4145-A123-0 12F1922F3F 1} NSHIPSEC.DLL dynamic
{F7E0BC28-BA6E-4145-A123-0 12F1922F3F 1} NSHIPSEC.DLL static
{1D8240C7-48B9-47CC-9E40-4 F7A0A390E7 1} DOT3CFG.DLL lan
{B572D5F3-E15B-4501-84F2-6 626F762AFB 1} WWANCFG.DLL mbn
{B341E8BA-13AA-4E08-8CF1-A 6F2D8B0C22 9} NETIOHLP.DLL namespace
{00B399EA-447F-4B19-8393-F 9D71D7760F 9} NAPMONTR.DLL nap
{3F8A1180-FF5D-4B5B-934C-D 08DFFBC9CB C} NAPMONTR.DLL client
{B123BAAA-79E9-49FD-AB2C-E 87C56CE4CF F} NAPMONTR.DLL hra
{931852E2-597D-40B9-B927-5 5FFC81A610 4} NETIOHLP.DLL netio
{B7BE4347-E851-4EEC-BC65-B 0C0E87B86E 3} P2PNETSH.DLL p2p
{9E0D63D7-4644-476B-9DAC-D 62F96E0837 6} P2PNETSH.DLL collab
{6ED05238-F6A3-F801-967A-5 CAD6F6CAC5 6} P2PNETSH.DLL contact
{E35A9D1F-61E8-4CF5-A46C-0 F715A9303B 8} P2PNETSH.DLL group
{9AA625FC-7E31-4679-B5B5-D FC67A3510A B} P2PNETSH.DLL database
{FBFC037E-D455-4B8D-80A5-B 379002DBCA D} P2PNETSH.DLL idmgr
{9E0D63D6-4644-476B-9DAC-D 64F96E0137 6} P2PNETSH.DLL pnrp
{1DD4935A-E587-4D16-AE27-1 4E40385AB1 2} P2PNETSH.DLL cloud
{AD1D76C9-434B-48E0-9D2C-3 1FA93D9635 A} P2PNETSH.DLL diagnostics
{6EC05238-F6A3-4801-967A-5 C9D6F6CAC5 0} P2PNETSH.DLL peer
{0705ECA2-7AAC-11D2-89DC-0 06008B0E5B 9} RASMONTR.DLL ras
{42E3CC21-098C-11D3-8C4D-0 0104BCA495 B} RASMONTR.DLL aaaa
{90FE6CFC-B6A2-463B-AA12-2 5E615EC3C6 6} RASMONTR.DLL diagnostics
{13D12A78-D0FB-11D2-9B76-0 0104BCA495 B} RASMONTR.DLL ip
{36B3EF76-94C1-460F-BD6F-D F0178D90EA C} RASMONTR.DLL ipv6
{592852F7-5F6F-470B-9097-C 5D33B61297 5} RPCNSH.DLL rpc
{C07E293F-9531-4426-8E5C-D 7EBBA50F69 3} RPCNSH.DLL filter
{D3E9D893-852F-4E22-B05D-9 9293065773 D} NETTRACE.DLL trace
{C100BECD-D33A-4A4B-BF23-B BEF4663D01 7} WCNNETSH.DLL wcn
{3BB6DA1D-AC0C-4972-AC05-B 22F49DEA9B 6} NSHWFP.DLL wfp
{0BFDC146-56A3-4311-A7D5-7 D9953F8326 E} WHHELPER.DLL winhttp
{B2C0EEF4-CCE5-4F55-934E-A BF60F3DCF5 6} WSHELPER.DLL winsock
{D424E730-1DB7-4287-8C9B-0 774F5AD057 6} WLANCFG.DLL wlan
After these steps I cannot access the web service from another computer on the same LAN.
Port forward doesn't work. Any ideas???
I want to enable port forward on a windows 7 machine using netsh.exe.
IPv6 is enabled.
Firewall is disabled.
I want to redirect traffic from the port 2372 (all interfaces) to 127.0.0.1:2372 .
Actually I want to access to a web service running on 127.0.0.1:2372 from another host on the same LAN.
So I am running as admin cmd and then I am using the following command:
netsh interface portproxy add v4tov4 listenport=2372 connectport=2372 connectaddress=127.0.0.1 protocol=tcp
netsh interface portproxy>show v4tov4
Listen on ipv4: Connect to ipv4:
Address Port Address Port
--------------- ---------- --------------- ----------
* 2372 127.0.0.1 2372
netsh interface portproxy>show helper
Helper GUID DLL Filename Command
--------------------------
{02BC1F81-D927-4EC5-8CBC-8
{FB10CBCA-5430-46CE-B732-0
{35342B49-83B4-4FCC-A90D-2
{4BD827F7-1E83-462D-B893-F
{4D0FEFCB-8C3E-4CDE-B39B-3
{A31CB05A-1213-4F4E-B420-0
{555EA58E-72B1-4F0A-9055-7
{00770721-44EA-11D5-93BA-0
{6DC31EC5-3583-4901-9E28-3
{8A6D23B3-0AF2-4101-BC6E-8
{8B3A0D7F-1F30-4402-B753-C
{44F3288B-DBFF-4B31-A86E-6
{0705ECA1-7AAC-11D2-89DC-0
{1C151866-F35B-4780-8CD2-E
{97C192DB-A774-43E6-BE78-1
{725588AC-7A11-4220-A121-C
{500F32FD-7064-476B-8FD6-2
{90E1CBE1-01D9-4174-BB4D-E
{90E1CBE1-01D9-4174-BB4D-E
{1C151866-F35B-4780-8CD2-E
{1C151866-F35B-4780-8CD2-E
{78197B47-2BEF-49CA-ACEB-D
{1C151866-F35B-4780-8CD2-E
{F7E0BC27-BA6E-4145-A123-0
{F7E0BC29-BA6E-4145-A123-0
{F7E0BC28-BA6E-4145-A123-0
{1D8240C7-48B9-47CC-9E40-4
{B572D5F3-E15B-4501-84F2-6
{B341E8BA-13AA-4E08-8CF1-A
{00B399EA-447F-4B19-8393-F
{3F8A1180-FF5D-4B5B-934C-D
{B123BAAA-79E9-49FD-AB2C-E
{931852E2-597D-40B9-B927-5
{B7BE4347-E851-4EEC-BC65-B
{9E0D63D7-4644-476B-9DAC-D
{6ED05238-F6A3-F801-967A-5
{E35A9D1F-61E8-4CF5-A46C-0
{9AA625FC-7E31-4679-B5B5-D
{FBFC037E-D455-4B8D-80A5-B
{9E0D63D6-4644-476B-9DAC-D
{1DD4935A-E587-4D16-AE27-1
{AD1D76C9-434B-48E0-9D2C-3
{6EC05238-F6A3-4801-967A-5
{0705ECA2-7AAC-11D2-89DC-0
{42E3CC21-098C-11D3-8C4D-0
{90FE6CFC-B6A2-463B-AA12-2
{13D12A78-D0FB-11D2-9B76-0
{36B3EF76-94C1-460F-BD6F-D
{592852F7-5F6F-470B-9097-C
{C07E293F-9531-4426-8E5C-D
{D3E9D893-852F-4E22-B05D-9
{C100BECD-D33A-4A4B-BF23-B
{3BB6DA1D-AC0C-4972-AC05-B
{0BFDC146-56A3-4311-A7D5-7
{B2C0EEF4-CCE5-4F55-934E-A
{D424E730-1DB7-4287-8C9B-0
After these steps I cannot access the web service from another computer on the same LAN.
Port forward doesn't work. Any ideas???
you can't use 127.0.0.1 address, it's loopback,
use 192.168.0.1 or similar address
and your LAN must be on same subnet
use 192.168.0.1 or similar address
and your LAN must be on same subnet
or you can use listen address
example
netsh interface portproxy add v4tov4 listenaddress=10.255.255.1 listenport=445 connectaddress=10.255.255. 1 connectport=44445
example
netsh interface portproxy add v4tov4 listenaddress=10.255.255.1
ASKER
@ded9
I had already tried your command without any result.
@M3rc74
Yeah, I was afraid that I couldn't use 127.0.0.1 even if I wanted to use it exactly that IP.
What if :
netsh interface portproxy add v4tov4 listenaddress=172.16.XX.XX X listenport=445 connectaddress=127.0.0.1 connectport=445
It doesn't work too. Is this a loopback again?
So what should I do,in order to access that web service from another host? It is running on 127.0.0.1 interface and I cannot change its configuration.
Installing third party software is the only option?
I had already tried your command without any result.
@M3rc74
Yeah, I was afraid that I couldn't use 127.0.0.1 even if I wanted to use it exactly that IP.
What if :
netsh interface portproxy add v4tov4 listenaddress=172.16.XX.XX
It doesn't work too. Is this a loopback again?
So what should I do,in order to access that web service from another host? It is running on 127.0.0.1 interface and I cannot change its configuration.
Installing third party software is the only option?
try
netsh interface portproxy add v4tov4 listenaddress=172.16.XX.XX X listenport=445 connectaddress=127.0.0.1 connectport=445
and then
netsh interface portproxy>show v4tov4
netsh interface portproxy add v4tov4 listenaddress=172.16.XX.XX
and then
netsh interface portproxy>show v4tov4
i'm thinking
you can add on that interface secundary IP address: 127.0.0.1
you can add on that interface secundary IP address: 127.0.0.1
netsh interface portproxy add v4tov4 listenport=12345 listenaddress=192.168.1.1 connectport=443 connectaddress=192.168.1.1
is the service in fact listening on the port 2372 if it is then you shouldn't need the portproxy as it is a non standard port and the listen and connect ports are the same. In my example I remapped https to another port for a service that handles these requests.
The client must access the web service via 192.168.1.1 (in my example)
It sounds like you need to map from localhost on the client machine to the machine that the service is running on.
on the client machine
netsh interface portproxy add v4tov4 listenport=12345 listenaddress=127.0.0.1 connectport=12345 connectaddress=192.168.1.1
is the service in fact listening on the port 2372 if it is then you shouldn't need the portproxy as it is a non standard port and the listen and connect ports are the same. In my example I remapped https to another port for a service that handles these requests.
The client must access the web service via 192.168.1.1 (in my example)
It sounds like you need to map from localhost on the client machine to the machine that the service is running on.
on the client machine
netsh interface portproxy add v4tov4 listenport=12345 listenaddress=127.0.0.1 connectport=12345 connectaddress=192.168.1.1
ASKER
@M3rc74
127.0.0.1 cannot be accepted as a secondary IP on my interface.
netsh interface portproxy>show v4tov4
Listen on ipv4: Connect to ipv4:
Address Port Address Port
--------------- ---------- --------------- ------
192.168.1.1 2372 127.0.0.1 2372
@ve3ofa
netsh interface portproxy add v4tov4 listenport=2372 listenaddress=127.0.0.1 connectport=2372 connectaddress=192.168.1.1
netsh interface portproxy>show v4tov4
Listen on ipv4: Connect to ipv4:
Address Port Address Port
--------------- ---------- --------------- ----------
127.0.0.1 2372 192.168.1.1 2372
It doesn't work. It doesn't accept connection on 192.168.1.1 interface.
Actually there is no need to use a different port. I want to use the same (the original) which is 2372.
I have tried both versions and none worked.
My web service is running by default on 127.0.0.1:2372 .
My network interface has the IP 192.168.1.1 .
I just want be able to access the web service using 192.168.1.1:2372 .
127.0.0.1 cannot be accepted as a secondary IP on my interface.
netsh interface portproxy>show v4tov4
Listen on ipv4: Connect to ipv4:
Address Port Address Port
--------------- ---------- --------------- ------
192.168.1.1 2372 127.0.0.1 2372
@ve3ofa
netsh interface portproxy add v4tov4 listenport=2372 listenaddress=127.0.0.1 connectport=2372 connectaddress=192.168.1.1
netsh interface portproxy>show v4tov4
Listen on ipv4: Connect to ipv4:
Address Port Address Port
--------------- ---------- --------------- ----------
127.0.0.1 2372 192.168.1.1 2372
It doesn't work. It doesn't accept connection on 192.168.1.1 interface.
Actually there is no need to use a different port. I want to use the same (the original) which is 2372.
I have tried both versions and none worked.
My web service is running by default on 127.0.0.1:2372 .
My network interface has the IP 192.168.1.1 .
I just want be able to access the web service using 192.168.1.1:2372 .
ASKER
Do you know any software that could run as a service and help me on that?
Nothing going through the loopback adapter goes out to the Internet, or leaves your system. The loopback adapter is completely contained within your system.
You must have some options to change this, is there an *.ini file or something to edit listening address?
You must have some options to change this, is there an *.ini file or something to edit listening address?
if the service is running on your computer then from elsewhere you would need to use the netsh port forward on the other computers to access the service.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The only stable and working solution.
netsh interface portproxy>add v4tov4 listenport=2372 connectaddress=127.0.0.1 connectport=2372 protocol=tcp
Ded9