I often find myself needing to connect two PCs when I'm away from my regular office network. Maybe I want to pass files to a friend without searching for a thumb drive. Or if I'm feeling generous, perhaps I want to share an Internet connection in a hotel or airport. Such tasks would be easy if both devices were on the same network already, but in a pinch, you can create an ad hoc connection anywhere. Here are five techniques to share files or an Internet hookup. With little or no preparation, you'll be out of a jam and back to work in minutes.
Note: Ad hoc networks are a useful tool for quick file and Internet sharing, but you should watch for unscrupulous attempts to draw you into such a network unawares. For details, see "Don't Fall Victim to the 'Free Wi-Fi' Scam."
Ethernet or FireWire
If you want just a temporary arrangement for sharing files between two computers, a direct cable connection can be the fastest method. With this setup, you manually configure the computers' IP addresses, since you have no DHCP (dynamic host configuration protocol) server to create the connection automatically.
This technique uses an ethernet or FireWire (IEEE 1394) cable. The benefit of choosing this method over a Bluetooth or Wi-Fi connection is that it allows fast transfers of big files. But both cables have limitations. FireWire connections work only on Windows XP, not Vista. (You can use FireWire to network an XP machine and a Mac, however.) And ethernet requires a crossover cable or another piece of hardware, either a hub or a switch. The crossover cable will likely be labeled as such; otherwise, most ethernet uses straight patch cables. (Look for "patch" or "crossover" on the cord.) I like to have a short FireWire or crossover cable on hand, even when I'm traveling; it has saved my bacon on a few occasions.
Once you have connected the cable between the two PCs, here's how to start sharing.
Open the Network Connections Control Panel. Right-click your connection, such as Local Area Connection, and click Properties. Select TCP/IP, and choose Properties. Click Use the following IP address and enter 192.168.0.1 as the IP address and 255.255.255.0 as the subnet mask. Leave the other details blank and click OK. Close the dialog boxes until you return to the Network Connections Control Panel. Repeat the process on the second PC, but set its IP address as 192.168.0.2. You've just created a network of two computers.
Share the Internet Over a Wired Connection
Internet Connection Sharing (ICS) allows an online PC to pass its connection to an offline computer. You could use this arrangement to share a Wi-Fi signal in a hotel or airport across ethernet, to pass your 3G mobile broadband connection along to a nearby colleague, or to otherwise let another PC mooch a live Internet signal.
The process uses two different network connections: the one that goes to the Internet and the one that leads to the second PC. So you can't pass along a Wi-Fi signal via Wi-Fi; you'll have to use another plug. And if you're directly connecting two PCs via ethernet, you'll still have to use a crossover cable, instead of a standard patch cable.
Connect the host computer to the Internet as you normally do, such as through Wi-Fi, ethernet, or a mobile broadband adapter. You'll rarely set up this kind of temporary sharing at home or your office; but if you do, be sure that your router's IP address is configured to a subnet other than 192.168.0.x. For example, change the 0, setting the router to 192.168.2.1. (The process varies by router brand; consult your documentation.) Windows wants to take over that 192.168.0.x subnet, and will likely report errors if it can't.
In the Network Connections Control Panel, right-click the connection that takes the PC online, and pick Properties. Under the Advanced tab, click the Allow other network users to connect through this computer's Internet connection check box. If necessary, in the drop-down menu, select the method used to bridge to the client computer, such as 1394 for FireWire or Local Area Connection for ethernet. (If you don't have extra ports, you won't need to pick one.) Click OK.
Verify that the client computer is set to automatic configuration. Open the Network Connections System Preference. Right-click the connection that goes to the host PC, such as 1394 for FireWire or Local Area Connection if you're using a crossover ethernet cable between the two machines. Click Internet Protocol (TCP/IP) and choose Properties. Click the Obtain an IP address automatically radio button. That's it--both computers can now get online.