Summary Network Address Translation (NAT)

Network address translation offers the ability to share one internet connection with a public ip address with various computers that use private ip addresses.

Public addresses are addresses that are assigned by the InterNIC. These addresses are unique on the internet. Private addresses are addresses that could be used on the internal network. They can be used for machines that do not directly access the internet. (See RFC 1918) The following ranges of private ip addresses can be used :

bullet10.0.0.0 - 10.255.255.255 subnet 255.0.0.0
bullet172.16.0.0 - 172.31.255.255 subnet 255.240.0.0
bullet192.168.0.0 - 192.168.255.255 subnet 255.255.0.0 (default used by NAT)

These private addresses cannot be reached via the internet as they are not known within the internet routers. The clients using these addresses should use a proxy server or NAT to reach the internet.

You can install NAT as a routing protocol in the Routing and Remote Access snap-in.

NAT consists of the following components :

bulletTranslation component. This component translates ip addresses and tcp/udp packets port numbers that are transfered between the private network and internet.
bulletAddressing component. This component is called the DHCP allocator. It provides ip addresses to the clients on the network by acting as a simplified DHCP server. It provides the clients the following data :
bulletSubnet mask. 255.255.0.0 (option 0)
bulletRouter (default gateway). IP address of private interface of NAT server (Option 3)
bulletDNS server. IP address of private interface of NAT server, only if DNS proxy is enabled. (Option 6)
bulletDNS domain. Primary domain name of NAT server (Option 15)
bulletIP address lease time. 7 days (Option 51)
bulletRenewal time. 5 minutes (Option 58)
bulletRebinding time. 5 days (Option 59)

You cannot modify or extend these options. The DHCP allocator does not support more than one scope, superscopes or multicast scopes.

bulletName resolution component. The NAT server acts as a DNS proxy for the clients. It forwards the DNS requests of the clients to the internet DNS server.

NAT can use static and dynamic mappings. A static mapping is used when the internal client (private ip address) and the public internet address are always the same. Dynamic mappings are created when a client on the internal network (private ip address) makes a connection with the internet. In this case an entry is created in the NAT mapping table. If these entries are not refreshed, they are removed from the mapping table. The default time-out for TCP connections is 24 hours, the default time out for UDP connections is 1 minute.

When NAT translates IP addresses and TCP/UDP ports, the following fields in the IP, TCP and UDP headers are modified :

bulletSource IP address
bulletTCP, UDP and IP checksum
bulletSource port

As there are protocols and application that also carry IP or port addressing within their headers, NAT editors are required. These editors translate the additional IP information in the headers. Windows 2000 contains NAT editors for :

bulletICMP
bulletFTP. FTP stores ip address information in the FTP header.
bulletNetBIOS of TCP/IP
bulletPPTP

The NAT routing protocol includes proxy software for the following protocols :

bulletDirect play
bulletH.323
bulletLDAP based Internet Locator Service (ILS) registration
bulletRemote procedure call

If there is no NAT editor available for a protocol or application, you can transport the data in a tunnel via the L2TP or PPTP protocol.

Process of handling outbound traffic :

bulletNAT checks if there is already a static or dynamc mapping. If not, a new dynamic mapping is created.
bulletWhen creating the new dynamic mapping it checks if there are multiple public ip addresses are avaible. If there is still one available that public ip address is used. In this situation the ports are not translated. If there is only one public ip address available or if all public ip addresses are already used, NAT request a unique TCP or UDP port for the mapping.
bulletNAT checks if a NAT editor is needed. If so, the NAT editor modifies the packets.
bulletNAT translates TCP or UDP, modifies the source port if needed and updates the checksum.

You can install NAT by using a wizard when installing the Routing and Remote Access service. If RRAS is already installed you can install NAT via the following steps :

bulletConfigure the ip address of the home network interface with the ip address of 192.168.0.1, subnet mask 255.255.255.0 and no default gateway. If you choose to use another ip address, e.g. 10.0.0.1 or 172.16.0.1, you have to change address range that is assigned to the clients.
bulletEnable routing on the dial-up port. If you are using a permanant internet connection that appears like a LAN interface or a router connected to the internet, create a default static route on this interface. The destination and network mask should be 0.0.0.0.
If you are using a demand-dail interface, you first have to create dail-up connection that is enabled for routing.
bulletAdd the NAT protocol via the Routing and Remote Access snap-in. Select the server, ip routing and general. Right-click on General to add a new routing protocol.
bulletAdd the home- and internet network interface to the NAT routing protocol.
bulletEnable NAT addressing and name resolution via the Routing and Remote Access snap-in. Right-click NAT to select Properties. In the Address Assignment tab select 'Automatically assign ip addresses by using DHCP' and configure the DHCP range.
bulletIf you are using multiple public ip addresses, you have to configure Address Pool tab of the NAT properties.
bulletIf you want to allow inbound connections, you have to take the following actions :
bulletConfigure the server to which a connection must be possible with an static ip address within the range allocated by the NAT server, a subnetmask, a default gateway (the private address of the NAT server) and a DNS server. (the private ip address of the NAT server). Exclude the ip address from the ip range offered by the NAT server.
bulletConfigure a special port via the Routing and Remote Access snap-in by selecting the properties of the network interface. Select the Special Ports tab, select TCP or UDP in Protocol and click Add.
bulletIn the Incoming Port type the port number of the incoming traffic.
bulletIf a range of public ip addresses is configured select the public ip address from the On This Address Pool Entry.
bulletIn the Outgoing Port, enter the port number of the server in the private network to which the connection from the internet should be possible.
bulletIn the Private Address, enter the ip address of the server in the private network to which the connection should be possible from the internet.

After NAT is installed you can customize it on the following tabs :

bulletGeneral
bulletEvent logging. Log errors only (default), log errors and warnings, log the maximum amount of information and disable event logging.
bulletTranslation
bulletRemove tcp mappings after xx minutes. Default 1440 minutes.
bulletRemove udp mappings after xx minutes. Default 1 minute.
bulletReset default button. 
bulletApplications button. Reserve ports for specific applications.
bulletAddress assignment
bulletAutomatically assign ip addresses by using DHCP. (default off)
bulletSet ip address and mask. (default 192.168.0.0 mask 255.255.255.0)
bulletExclude button. Exclude ip addresses from the range.
bulletName resolution
bulletResolve ip addresses for clients using DNS. (default off) When activated you can specify to connect via a demand-dial interface if required.

NAT does not work with Ipsec of Kerberos.

More information

Related white papers 

bullet Developing NAT friendly applications
bullet Overview of Network Address Translation in Windows XP

Microsoft support articles

bulletSupport webcast: Network address translation deployment and features
bulletSupport webast: Windows 2000: New features in TCP/IP implementation
bulletHow to: Configure a Windows 2000 server as a network address translation server (Q299801)
bulletRAS clients cannot gain access to the internet using Network address translation (Q253145)
bullet Inbound PPTP traffic and Windows 2000 network address translation (Q263925)
bulletInternet printing may not work on a network address translation server (Q252416)
bulletHow to configure input filters for services that run behind the firewall (Q254018)
bulletDemand dial filters do not work when network address translation is installed (Q254245)
bulletConflict between services requesting use of network address translation modules (Q254322)
bulletMapping a drive on a local network forces ICS/NAT to dial (Q260555)
bulletWindows 2000 NAT does not translate netlogon traffic (Q263293)
bulletNAT does not properly forward ICMP 'Destination unreachable' packet that is generated on the NAT server (Q268773)
bulletThe DC promo program does not work when using network address translation (Q270152)
bulletWindows 2000 NAT DHCP allocator service logs events 30001 (Q272076)
bulletEvent id 30012 occurs with Windows 2000 network address translation service (Q271994)
bulletUser mode process cancellation of NAT redirect may cause memory leaks (Q275213)
bulletMSN messenger service cannot perform file transfer or make voice connections through NAT (Q278887)
bullet'Stop 0x000000D1' error message in ipnat.sys (Q281292)
bulletNetwork address translation mapping is not successful and an Event id 32003 is logged (Q293497)

Links

bulletAdvanced NAT configuration (Brainbuzz)
bulletWindows insider: NAT expands the net (MCPmag)
bulletNetwork address translation: Hiding in plain sight (Network computing)
bullet Using NAT with L2TP over IPSec (Windows 2000 magazine Nov 2001)
bulletComplete your NAT router (Windows 2000 magazine jan 2001)
bulletWindows 2000's network address translation (Windows 2000 magazine feb 2000)
bullet Advanced nat configuration (BrainBuzz)
bullet Network address translation part 1 (BrainBuzz)
bullet Network address translation part 2 (BrainBuzz)
bullet Network address translation part 3 (BrainBuzz)

Last update : 30 March 2002