So far, we have been talking about wireless networks that involve an access point. While this is primarily the way most wireless networks are constructed and used, there are times where you do not have access to an access point and need to simply connect to another computer wirelessly. This mode of wireless connectivity is known as ad-hoc mode.
To enable two computers to connect wirelessly without using an access point, you would just need a wireless card/adapter on each computer. Then, take the following steps:
Right-click on the Wireless Network connection icon located in the tray and select View Available Wireless Networks. Click on Advanced.
The Wireless Network Connection Properties window will appear (see Figure 5-28).
Click on Advanced. Select the option "Computer-to-computer (ad hoc) networks only" (see Figure 5-29). (To connect to either an access point or another computer directly, select the option "Any available network (access point preferred)".) Click Close.
Click on Add... and give the ad-hoc wireless network an SSID (see Figure 5-30). Check the option "This is a computer-to-computer (ad hoc) network; wireless access points are not used". Click OK. Click OK again to dismiss the Connection Properties dialog.
On the other computer, right-click on the Wireless Network Connection icon located in the system tray and select View Available Wireless Networks.
You should now see the SSID of the ad-hoc network. Select the SSID and enter the key for encryption. (If WEP is enabled, see Figure 5-31. The initiating computer will supply the WEP key.) Both computers should share the same key. Click Connect.
You should now see that the connection is established (hover the mouse over the Wireless Network Connection icon in the tray). This is shown in Figure 5-32.
When you set up an ad-hoc network this way, there is no DHCP server to hand out addresses, but the computers select temporary addresses called link local addresses. These are chosen from the Class B subnet (see Chapter 1 for more information on IP addressing) 169.254.0.0/16. To determine the temporary IP addresses, use the ipconfig command at the Windows XP Command Prompt.
Note that if you choose to use your own IP address, it will work as well. Also, if you want to share a connection (suppose the first computer is plugged into a broadband connection), you can do so by opening Control Panel Network and Internet Connections Network Connections on the first computer, and then:
Right-click on the connection that you want to share and select Properties from the context menu. This brings up the Connection Properties dialog.
Select the Advanced tab (see Figure 5-33). Check the box labeled Allow other network users to connect through this computer's Internet connection. (If it is already checked, uncheck it, click OK to dismiss the Connection Properties dialog, and start over at step 1.)
To allow other computers to access the Internet connection through the ad-hoc network created on the first computer, select the wireless connection from the Home Networking Connection list and click OK.
Now, when another computer connects to the first computer's ad-hoc network, the first computer will act as a DHCP server and assign it a private network address (if you run into problems, see Section 188.8.131.52 in Chapter 6). The first computer will also perform NAT services to permit the other computer to access the Internet (assuming the shared connection is an Internet connection). In effect, this trick turns a Windows XP machine into an expensive wireless access point!