title: How to connect raspberrypi to Ad-Hoc
body: <p>I am trying to have a RaspberryPi (running Raspbian) join an Ad-Hoc network (no password) hosted by a desktop computer with a wireless card running Debian 7. I was able to connect to the Ad-Hoc network with a laptop running Windows 7 and it successfully was given the IP 10.42.0.69, however, all of my attempts at connecting from the RaspberryPi have failed.</p>
  
  <p>The RaspberryPi is using the Edimax Wifi USB, and I already tried to request a static IP for the Ad-Hoc network with the following settings in /etc/network/interfaces:</p>
  
  <pre><code>auto wlan0
  iface wlan0 inet static
      address 10.42.0.2
      netmask 255.255.255.0
      wireless-channel 1
      wireless-mode ad-hoc
      wireless-essid TESTING
  </code></pre>
  
  <p>All that I did to configure the wifi network on the desktop is to use "Create New Wireless Network" in the panel's network manager. Below is the output of ifconfig on the Debian 7 desktop:</p>
  
  <pre><code>wlan0     
      Link encap:Ethernet  HWaddr 00:11:50:d5:d6:61  
      inet addr:10.42.0.1  Bcast:10.42.0.255  Mask:255.255.255.0
      inet6 addr: fe80::211:50ff:fed5:d661/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:5347 errors:0 dropped:0 overruns:0 frame:0
      TX packets:8698 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:884808 (864.0 KiB)  TX bytes:4728097 (4.5 MiB)
  </code></pre>
  
  <p>And here is iwconfig:</p>
  
  <pre><code>wlan0 
      IEEE 802.11bg  ESSID:"TESTING"  
      Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: C6:D7:1D:CB:74:CD   
      Tx-Power=20 dBm   
      Retry  long limit:7   RTS thr:off   Fragment thr:off
      Encryption key:off
      Power Management:off
  </code></pre>
  
  <p>What do I need in /etc/network/interfaces on the RPi to get it to connect?</p>