netsh portmapping on XP

U

ultralame

I would like to configure portmapping on XP (Home and Pro) using netsh.
ICS is not an option on this network.

According to all the info I can find, it should be forwarding. But
it's not working.
(I have tried rebooting, although I don't think that should be
necessary).

If someone knows how to make this work through netsh, please let me
know. Also, while I appreciate other solutions, third party apps
(other than those that can just act as front ends for netsh) will not
work. This needs to be performed at the system level, and I cannot
count on a logged in user or other memory resident program to be
running.

Thanks in advance!

Info:
I have perfromed the following (tried it on both XP Pro and XP home
systems):

1) I edited the registry as per:
http://www.winnewsgroups.net/link.a...crosoft.com/default.aspx?scid=kb;en-us;315236
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\IPEnableRouter=1

2) I ran the following commands:
('Gigabit' is the name of the public interface I want to forward)

netsh routing ip nat install
netsh routing ip nat add interface Gigabit full
netsh routing ip nat add interface Internal private

(entered on one line):
add portmapping
name="Gigabit"
proto=TCP
publicip=0.0.0.0
publicport=80
privateip=192.168.1.10
privateport=80

HEre's the result of:
netsh routing ip nat>dump
# ----------------------------------
# NAT configuration
# ----------------------------------
pushd routing ip nat
uninstall
install
set global tcptimeoutmins=1440 udptimeoutmins=1 loglevel=ERROR


#
#NAT Configuration For Interface Gigabit
#
add interface name="Gigabit" mode=FULL
add portmapping name="Gigabit" proto=TCP publicip=0.0.0.0 publicport=80
privateip=192.168.1.10 privateport=80


#
#NAT Configuration For Interface Internal
#
add interface name="Internal" mode=PRIVATE


popd





Here is the result of:
C:\>netsh routing ip nat show interface Gigabit

NAT Gigabit Configuration
---------------------------
Mode : Address and Port Translation


NAT Static Port Mapping Configuration
-------------------------------------
Protocol : TCP
Public address : 0.0.0.0
Public port : 80
Private address : 192.168.1.10
Private port : 80

(Note, the Gigabit interface has an IP of 192.168.1.3. I have tried to
connect via both the public port and the loopback. Neither works).
 
U

ultralame

Well, I figured it out for XP, and I got the help from
http://wiki.colinux.org/mediawiki/index.php/StepByStepInXP

Note: In my case, I am forwarding a port on the standard "Local Area
Connection" interface to a the MS Loopback Adapter, which has been
configured with a different subnet. This is due to a piece of software
that will only run on a specific IP that is not on my physical subnet.

Here's what you have to do in XP:

1) Change the registry Key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\IPEnableRouter=1


2) Disable the Windows Firewall/ICS:
Service name: "Windows Firewall/Internet Connection Sharing (ICS)"

3) Start the Routing and Remote Access Service.

4) Run these commands:
netsh routing ip nat install
netsh routing ip nat add interface "Local" full
netsh routing ip nat add interface "Virtual" private
(Note:
If you are forwarding to another machine, you do not need the second
interface)

netsh routing ip nat add portmapping "Local" tcp 0.0.0.0 PORT
DESTINATION-IP PORT

For example:
netsh routing ip nat add portmapping
"Local Area Connection"
tcp
0.0.0.0
80
192.168.1.20
80
(on one line)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top