# Unable to obtain IP from a WEP Ad-hoc Android network

## PM17E5

I'm trying to connect to my ZTE Android phone which has wireless tathering enabled, however for some reason it's only able to make it an ad-hoc network. I've read some things about wpa_supplicant being able and unable to connect to ad-hoc networks.

This is the output of scan results in wpa_cli:

```
bssid / frequency / signal level / flags / ssid

02:d5:ef:aa:ef:ea       2462    241     [WEP][IBSS]     Android
```

This is how my wpa_supplicant file looks:

```
network={

   ssid="Android"

   mode=1

   frequency=2462

   key_mgmt=NONE

   wep_key0="12345678901"

}
```

It will connect and associate with the network but it will not get an IP. Should the IP be set manually then? Because in Windows it doesn't do that. And if so, should I set the IP in /etc/conf.d/net or /etc/wpa_supplicant/wpa_supplicant.conf? I'm not even sure if it can be set in the later, but I don't know if the former will set it as well due to the later having control over the card.

----------

## NeddySeagoon

PM17E5,

Ad-hoc networks have no dhcp server to allocate IP addresses, routes or anything like that.

The dhcpcd running on the box should allocate itself a link local IP.

This lets it talk to other nodes in the ad-hoc network but there is still no routing to get you to the internet.

By definition ad-hoc networking is for an isolated group of machines.

----------

## Gusar

How exactly do you connect, manually with wpa_supplicant? If yes, just start a dhcp client (usually dhcpcd) after wpa_supplicant connects.

@NeddySeagoon: In my experience, they do actually. One side (the one with an internet connection that is to be shared to other ad-hoc devices) will have a dhcp server. In this case, I'm quite sure dnsmasq is running on the Android phone.

----------

## PM17E5

Hmm, odd. Thanks for clearing that up. I'm still a bit confused why windows computers will talk to my Android phones but my Gentoo laptop will not. Everything I could look up about it on the internet said that it has to do with wpa_cli not having support for ad-hoc networking?

----------

## Gusar

wpa_supplicant very much does support ad-hoc. That's what the "mode=1" in your config sets. What you're reading about probably is that some Android phones by default don't have ad-hoc support. It's all about how wpa_supplicant is compiled, and for the aforementioned phones replacement wpa_supplicant compiles are available.

----------

## NeddySeagoon

PM17E5,

There is a Windows mode oprion in the kernel ... 

```
<M>   Host for RNDIS and ActiveSync devices (EXPERIMENTAL)  
```

Which I need to get my Android device to talk to the kernel over USB

----------

## NeddySeagoon

PM17E5,

There is a Windows mode oprion in the kernel ... 

```
<M>   Host for RNDIS and ActiveSync devices (EXPERIMENTAL)  
```

Which I need to get my Android device to talk to the kernel over USB

----------

