Click here to Skip to main content
15,881,938 members
Articles / Programming Languages / C++
Article

Windows Networking Overview - Part IV Internet Connection Sharing (ICS)

Rate me:
Please Sign up or sign in to vote.
3.78/5 (12 votes)
10 Aug 200612 min read 46.1K   34  
A simple guide explaining how to set up Internet Connection Sharing on Windows 2000/XP systems.

Introduction

Based upon the votes and the comments I've been receiving so far I need to address something up front in this series. This entire article series is not source code related and if you are expecting source code you won't find it. Comments so far are suggesting that this article does not belong here. I'd like to address that by saying that if you are developer writing code that will work across networks then these articles might be valuable to you. If your systems are not configured properly the best code in the world won't run right. So consider these articles prerequesite articles that should be read before starting a project where your code is intended to work across networks.

I've written a series of articles to provide developers with a broad amount of information that covers general networking topics. In this series I'll be discussing:

I had originally intended this to be a single article but it has grown to be much to large to be a single article. I also think that breaking it up into topics does a better job of granulating the information and makes it easier for readers to ask specific questions that will flow together in the reader comments area. If it's possible I'd like to have the above bulleted list link to all the articles so that readers may jump around from one topic to the other.

I'll be including this information in each relevant section but right up front I'd like to group this information for the convenience of the reader. I'm going to take the approach that you are brand new to networking and need the information presented in a way that flows smoothly from one topic to the next. Please understand this is not a simple topic. Networking is a black art and I mean that seriously. If you intend to fully understand networks and become proficient in them at a basic-working-level you will invest several hours to do so. Expect to make mistakes and expect it to be slow going at first. That's the nature of the topic.

As you read through this feel free to request an article on other topics in networking or feel free to ask me to add to a current section and drive it a bit deeper. I'm open to improving anything you see here and adding more content will just add value to the entire project.

From the top I'd start by reading TCP/IP Networking in Class C Subnets. I'd read it a few times so that you have the core down. I'd immediately move to Command Line Tools - IPCONFIG as it will provide an extra level of visibility to what was discussed in TCP/IP Networking in Class C Subnets. Even though it's the most difficult topic I've written on so far I'd recommend Adding Wireless Routers to Existing Networks next. It will force you to apply everything else I have discussed and it will do so in such a way that you will utterly understand it all by the time you have done it a few times. Even though many people have no need to know about Internet Connection Sharing (ICS) I think it's the next logical choice in progression. It will help you to understand networking landscapes a bit more and drive depth in your basic knowledge. I save the most practical for closest to the end because Sharing Files, Printers and Other Network Resource plagues almost every network I've ever seen. It's the most necessary aspect of networking for users and it can be one of the hardest to troubleshoot. You will need the knowledge gained from all the other articles to troubleshoot any problems you may have in Sharing Files, Printers and other Resources. As a final topic I'll briefly delve into VPN but it's a bit like trying to fit the ocean into a 1 gallon jug. Virtual Private Networking (VPN) is vast and enormous in scope and the security liability is enormous if you screw up.

That just about covers it. Now it's time to dive in. I hope you enjoy the material and feel free to ask further questions in the comments area.

Prerequisites

I've spent the last 8 years of my life fighting Class C subnets in Windows, Linux and MAC environments. To be honest networking is like black magic. Some people understand it and many never will. I think the reason for this is fear that you can break something. This is a valid fear. If you hose your TCP/IP stack you are in big trouble. If you are reading this article and are new to networking I'd suggest all of the following to guarantee you learn what you need and don't destroy your own PC's and network in the process.

  • If you have an extra PC to play with perfect make sure you are fine to trash it and reload it if necessary.
  • Before getting started I recommend downloading a product like Acronis True Image and making a full backup of your system. (Please verify the backup image.)
  • If you are going to play with a router that currently works please export/download it's firmware settings as a safe backup.
  • Please write down every setting you change and in what order. It's very easy to go backwards when you take good notes as you go.

Internet Connection Sharing (ICS)

If you have not done so already I strongly recommend reading my other articles, TCP/IP Networking in Class C Subnets and Command Line Tools - IPCONFIG before reading this furhter.

Description: If you don't want to or simply cannot buy a Firewall or Router but you do have a PC with more than 1 network card you can create a full-service network for multiple machines and devices using the Windows Internet Connection Sharing Wizard. It’s not an ideal solution and no I don’t recommend it but it can work in situations where you may have a USB connected modem or you are running 2 network cards (NIC’s) and you do not have a firewall or router. If you run the ICS Wizard found in the Windows XP Networking Control Panel it will set up an ICS Gateway. You may also find this wizard on the Advanced properties tab of your Local Area Network Connection.

Please note that an ICS enabled machine can only host as many PC's as it has network cards. In most cases and ICS host has 2 network cards or 1 USB Modem and 1 Network Card. In this case you will want to connect the second Network Card (LAN) into a multi-port switch to service the connections of other pieces of equipment. Wired switches typically come in 4, 5, 8, 16 and 24 port configurations and should vary in price from $29 up to $299 for a basic unmanaged switch that provides Layer 2 networking. You may also choose to use a Wireless Switch or a Wireless Router configured as a wireless switch. If you go this route please read my section:Adding Wireless Routers to Existing Networks.

Function: The ICS Gateway has one primary job on your LAN. That job is to share out the internet connection provided by the USB modem or 2nd Network Card and to handle DHCP (Dynamic Host Configuration Protocol) client requests from devices located on the same logical network.

Settings: The USB modems or WAN Network Card will get their settings from the ISP as such they will never be discussed. The configuration of the LAN network adapter of the PC however is vital to operating a successful network and as such it’s settings are of great importance to us.

The ICS Wizard will default the LAN IP Address of your network to 192.168.0.1 and provide it with a subnet mask of 255.255.255.0.

TCPIP:

192.168.0.1

SUBNET MASK:

255.255.255.0

ICS Clients - Machines Connecting to the ICS Wizard Enabled Computer.

Description: The next 5 items I will be discussing are identical in every way accept one which will be pointed out in this section. A client can be wired or wireless and functions identically if it’s a desktop or a laptop. Typically clients are stand alone PC’s apart from the ICS host PC that will be sharing the internet connection amongst them. Client PC’s will tend to be the machines that families and businesses will use on a regular basis.  

Function: Client PC’s have a basic function in the scope of an ICS Enabled LAN. They send out a DHCP request to the server and the server assigns them the proper settings they need in order to get email and surf the internet. On ICS Enabled Networks each Client PC should be responsible for maintaining it’s own virus and network security using locally installed applications.  

Settings: Client PC’s should have their network adapters set to use DHCP addressing. What this means is that the end user should have no work involved other than inserting a wireless network card or a CAT 5 cable and in each case the PC is automatically configured by the DHCP Server also the ICS Gateway. Below I list 5 tables each containing similar settings. The only distinction is in the LAN TCPIP addresses. You will notice that the IP Addresses have the first 3 portions the same i.e. 192.168.0 and each of them differ by one digit 10, 11, 12, 13, 14 in the last portion. This is by design. If you manually hard-code these settings as they are here into the NIC or Wireless Network card of each machine your network will work just fine. However, you do not need to worry about this if you are using DHCP which is recommended. If you are using DHCP the ICS Gateway will hand out addresses just like these and will auto-configure any laptop or desktop that is configured to use DHCP. If you are using DHCP and you wish to know what your LAN TCP/IP Address is you can do so at the command line which will be discussed later.

LAN TCPIP:

192.168.0.10

SUBNET MASK:

255.255.255.0

DEFAULT GATEWAY:

192.168.0.1

PRIMARY DNS:

192.168.0.1

ALTERNATE DNS:

{Blank}


LAN TCPIP:

192.168.0.11

SUBNET MASK:

255.255.255.0

DEFAULT GATEWAY:

192.168.0.1

PRIMARY DNS:

192.168.0.1

ALTERNATE DNS:

{Blank}


LAN TCPIP:

192.168.0.12

SUBNET MASK:

255.255.255.0

DEFAULT GATEWAY:

192.168.0.1

PRIMARY DNS:

192.168.0.1

ALTERNATE DNS:

{Blank}


LAN TCPIP:

192.168.0.13

SUBNET MASK:

255.255.255.0

DEFAULT GATEWAY:

192.168.0.1

PRIMARY DNS:

192.168.0.1

ALTERNATE DNS:

{Blank}


LAN TCPIP:

192.168.0.14

SUBNET MASK:

255.255.255.0

DEFAULT GATEWAY:

192.168.0.1

PRIMARY DNS:

192.168.0.1

ALTERNATE DNS:

{Blank}

Using the Windows XP/2000 ICS Wizard

Now that we have a high level overview of what an ICS Gateway enabled network is let’s actually get into the dirt of the details. Each reader of this document should have at least 2 PC’s one functioning as the ICS Gateway and the other(s) operating as an ICS Client(s). Let’s get started by first getting the PC you have chosen as your ICS Gateway configured to share out it’s internet connection so that one or more clients may be joined to your network and with a very minimal amount of work can be set up to surf and check email using your ICS Enabled Connection. All portions of this document assume you will be using Windows XP Professional Edition with the latest service packs and updates. For readers not having Windows XP the specifics still apply but the configuration steps will be different in every case of Windows 95/98/ME/NT4 with 2000 being very similar to XP.

Let’s start by logging onto the machine you have selected as the ICS Gateway and begin the process of configuring it to do just that. On your designated ICS Gateway please open the system control panel. You can access the control panel from the Start Menu found in the lower left hand corner of your Windows desktop menu system. On my workstation the path for me is Start Menu – Settings – Control Panel – Network Connections. You should now be looking at a folder like this:

Image 1

Now in your window you won’t be looking at a DIRECWAY Satellite Connection that has a hand under it. When we are done whatever connection you have chosen to share will have a hand under it. Go ahead and right mouse-click the Internet Connection icon representing the connection you want to share (for me it would be the DIRECWAY Satellite Connection) and select properties. In the properties dialog click the Advanced tab and you should be looking at this: (Make sure that Internet Connection Firewall is not checked and put a check in Allow other network users to connect through this computers Internet connection. Click the OK button and then let your computer chunk and whir until the connection is shared.)

Image 2

Once we have Internet Connection Sharing setup on the ICS Gateway machine go ahead and verify that there is a hand under it the connection's icon you have chosen to share and then close the Network Connections window. That should be all we need to do on the host for sharing it's connection. Please note that in setting up ICS we are using the Internet connection you shared as a shared ISP for other machines on your network. Your Local Area Connection has been turned into a firewall and DHCP Server. Any DHCP enabled machines you connect to the LAN port of your ICS Enabled Gateway will be autoconfigured to surf the internet using the ICS Gateway as the ISP. At this point you could plug a network cable into your LAN Connection and feed the other end into a 24 port switch. You would then be able to connect 23 other devices and each of them if DHCP Enabled would be able to get out on the Internet. I've included a picture to demonstrate the idea of an ICS Enabled Network.

Image 3

 

History

August 10th, 2006. First release. August 11th, 2006. Added additional comments in the introduction to address the user comments that these articles do not belong on CodeProject.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
CEO
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --