Providing Shared Internet Access
Although you could give each computer its own dial-up modem or broadband modem, one of the principal advantages of installing a network is gaining Internet access for all your computers through a single connection. There are two simple ways to provide shared Internet access for a home or small office network:
- If you have cable or DSL broadband Internet service, get a hardware Internet connection-sharing router. It’s easy to set up, costs little or nothing, provides a certain amount of added security to your network, lets you add on additional computers with no setup effort, and can let you use both wired and wireless connections at the same time.
- If you use standard dial-up Internet service (not AOL dial-up service), use the Windows Internet Connection Sharing service to share the connection with others through your network. This is an acceptable solution although the “sharing” computer must be turned on to use the Internet from your other computers.
Shared network connections provided by hardware routers and Windows Internet Connection Sharing (ICS) use a mechanism called Network Address Translation (NAT) to mediate between the computers on your network and the Internet via a single connection and single public IP address. The router or ICS computer has two connections, one to the Internet via a dial-up, cable, or DSL modem, and one to your LAN, as illustrated in the top part of Figure 6.16.
Figure 6.16 A connection-sharing router acts as an intermediary between your LAN and the Internet.
When one of your computers attempts to contact a website, it sends a data packet to the router or computer running ICS to be forwarded to the Internet, as illustrated in the bottom part of Figure 6.16. As it passes the outgoing network data packet to the Internet, the router replaces the packet’s “from” address—the private IP address assigned to your computer—with the router’s public address, so that the reply from the remote server will be returned through the Internet to the router. The router remembers from whom the request came, replaces the response’s “to” network address with your computer’s private address, and transmits it on its LAN connection.
This mechanism works quite well for communication initiated by computers on your network. When outside computers attempt to contact you, however, it’s another story. If you have a web or email server on your network, for instance, the connection-sharing router or computer can be configured to send packets for particular network services to the correct computer; this is called port forwarding. Otherwise, incoming connection attempts are simply discarded. In this way NAT protects you against random probing by hackers, and it’s very helpful to have this as a second level of protection in addition to Windows Firewall.
Adding a Connection-Sharing Router
Connection-sharing routers almost always have one 10Mbps Ethernet port that is used to connect to a cable or DSL modem, and have a second connection for your LAN. This LAN connection can take several forms:
- There may be a single 10/100Mbps Ethernet port.
- There may be four or more 10/100Mbps Ethernet ports, giving you a built-in switching hub.
- There may be a built-in wireless networking access point.
- There may be a combination of the preceding.
Because wireless devices and laptops are becoming so common, and because it’s very nice to be able to offer wireless connectivity to friends and visitors even if you don’t use it yourself, I recommend purchasing an 802.11g or 802.11n wireless router with a built-in four port switch. Routers without wireless can sometimes be found for $0 after rebate, but usually fall in the U.S. in the $10 to $40 range. If you shop carefully and look for a sale or rebate offer, wireless routers with four-port switches can also frequently be purchased for $10 to $40, so you’re getting a lot of connectivity for no additional cost.
You will need to ensure that your ISP provides you with a cable or DSL modem with an Ethernet port; USB or internal PCI adapters do not work with a router. Use a standard Ethernet patch cable to connect the modem to the Internet or WAN port on the router.
Then connect one of your computer’s LAN adapters to one of the ports on the router, using another standard Ethernet patch cable.
When you connect your computer’s Ethernet port to the router, Windows automatically requests an IP address and configures the port’s TCP/IP settings from default values provided by the router. You should then be able to open your web browser and view the router’s setup web page, using the URL //192.168.0.1 or //192.168.1.1, as instructed by your router’s installation manual.
Your router establishes the connection to your ISP on your behalf, so you need the same information that you’d need to establish the connection directly through Windows. For a DSL connection, this often involves a username and password. For a cable connection, this often requires that you set the router’s hostname to a specific name, or you may have to provide the router’s MAC address (its Ethernet hardware address code) to your ISP; this number is usually printed in tiny letters on a label on the bottom of the router. Alternatively, if you’ve already used your cable Internet service by directly connecting your computer, you might be able to have the router clone your computer’s MAC address—that is, copy your computer’s address and use it on its Internet port so that your ISP doesn’t have to make any changes.
After installing the router, run the Network Setup Wizard on all your Windows XP computers. The wizard is described earlier in this chapter, under “Configuring a Workgroup Network.” When asked to select a connection method, select This Computer Connects to the Internet Through Another Computer on My Network or Through a Residential Gateway.
On Windows Vista, you should not need to run any setup wizards—Vista automatically detects that you have an Internet connection on the network. However, if you’ve added a connection-sharing router to an existing network, you may need to adjust any fixed IP addresses you’ve manually assigned to computers on your network.
After Setting Up a Shared Connection
After the shared connection is set up, all your computers can use it automatically, through the network. The only problem you might run into is with Internet Explorer. If you previously used dial-up Internet, or if you previously had your broadband modem connected directly to your computer, and now Internet Explorer tries to establish a connection whenever you open it, perform the following steps:
- Open Internet Explorer.
- If the menu bar is not visible, press and release the Alt key. Select Tools, Internet Options.
- Select the Connections tab. In the middle of the dialog, select Never Dial a Connection, and click OK.
This keeps Internet Explorer from attempting to make a direct Internet connection.
Using Windows Internet Connection Sharing
All Windows versions since Windows 98 Second Edition have a software version of NAT called Internet Connection Sharing (ICS). It does in software what a connection-sharing router does in hardware. If you have cable or DSL Internet service, I strongly recommend that you use a hardware router.
But, if you really want to, you can use the Windows ICS service to share a broadband connection. You may also want to use ICS if you have standard dial-up Internet service. Internet Connection Sharing can let you use dial-up Internet from two or more computers at once, without tying up additional phone lines—a neat trick. It does, however, require you to leave the computer that is set up to share its connection turned on all the time; at least, it must be on anytime anyone wants to use the Internet.
To set up ICS, select one of your computers to be the one that is to share its Internet connection. Set up and test its Internet connection first, before creating a LAN. For dial-up Internet, get the “sharing computer’s” dial-up connection working first, before you connect your network. For broadband Internet, connect the “sharing computer’s” network adapter to your cable or DSL modem, and get the Internet connection working first. Only then install a second network adapter that you’ll use to hook up to your other computers.
Finally, configure the shared connection. The procedure depends on whether you’re using XP or Vista.
Setting Up ICS on Windows XP
On XP, log on as a Computer Administrator. Run the Network Setup Wizard, covered earlier in the chapter, under “Configuring a Workgroup Network.” The important points are as follows:
- When you’re asked to selection a connection method, select the first choice, This Computer Connects Directly to the Internet. The Other Computers...Connect...Through This Computer.
- When asked to choose a connection, select the entry for the dial-up connection to your ISP.
Complete the rest of the Network Setup Wizard as described earlier in the chapter. If you had set up your LAN previously, be sure to enter the same workgroup name you used originally because the wizard wants to change the setting to MSHOME every time you run it.
When the wizard completes, go to the Network Connections window and locate the icon that represents your Internet connection. It should now say “Firewalled, Shared” and possibly “Disconnected.” Right-click it and select Properties. View the Networking tab. In the list of components used by the connection, be sure that only Internet Protocol (TCP/IP) and QoS Packet Scheduler are checked. This prevents file sharing from being exposed to the Internet. The firewall does that, too, but it doesn’t hurt to be extra safe.
Then restart your computer. Log on again, and try to view a web page (such as www.google.com). Your computer should automatically connect to your ISP, dialing or signing on if necessary. If the web page doesn’t appear, you have to resolve the problem before continuing.
When the sharing computer can connect properly, run the Network Setup Wizard on your other Windows XP computers, except for one detail: When you run the wizard, select This Computer Connects to the Internet Through Another Computer on My Network or Through a Residential Gateway.
Setting Up ICS on Windows Vista
To set up ICS on Vista, set up and test your Internet connection first. Be sure that it’s working before you proceed. Then follow these steps on the “sharing” computer:
- Click Start, Control Panel, Network and Internet, Network and Sharing Center. Under Tasks, select Manage Network Connections.
If you are using broadband Internet with a cable or DSL modem connected to your computer through its Ethernet adapter, locate the Local Area Connection icon for this connection, right-click it, and select Rename. Change the name from Local Area Connection to DSL Modem Connection or Cable Modem Connection or some other appropriate name. Confirm the User Account Control Prompt.
Then right-click this icon and select Properties. Under This Connection Uses the Following Items, uncheck every item except QoS Packet Scheduler, Internet Protocol Version 4 (TCP/IPv4), and the two Link-Layer Topology Discovery items.
You use a second network adapter to connect to the other computers on your network. If you haven’t installed it yet, shut Windows down, unplug the computer, and install the adapter now. Power the computer back up, log on, and return to the Network Connections window.
If your Internet service is connection-based (standard dial-up, or DSL using a login name and password), right-click your Dial-up or Broadband Connection icon and select Connect so that your Internet connection will be up during the remaining steps. Then right-click it, select Properties, and confirm the User Account Control prompt.
Otherwise, if you have always-on Internet service, such as that provided by most cable providers, right-click the Cable Modem Connection icon that you renamed earlier, right-click it, select Properties, and confirm the User Account Control prompt.
- Select the Sharing tab, and check Allow Other Network Users to Connect Through This Computer’s Internet Connection. If a drop-down list labeled Home Network Connection is visible, select the network connection that corresponds to the LAN adapter that connects to your other computers, not the connection that goes to your DSL or cable modem. Click OK.
- When the process finishes, you may close the Properties dialog.
Now other users should be able to connect to the Internet through the shared connection. If your Internet service is connection-based, on their Network Connections windows they should see an icon representing the shared connection. They can right-click this icon to establish or disconnect the Internet connection if necessary.
For one last setup step, see “After Setting Up a Shared Connection” at the end of the previous section.