# wireless working, now how do I get an IP? [solved]

## dmvianna

```
# ifconfig

ath0       Encapsulamento do Link: Ethernet  Endereço de HW 00:16:CB:B5:D5:93  

          UP BROADCASTNOTRAILERS RUNNING PROMISC MULTICAST  MTU:1500  Métrica:1

          RX packets:22758 errors:0 dropped:0 overruns:0 frame:0

          TX packets:80 errors:0 dropped:0 overruns:0 carrier:0

          colisões:0 txqueuelen:0 

          RX bytes:13561109 (12.9 Mb)  TX bytes:47200 (46.0 Kb)

eth0       Encapsulamento do Link: Ethernet  Endereço de HW 00:16:CB:90:D5:6B  

          inet end.: 192.168.0.103  Bcast:192.168.0.255  Masc:255.255.255.0

          UP BROADCASTNOTRAILERS RUNNING MULTICAST  MTU:1500  Métrica:1

          RX packets:37966 errors:0 dropped:0 overruns:0 frame:0

          TX packets:26136 errors:0 dropped:0 overruns:0 carrier:0

          colisões:0 txqueuelen:1000 

          RX bytes:42853994 (40.8 Mb)  TX bytes:2736485 (2.6 Mb)

          IRQ:16 

lo         Encapsulamento do Link: Loopback Local  

          inet end.: 127.0.0.1  Masc:255.0.0.0

          UP LOOPBACKRUNNING  MTU:16436  Métrica:1

          RX packets:3929 errors:0 dropped:0 overruns:0 frame:0

          TX packets:3929 errors:0 dropped:0 overruns:0 carrier:0

          colisões:0 txqueuelen:0 

          RX bytes:538535 (525.9 Kb)  TX bytes:538535 (525.9 Kb)

wifi0      Encapsulamento do Link: Não Especificado  Endereço de HW 00-16-CB-B5-D5-93-A0-5B-00-00-00-00-00-00-00-00  

          UP BROADCASTRUNNING MULTICAST  MTU:1500  Métrica:1

          RX packets:233996 errors:0 dropped:45958 overruns:0 frame:3884

          TX packets:5782 errors:0 dropped:0 overruns:0 carrier:0

          colisões:0 txqueuelen:199 

          RX bytes:33034059 (31.5 Mb)  TX bytes:349356 (341.1 Kb)

          IRQ:17 Memória:f9100000-f9110000 
```

I still can't get access to the internet if I take the ethernet cable off, even though wpa_supplicant is properly configured and my network shows up in wmwifi with 36Mb rate.   :Confused: 

----------

## lesourbe

as you would do it for ethernet. statical or dhcp.

----------

## dmvianna

```
 cat /etc/conf.d/net

modules=( "wpa_supplicant" )

wpa_supplicant_ath0="-Dmadwifi"

wpa_timeout_ath0=60

config_ath0=( "dhcp" )

dhcp_ath0="nodns nontp nonis"

```

It still does not dhcp. Now what?

----------

## lesourbe

does your access point act as a DHCP server ?

try without dhcp.

----------

## dmvianna

```
ath0       Encapsulamento do Link: Ethernet  Endereço de HW 00:16:CB:B5:D5:93  

          inet end.: 192.168.0.101  Bcast:192.168.0.255  Masc:255.255.255.0

          UP BROADCASTNOTRAILERS RUNNING PROMISC MULTICAST  MTU:1500  Métrica:1

          RX packets:27576 errors:0 dropped:0 overruns:0 frame:0

          TX packets:94 errors:0 dropped:0 overruns:0 carrier:0

          colisões:0 txqueuelen:0 

          RX bytes:16565063 (15.7 Mb)  TX bytes:54364 (53.0 Kb)

```

 It finally appeared on gkrellm, and it shows activity, but I cannot use the internet still. How can I direct traffic to that device?

[EDIT]: Yes, I have an Ubuntu machine which dhcps to that access point.

----------

## lesourbe

dirty trick (what I actually do) :

ifconfig others down

----------

## dmvianna

Nope.

----------

## lesourbe

the problem must be near authentification.

----------

## thepustule

When you say "I cannot use the internet still" - what do you mean?  Did you just try to open your browser?

There are several steps that must be working before the browser will load web pages.

First, verify your setup - does another computer work with this wireless router?

Second, do you have a default route?  Having an IP address is only part of the challenge

Third, is your DNS working?  Try to ping a host by name.  for instance, ping www.kernel.org  - it is very possible you won't get replies, but that isn't the important thing - did the ping command actually resolve to an IP address and then try pinging that IP?

Now, check connectivity - can you ping your router?  Can you ping a host out there on the internet?

Try traceroute - make sure your traffic is actually going somewhere.  

The bottom line - simply opening your browser is about the worst test of network function - there are about 4 or 5 things that all have to be working right before those pages will load.  If the page doesn't load, you have no idea which piece is broken.

----------

## dmvianna

My test was to ping the router. Didn't work. And yes, another computer can successfully use the wireless router.

I have no idea on how to match the router's configuration and wpa_supplicant.conf. Ubuntu did it automagically. All I did was to test randomly, until I found that my system connected. On the router, those are the configurations:

```
Channel: 6

Config: WEP

WEP Encryption: 64 bit

Key mode: Hex
```

/etc/conf.d/net:

```
modules=( "wpa_supplicant" )

wpa_supplicant_ath0="-Dmadwifi"

wpa_timeout_ath0=60

#config_ath0=( "dhcp" )

#dhcp_ath0="nodns nontp nonis"

config_ath0=( "192.168.0.101/24 broadcast 192.168.0.255" )

routes_ath0=( "default via 192.168.0.10" )
```

/etc/wpa_supplicant.conf:

```

# The below line not be changed otherwise we refuse to work

ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration

ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection

ap_scan=1

# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers

network={

  ssid="server"

  psk="password"

  # The higher the priority the sooner we are matched

  priority=5

}

# Same as previous, but request SSID-specific scanning (for APs that reject

# broadcast SSID)

network={

  ssid="server"

  scan_ssid=1

  psk="password"

  priority=2

}

# Only WPA-PSK is used. Any valid cipher combination is accepted

network={

  ssid="server"

  proto=WPA

  key_mgmt=WPA-PSK

  pairwise=CCMP TKIP

  group=CCMP TKIP WEP104 WEP40

  psk="password"

  priority=2

}

# Plaintext connection (no WPA, no IEEE 802.1X)

network={

  ssid="plaintext-test"

  key_mgmt=NONE

}

# Shared WEP key connection (no WPA, no IEEE 802.1X)

network={

  ssid="server"

  key_mgmt=NONE

  wep_key0="password"

  wep_key1=""

  wep_key2=""

  wep_tx_keyidx=0

  priority=5

}

# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key

# IEEE 802.11 authentication

network={

  ssid="server"

  key_mgmt=NONE

  wep_key0="abcde"

  wep_key1=0102030405

  wep_key2="1234567890123"

  wep_tx_keyidx=0

  priority=5

  auth_alg=SHARED

}

# IBSS/ad-hoc network with WPA-None/TKIP

network={

  ssid="server"

  mode=1

  proto=WPA

  key_mgmt=WPA-NONE

  pairwise=NONE

  group=TKIP

  psk="password"

}

```

----------

## 1clue

Here's one for you:  I've seen a wireless router whose DHCP configuration was set up with a one-address pool.

Why that would be, I have no idea other than maybe as some sort of redneck security measure, to prevent more than one computer from getting an address.  Of course, if the guy with the black hat gets an address first, you can't get on anymore.

Back to the point, I don't know if that was set up that way by the guy who installed the router or if it was factory.

----------

## dmvianna

From the Gentoo Wiki:

 *Quote:*   

>     *  Q. The script claims to connect, but I cannot get a DHCP address or ping computers
> 
>     * A. Are you using WEP? See above. Remember that this script just configures wireless for you and some settings allow you to "connect" even though they are blatently wrong.

 

[EDIT]: I should have ommitted the quotes in the passphrase, as it is hex, and configured it for WEP. Now it works.   :Wink: 

----------

