+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: How to set up NAT Routing on Windows XP

  1. #1
    Join Date
    Nov 2006
    Location
    Kosovo
    Posts
    448
    Rep Power
    28

    How to set up NAT Routing on Windows XP

    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:



    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:

    Code:
    netsh routing ip nat install
    Now type the next command to add the public interface:

    Code:
    netsh routing ip nat add interface "Wireless Network Connection" full
    And the last command to add the private interface:

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



    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

    Best wishes,
    Dren

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Join Date
    Jan 2008
    Posts
    1,725
    Blog Entries
    4
    Rep Power
    29

    Re: How to set up NAT Routing on Windows XP

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

    Thanks +rep

  4. #3
    Join Date
    Nov 2006
    Location
    Kosovo
    Posts
    448
    Rep Power
    28

    Re: How to set up NAT Routing on Windows XP

    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

  5. #4
    gaylo565's Avatar
    gaylo565 is offline Programming Professional
    Join Date
    May 2007
    Location
    flagstaff, az
    Posts
    268
    Rep Power
    21

    Re: How to set up NAT Routing on Windows XP

    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)

  6. #5
    Join Date
    Nov 2006
    Location
    Kosovo
    Posts
    448
    Rep Power
    28

    Re: How to set up NAT Routing on Windows XP

    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

  7. #6
    abasel is offline Newbie
    Join Date
    Sep 2008
    Posts
    1
    Rep Power
    0

    Re: How to set up NAT Routing on Windows XP

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

  8. #7
    Join Date
    Nov 2006
    Location
    Kosovo
    Posts
    448
    Rep Power
    28

    Re: How to set up NAT Routing on Windows XP

    Did you type this command:

    netsh routing ip nat install

  9. #8
    Join Date
    Jun 2007
    Location
    Kosovo
    Posts
    660
    Rep Power
    23

    Re: How to set up NAT Routing on Windows XP

    Great Tutorial seen this before

  10. #9
    Dorin is offline Newbie
    Join Date
    Jan 2009
    Location
    Bucharest
    Posts
    2
    Rep Power
    0

    Unhappy Re: How to set up NAT Routing on Windows XP

    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?

  11. #10
    Dorin is offline Newbie
    Join Date
    Jan 2009
    Location
    Bucharest
    Posts
    2
    Rep Power
    0

    Re: How to set up NAT Routing on Windows XP

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

    seems i was figuring right

+ Reply to Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Similar Threads

  1. Open Source Routing (DD-WRT) projects
    By Mr_DD-WRT in forum General Programming
    Replies: 1
    Last Post: 10-27-2009, 05:30 AM
  2. Mapping and Routing Software
    By nickstoner in forum General Programming
    Replies: 6
    Last Post: 11-13-2007, 09:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts