Configuring NAT via using the Microsoft Loopback Adapter and Internet Connection Sharing

In previous posts I have mentioned using the Microsoft Loopback Adapter for advanced networking scenarios. Today I am going to talk about how to team up the Microsoft Loopback Adapter with the Internet Connection Sharing capabilities of Windows to construct a NAT network solution. This is very handy to do with Virtual Server - which has no built in NAT solution - and it is even useful for Virtual PC as it provides a more flexible NAT solution than the built in shared networking functionality (such as the capability for virtual machines to network with each other and the host computer).

The directions on how to install the Microsoft Loopback Adapter under Windows XP are as follows:

  1. On the host operating system go to 'Control Panel'
  2. Go to 'Add Hardware'
  3. In the 'Add Hardware' wizard, click 'Next'
  4. When the 'Is the hardware connected?' page appears, select 'Yes, I have already connected the hardware', and then click 'Next'
  5. In the 'Installed hardware' list, select 'Add a new hardware device' and then click 'Next'
  6. In the 'What do you want the wizard to do?' list, select 'Install the hardware that I manually select from a list (Advanced)' , and then click 'Next'
  7. In the 'Common hardware types' list, click 'Network adapters' , and then click 'Next'
  8. In 'Manufacturer' list, select 'Microsoft'
  9. In the 'Network Adapter' list, select 'Microsoft Loopback Adapter' , and then click 'Next' twice
  10. In the 'Completing the Add Hardware Wizard' page, click 'Finish'

Once you have done this you will then need to enable Internet Connection Sharing (ICS). The catch here is that you need to enable ICS on the network interface that you want to use to access the Internet - not the Microsoft Loopback Adapter:

  1. On the host operating system go to 'Control Panel'
  2. Go to 'Network Connections'
  3. Right click on the network connection that you use for Internet connectivity and select 'Properties'  
  4. Click on the 'Advanced' tab
  5. Check the option to 'Allow other network users to connect through this computer's Internet connection'
  6. If you have multiple network adapters you will need to also specify that you are sharing the Internet connection with the Microsoft Loopback Adapter.
  7. Click 'OK'

A couple of things to know at this stage:

  1. Under Windows XP this will cause your Microsoft Loopback Adapter to be hard configured to use ''. This is problematic if your external network is configured to use the subnet - but unfortunately there is nothing that you can do about this except to change your physical network settings (I have moved my physical home network to for exactly this reason).

  2. Under Windows Server 2003 it is possible to change the IP address and subnet used on the Microsoft Loopback Adapter when ICS is enabled.

  3. ICS provides DHCP services as well - so virtual machines connected to the Microsoft Loopback Adapter do not need to have static IP addresses configured.