How to set up NAT Routing on Windows XP

Pēdējais mainījis Valdis Vītoliņš 2011-06-06 20:13

How to set up NAT Routing on Windows XP

Learn how to set up NAT Routing on Windows XP. In Windows there is a tool that is used to manage network stuff like setting IP Addresses, set up routing etc. This tool’s name is netsh (short for network shell). Using netsh you will need 2 NICs (Network Interface Cards), one to connect to the public network(to the Internet) and the other to connect to the private network(to other computers in LAN). So the network schema will look like this:

NAT.jpg

As we see, the machine that has 2 NICs will have routing enabled and will be the other client’s gateway. The clients will connect to their gateway through a switch(if there will be only one client you can use a cross-over cable from gateway’s private NIC to clients NIC).

How to install it?

First we open the Control Panel. If you are using the “Category View” to view icons first go to “Performance and Maintenance” and then “Administrative Tools” otherwise go straight to the “Administrative Tools” then open “Services”. On the list find “Routing and Remote Access”, double click on it and set the Startup type to “Automatic” and click OK. Close the Services window and open the registry editor by going to Start > Run… and typing “regedit” without the “ ”. Click OK and in the window expand to the following path: My Computer > HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > Tcpip > Parameters. Now in the list you will see something like “IPEnableRouter”. Double click on it and turn the value from 0 to 1. Now restart your computer.

You must know the names of your adapters you are using. For the tutorial we will use “Wireless Network Connection” for the public NIC and “Local Area Connection” for the private NIC.

Now we open the command prompt and type the following command to install NAT:

netsh routing ip nat install

Now type the next command to add the public interface:

netsh routing ip nat add interface "Wireless Network Connection" full

And the last command to add the private interface:

netsh routing ip nat add interface "Local Area Connection" private

...and the installation is done!

What about the client’s IP addresses?

Oh yeah! Set an IP to the private NIC of the machine that is doing routing and the clients will use that IP as their default gateway. The client’s IP addresses must be the same subnet as the gateways. Your public NIC’s IP doesn’t need to be changed!

Heres an example of an IP configuration:

NAT-CONF.jpg

As you see the public NIC’s IP address on the routing machine is not the same subnet as the private NIC’s IP address.

Bibliography

  1. http://forum.codecall.net/tutorials/10175-how-set-up-nat-routing-windows-xp.html
  2. http://technet.microsoft.com/en-us/library/bb457077.aspx
Tagi:
Izveidojis Kalvis Apsītis 2008-09-18 15:11
    
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.4 - Documentation