Asus Eee PC netbook tip / howto: Connecting to a Macbook in Ad-Hoc mode

(Nederlandse versie niet beschikbaar)
back to Eee PC netbook notes and tips index

This turned out to be a major pain. Not only is there no software to put the wireless interface into Ad-Hoc mode (iwconfig ath0 mode ad-hoc will tell you:
Error for wireless request "Set Mode" (8B06) :
SET failed on device ath0 ; Invalid argument.
), also there are way too many web pages out there with information that is either incomplete or not quite applicable.

Setting up the Macbook

This part is easy. Click on the "wireless" icon in the task bar, and select "Create network". Give your network a name (for example, "machoc") and pick a channel. I have not experimented with using a WEP key yet (so leave those options blank).

Next, open a terminal (Applications → Utilities) and, as root, type:
ifconfig en1 inet 192.168.0.1

I am guessing this last step is not necessary, and you can just use whatever IP is already assigned to en1. I will test this soon.

Setting up the Eee

Note: this applies to an Eee 701 with an Atheros wireless card (run /sbin/lspci | grep -i wireless to see if you have one), running Eeedora. My guess is this will also work with the default Xandros operating system that comes with the Eee.

The key is to get the wlanconfig tool for putting ath0 into Ad-Hoc mode.

  • download the latest MadWifi source
  • in my case, I got madwifi-0.9.4.tar.bz2, uncompress with:
    tar jxvf madwifi-0.9.4.tar.bz2
  • you also need the kernel-devel package:
    yum install kernel-devel
  • for some reason, the previous step tried to install an incorrect version of the kernel-devel package. Check the version you need by running:
    uname -r
    My kernel version was 2.6.25.6-27. I then found kernel-devel-2.6.25.6-27.fc8.i686.rpm using Google, and installed that:
    rpm -ivh kernel-devel-2.6.25.6-27.fc8.i686.rpm
  • cd madwifi-0.9.4
    make
  • Next, don't do make install, but instead:
    cp wlanconfig /usr/bin

Finally we are ready to set up the Eee as an Ad-Hoc client...:

  • wlanconfig ath0 destroy
  • wlanconfig ath0 create wlandev wifi0 wlanmode ad-hoc
  • ifconfig ath0 192.168.0.2 netmask 255.255.255.0
  • route add default ath0 (not sure if this step is required)
  • route add default gw 192.168.0.1 (the IP address you picked for the Mac)
  • iwconfig ath0 channel 1 (the channel you picked on the Mac)
  • iwconfig ath0 rate 11M (may not be necessary)
  • iwconfig ath0 essid "machoc" (the name you picked on the Mac)

This should do it, you should now be able to ping the Macbook from the Eee:
ping -c 3 192.168.0.1
(and vice versa)

If you try to ssh to the Macbook and it takes a long time until you get the password prompt, you may have to edit the file /private/etc/sshd_config (as root), and uncomment the line:
GSSApiAuthentication no
then go into System Preferences → Sharing, and stop and start the Remote Login service.

To change back to Managed mode (so you can connect to a wireless network again):

  • ifconfig ath0 down
  • wlanconfig ath0 destroy
  • wlanconfig ath0 create wlandev wifi0 wlanmode managed

Do send me a note (see below) if something doesn't work for you. I think this page still needs some polishing, and it would be great to figure out the minimum set of steps.


back to notes and tips index