Jump to content




Recent Status Updates

  • Photo
      30 Sep
    rhossis

    laptop hard disk seated beneath motherboard but with no access panel. 7 hours to replace :(

    Show comments (3)
  • Photo
      19 Sep
    Chall

    I love it when you go to write a help thread, then while writing, you reach an enlightenment, and figure it out yourself.

    Show comments (3)
View All Updates

Developed by TechBiz Xccelerator
Photo

How to set up NAT Routing on Windows XP


  • Please log in to reply
20 replies to this topic

#1 Dren

Dren

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 232 posts

Posted 15 September 2008 - 06:08 AM

Hello again! I decided to stop making programming tutorials for a couple of days so in this tutorial you will learn how to set up NAT Routing on Windows XP. Some of you know that some time ago I was working on a project in Visual Basic 6 that would do this thing. So, 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:

Posted Image

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).


Now 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:

Posted Image

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. So be careful, the mustn’t be!


I hope you will find this thread useful and save some money buying routers. If you want to set up a wireless router then check the tutorials session later because I’ll be talking about creating ad-hoc wireless networks on Windows XP.

PS: I'm sorry if you don't like my computers on the schemes, I've drawn them in Paint, lol :D

Best wishes,
Dren
  • 5

#2 morefood2001

morefood2001

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,011 posts

Posted 15 September 2008 - 07:02 AM

I've done this many times through the gui interface, but I never knew those command line commands existed.

Thanks :D +rep
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#3 Dren

Dren

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 232 posts

Posted 15 September 2008 - 08:12 AM

Ow, I really didn't know that there was a GUI form of doing this on Windows XP, only in Server 200 & 2003 :$

Anyway, THANK YOU SO MUCH for +rep :D
  • 1

#4 gaylo565

gaylo565

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 258 posts

Posted 16 September 2008 - 07:21 AM

I have had to do this a time or two to work around some other problems and it is a usefull network setup to know how to work with. +rep as well (i need to spread some around or it won't let it give more to the folks who always help me; oh yeah, this is also a quality tutorial:))
  • 0

#5 Dren

Dren

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 232 posts

Posted 16 September 2008 - 07:32 AM

Thanks gaylo565 :) You are right! Sometimes you have to set a network fast and this helps. I have finished the project I was talking in the tutorial and since then I earned quite a lot from sharing Internet connections :)
  • 0

#6 abasel

abasel

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 25 September 2008 - 01:02 PM

All seems to go fine until I try the last comment which returns the error "NAT must be installed first"
  • 0

#7 Dren

Dren

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 232 posts

Posted 10 October 2008 - 01:41 PM

Did you type this command:

netsh routing ip nat install


  • 0

#8 kresh7

kresh7

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 326 posts

Posted 10 October 2008 - 02:02 PM

Great Tutorial seen this before ;)
  • 0
Posted Image

#9 Dorin

Dorin

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 08 January 2009 - 12:14 PM

hi dren

kewl hacks, no doubt about it

any insider info about the port forwarding settings?

in ics there is an advanced tab where you set up port forwarding

this feature DOES NOT WORK on my machineS!!
i'm looking for internals to this process, to possibly figure out what's wrong

any clues?
was there port forwarding in w2k?

many thanks


ps. hey, what's the deal with the photo in the avatar?
i'm guessing your father/grandfather

but that uniform is in no way american!, looks eastern european? did your family come from there?
  • 0

#10 Dorin

Dorin

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 08 January 2009 - 12:21 PM

:eek: how dumbo i am :D
i didn't look to the right of the avatar

seems i was figuring right
  • 0

#11 mendim.

mendim.

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 741 posts

Posted 31 January 2009 - 03:17 PM

Great Tutorial ... +rep.
  • 0

#12 iLeone

iLeone

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 16 April 2009 - 05:08 PM

Very Useful Tutorial... thx a lot.

Can u explain me how roll back that steps?

(Sorry, i know... this post is "old")
  • 0




Powered by binpress