Tuesday, June 23, 2009

Creating an adhoc host with Ubuntu

image1
  • Specify an adhoc network name, i.e. UbuntuAdhoc
  • Select your favorite security method (this example specifies None)
  • Click the Create button
As of Ubuntu 8.10, NetworkManager pretends to connect to the newly created UbuntuAdhoc wireless network but inevitably fails and the NetworkManager defaults back to the last successful network connection. See below to rectify.
Editing Network Connections:

  • Click on the NetworkManager icon, select Edit Connections.
  • Select the Wireless tab, select the UbuntuAdhoc network and click the edit button.
Editing the UbuntAhoc network:
  • Click the Connect automatically check-box
  • On the Wireless tab, ensure the mode is set to Ad-hoc
image2
  • Select the Ipv4 Settings tab
  • Select the Manual method in the drop down
  • Click the Add button and enter a local IP address, Netmask and Gateway, i.e. 192.255.0.1, 255.255.255.0, and 1.1.1.1 respectively.
  • Leave DNS Servers and Search Domains blank
image3
  • Click OK.
Connecting your Ubuntu session to the new adhoc Network:
  • Left click on the NetworkManager icon and select Connect to Hidden Wireless Network…
  • Select UbuntuAdhoc on the connection dropdown and click Connect.
  • Voila, your Ubuntu session should be connected to itself. Hover over NetworkManager icon, and you should see the yellow message: Wireless network connection to ‘UbuntuAdhoc‘ (0%).
image4
Note: the NetworkManager bars will appear empty since the network adapter technically is not connected to any network. These bars remain empty even when another computer joins the network. Regardless, the connection will work fine.
In Windows XP:

Wireless Connection Properties:
  • Right click the Wireless Connection icon (either from the Windows tray or via the control panel) and select Properties. Ensure to right click on the the windows network icon and not the icon specific to the hardware driver.
  • Select TCP/IP option in The connection uses the following items: window, and click the Properties button. (In this image, I was lazy as I used a Lan connection properties window as my virtual XP session did not have a wireless option to capture, but TCP/IP example is identical).
image5
Internet Protocol (TCP/IP) Properties:
  • Specify an IP address within a few increments of the Ubuntu IP address, i.e. 168.255.0.2. Ensure to match the subnet mask and gateway to the ones specified in UbuntuAdhoc (255.255.255.0 and 1.1.1.1, respectively).
image6
  • Click OK in the both the Internet Protocol (TCP/IP) Properties window and then Wireless Internet Connection Properties window.
Click on your respective window wireless connection icon, select UbuntuAdhoc from list of connections and connect.
Note: Assuming the original IP address was auto selected, ensure to set the Inernet Protocol (TCP/IP) Properties back to Obtain an IP address automatically when reconnecting to another wireless network.
If anyone knows of an easier way please post.