Link to home
Start Free TrialLog in
Avatar of supernova58
supernova58

asked on

Running NAT from command prompt (using netsh)

Hi,
I'd like to know whether there is a way to run and configure NAT from comamnd prompt using netsh???




Thanks
Avatar of purplepomegranite
purplepomegranite
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi supernova58,

You can control many aspects of networking using netsh (full documentation at http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/netsh.mspx).

NAT is usually handled by RRAS on a server, and this is configurable using netsh.

However, your question doesn't make things clear... What exactly are you trying to do, and what is your current set-up?
Avatar of supernova58

ASKER


This latter one (http://gnubox.dnsalias.org/gnubox/sharing.html) is good but it doesn't containt anything about NAT/ICS for dial-up connections.
I preferebly want an example or complete guide to run nat which works on Dial-up too.


They are for unix and MacOS, what I want is the command for Windows Server machines , and using Netsh to run NAT/ICS for dial-up connections.
It's difficult to give an answer without knowing exactly what you are trying to do... my first link is to full documenation for netsh, which contains all the info you should need.  If you need a specific example, please give a specific scenario that you are wanting to deal with.

The scenario is that I have a dialup connection to the internet and I want to start ICS/Nat on that interface through netsh so that other computers on the lan use it.
There is a good guide here: http://technet2.microsoft.com/windowsserver/en/library//528b4062-5b08-4b82-853b-188f4e9f04df1033.mspx

Example of batch script to enable NAT on dial-up interface:

netsh routing ip nat install
netsh routing ip nat add interface "My Dialup Connection" full
netsh routing ip nat add interface "Local Area Connection" private
netsh routing ip dnsproxy install

Just change the interface names to those on your machine.
Oh, and to uninstall the above when no longer needed:

netsh routing ip nat uninstall

in the interfaces it doesn't list any dial up connection (show interface) ! So we cannot find out what to put in 'netsh routing ip nat add interface "My Dialup Connection" full'  as the interface.
The name should be the name as you have given in your Network Connections folder...

No,  and as I've read on some posts  "A dialup connection won't work, use a proxy instead",but I dont' know how to make it,maybe should create a demand-dial interface based on the dialup connection?!
I've looked into this one a bit further, and the problem is that the dial-up connections (e.g. those listed in your Network Connections folder) are not interfaces in RRAS (as you found).

The only dial-up interfaces available to RRAS are demand-dial interfaces (as seen in the RRAS MMC).  This means that what you are doing is only possible on a server (2000 or 2003).  If you are trying to do this on a server, then you should create the demand-dial interface using the RRAS console, you will then be able to use it in the script above.  I don't think it is possible to create a demand-dial interface using netsh, that part must be done through MMC.

So, yes, I think you should create a demand-dial interface!

Let me know how it goes!

You are 100% right,the thing we should be looking for is to create demand dial interface using netsh,is it possible you think?

(cont) it must be possible somehow as ICS in XP does a similar thing.
Unfortunately that is the bit that I don't think it is possible to do.  I've been through all the netsh commands and can't find one that'll do it.  I guess there may be another command to do it, or it may be possible through WMI.  I take it you are essentially after a script to accomplish the task, and not specifically needing to use netsh?
ASKER CERTIFIED SOLUTION
Avatar of purplepomegranite
purplepomegranite
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

yes you are right, I've heard that it's possible to create virtual/demand dial interfaces in netsh, do you know how?If we can make a demand-dial interface it would be solved.