How to: Create an Ad-Hoc Network, Part 2
May 29, 2009
Ad-hoc networks, using wireless adapters instead of routers, are great for very basic file and Internet sharing or other short-term uses. In Part 2, we cover Mac OS Leopard, Windows Vista, and Windows XP.
In Part 1, we discovered how quick and easy it is to create and use a computer-to-computer network in Windows XP and Vista. Now well do the same in Mac OS X Leopard. Then well configure a computer to share its Internet connection with the other users on the ad-hoc network.
Creating an ad-hoc network in Mac OS X Leopard
Computer-to-computer networks in Mac OS X Leopard works differently than in Windows. Leopard can create or host ad-hoc networks; however, currently it only supports WEP encryption for these networks. The first WPA version wont work for ad-hoc networks in any operating system, and Apple hasnt added WPA2 support for these types of networks yet.
Another distinction from Windows is that there are two different places where a Leopard user can create an ad-hoc network. Follow the steps in this section to host a network just for the purpose of sharing files or other direct communication. To create an ad-hoc network and share an Internet connection at the same time, refer to the later section.
1. Click the wireless icon on the main menu bar and choose Create Network.
2. On the dialog (see Figure 1), type a Name for the ad-hoc network.
3. If you know what Wi-Fi channels are already in use nearby, choose a different non-overlapping channel (1 or 6); otherwise leave the default channel 11, which is another non-overlapping channel.
4. To enable WEP encryption, mark the Require Password option. Then to use the higher bit encryption, select 128-bit WEP for the Security value. Finally, input a 13 ASCII character key into both password fields.
5. Click OK to create the computer-to-computer network.
The ad-hoc network will automatically start. Keep in mind, Mac OS X Leopard doesn't store the ad-hoc network details in a profile like Windows. To disconnect from the network, click the wireless icon and select the disconnect option for the network's name. To start the network again, it must be created from scratch again.
Sharing an Internet connection without a router
In order for the ad-hoc users to be able to browse the Internet, one of them must have access to an Internet connection and configure sharing for it. They can connect to a regular network or directly to an Internet connection, via a wire with an Ethernet card or via Wi-Fi with a second wireless card.
The host can give the other ad-hoc users direct access to the Internet-enabled network by creating a bridge in Windows. However, if the host doesn't want to give them access to the network (just to the Internet) or when directly connected to an Internet modem, he or she can use the Internet connection sharing (ICS) feature of Windows.
Mac OS X Leopard has a feature similar to ICS of Windows. If theres an Apple user on the network, he or she could also pump in the Internet connection for all the users. Well discuss this soon.
The next sections discuss these Internet sharing methods on router-less computer-to-computer networks.
Sharing the Internet with a bridge in Windows XP or Vista
To create a bridge between the two network adapters, first open the Network Connections window, where all the network adapters/connections are located. Then hold down the Ctrl key and select each connection, to highlight the two network connections. Then right-click either one and select Bridge Connections (see Figure 2).
That's it. Now Windows has virtually connected the two networks. Therefore, users connecting to the computer-to-computer network from now on will automatically receive an IP address from the regular network (if it has DHCP enabled). Plus they should be able to access any network resources, just as if they were directly connected to the regular network.
Sharing the Internet using ICS in Windows XP or Vista
This method uses Internet connection sharing (ICS) in Windows. This provides network address translation (NAT) and a basic DHCP server. These are the two essential functions needed to distribute an Internet/network connection to multiple computers.
Tip: The default gateway IP address used by ICS is 192.168.0.1. Therefore if the Internet source is a local network, it must not have a router with the same IP. If using a router with this same IP (such as from D-Link), first change either the router or ICS IP to something different, such as 192.168.1.1.
Here's how to set up ICS on the desired host computer in Windows:
- Open the Network Connections window, where all the network adapters/connections are located.
- Right-click on the adapter that's connected to the Internet and select Properties.
- On the dialog that opens, select the Advanced tab. Now mark the ICS checkbox, Allow other network users to connect through this computer's Internet connection (see Figure 3).
- To give all users the ability to manage the shared Internet connection, mark the second checkbox.
- If users from the source network (Internet if directly connected or just users from the source network if connected to another local network) need access to a server (such as Remote Desktop or FTP), click the Settings button, mark the appropriate checkboxes, and then click OK.
- To activate ICS, click OK.
Now users connecting to the ad-hoc network should automatically receive an IP from the ICS's DHCP server. Ad-hoc users should be able to access the Internet in addition to sharing files.
Using the Internet sharing feature of Mac OS X Leopard
Here's how to create a computer-to-computer network in Leopard, and at the same time, host the Internet access:
1. Click Apple > System Preferences.
2. Click the Sharing icon in the Internet & Network section.
3. On the Sharing window, select Internet Sharing (see Figure 4) from the list.
4. Choose the connection or adapter that is connected to the Internet, and choose a wireless adapter to host the ad-hoc network.
5. Then to specify the network details, click the AirPort Options button. For help, refer to steps 2 through 5 in the Creating an ad-hoc network in Mac OS X Leopard section.
6. Now mark the checkbox next to Internet Sharing, on the list to the left.
7. On the prompt, click Start.
Users connecting to the network should automatically receive an IP and be able to access the ad-hoc network and Internet. Leopard uses the IP subnet of 10.0.2.0, with a default gateway of 10.0.2.1.
We've discussed what an ad-hoc or computer-to-computer network is and how it all works. We stepped through starting an ad-hoc network and how to join an existing one, in Windows XP and Vista, and in Mac OS X Leopard. Lastly, we found out even though these networks are router-less, an Internet connection can be shared among all the users.
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). For more help and How To's, visit our Forums and our Tutorials section.