How to: Create an Ad-Hoc Network, Part 1
May 26, 2009
Ad-hoc networks, using wireless adapters instead of routers, are great for very basic file and Internet sharing or other short-term uses.
Routers actually aren't required in order to share files or an Internet connection among multiple computers. Wireless adapters provide all that is needed to create a basic network. They can communicate directly with each other via Wi-Fi. Since there is no permanent infrastructure, however, ad-hoc or computer-to-computer networks are best for temporary or mobile applications. Ad-hoc networks can provide very basic file and Internet sharing. This is great for short-term applications not requiring any special features.
After we discuss some uses for these networks, we'll see how they work and how to configure them. Additionally, we'll get the Internet running on the router-less network, in addition to sharing files. Well cover Windows XP and Vista, and for the Apple lovers, Mac OS X Leopard.
Uses for computer-to-computer networks
There are a few situations where one might utilize an ad-hoc network. One use is to share files with someone, or a group of people, when away from a private network. Though the group may be able to find a hotspot they can connect to, sharing on public networks compromises the shared data and/or computers. However, they can create their own secure network in a matter of seconds.
Another possible use is to create a mobile AP. For example, a computer could be connected to a wired connection (such as the Internet in a hotel) and at the same time could be hosting an ad-hoc network with the wireless adapter. After configuring a few settings, other people could connect to the ad-hoc network and access the wired network and/or the Internet.
One might also take advantage of computer-to-computer networks when one wants to extend a Wi-Fi signal. This is similar to the previous example, but the originating network would be wireless instead of wired. This requires two wireless adapters: one to host the ad-hoc network and the other to get the wireless Internet connection. Then users outside of the main networks coverage could possibility connect to the ad-hoc wireless network to get the network and/or Internet access.
How ad-hoc networks work
Creating and using ad-hoc networks is quick and simple; heres the general process:
- Someone creates an ad-hoc network, by creating a network profile; very similar to configuring profiles for regular Wi-Fi networks.
- That person activates the ad-hoc network by connecting to it, or selecting it from the list of available networks.
- The radio card will start sending beacons, so other people can see it in their list of nearby wireless networks and connect to it.
- If the other users save the profile for the ad-hoc network, they too can host or start the network later.
Creating an ad-hoc network in Windows XP
As mentioned, the first step is for someone to create a network profile for the ad-hoc network, so other people can join. Here's exactly how to do it in Windows XP:
- Open the Wireless Network Connection Properties dialog for the desired adapter and select the Wireless Networks tab.
- Click Add to create a network profile.
- Mark the checkbox on the bottom, This is a computer-to-computer (ad hoc) network; wireless access points are not used (see Figure 1 below).
- Enter a unique network name (SSID) and optionally set up encryption. It's recommended to use WPA2-PSK (with AES) and enter an 8 or more ASCII character key. However, if not all equipment supports WPA2, at least use WEP. Select Open authentication, choose WEP for encryption, and enter a 13 ASCII character key.
- Select the Connection tab and make sure the checkbox is not marked. Due to security reasons, it's not recommend to enable automatic connections to ad-hoc networks (or regular networks), especially when not using encryption.
- Click OK to save the network profile.
Creating an ad-hoc network in Windows Vista
The Windows XP and Vista interfaces are different, so here are the step-by-step instructions to start a router-less network in Vista:
1. Open the Network and Sharing Center.
2. Click the Set up a connection or network link (see Figure 2 below) on the left pane.
3. On the window that pops up, select Set up a wireless ad hoc (computer-to-computer) network, and click Next.
4. Read the info on these networks, if desired, and click Next.
5. Enter a unique network name and optionally enable security. It's recommended to use WPA2-Personal and enter an 8 or more ASCII character key. However, if not all equipment supports WPA2, WEP should be used at the very least. Select WEP and enter a 13 ASCII character key.
6. Click Next and wait a minute or so for Windows to create the ad-hoc network.
7. Once its completed, click Close.
Starting or connecting to computer-to-computer network
After a network profile has been created for an ad-hoc network in Windows, starting or hosting it is simple. Like when connecting to regular networks, select the network from the list of available wireless networks and click Connect.
Once someone has started or is hosting an ad-hoc network, others will then see it in their list of wireless networks. They can simply choose the network from the list and click Connect. If security is enabled, they'll be prompted for the network's WEP or WPA2 encryption key.
Once at least two computers have joined the ad-hoc network, Windows or Mac OS X will try to obtain an IP address from a DHCP server. Since there probably isn't one, they will assign themselves an automatic address, between 169.254.0.0 and 169.254.255.255, with a subnet of 255.255.0.0. Since all the computers should automatically assign themselves with an address in the same range and subnet, they can communicate (share files) with each other right after receiving the automatic address.
In Part 2, we cover Mac OS X Leopard and well see how to get the Internet on the router-less network.
Eric Geier is the author of many networking and computing books, including Home Networking All-in-One Desk Reference For Dummies (Wiley 2008) and 100 Things You Need to Know about Microsoft® Windows Vista (Que 2007).