OpenWrt Forum Archive

Topic: LAN Ok, Wifi don't give IP

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I have a situation that look like this: http://openwrt.org/forum/viewtopic.php?id=2243 but it seems that's not my answer sad

I run WhiteRussian RC2 on a WRT54G V2.2. I just want in the first time to reproduce what I had with the standard Linksys firmware: wired LAN and Wifi bridged together.

The situation: I wired ports work perfectly (dhcp answer correctly), wifi is detectable but don't give IP. The log has no trace of a dhcp request from the wifi.

Here my nvram content for lan:

root@OpenWrt:/rom/etc# nvram show 2>/dev/null | sort | grep ^lan
lan_domain=
lan_hwaddr=00:13:10:0A:F6:CA
lan_hwnames=
lan_ifname=br0
lan_ifnames=vlan0 eth1 eth2 eth3
lan_ipaddr=192.168.1.1
lan_lease=86400
lan_netmask=255.255.255.0
lan_proto=static
lan_stp=0
lan_wins=

wan:

root@OpenWrt:/rom/etc# nvram show 2>/dev/null | sort | grep ^wan
wan_dns=
wan_domain=
wan_gateway=82.232.58.254
wan_gateway_buf=0.0.0.0
wan_get_dns=212.27.54.252 212.27.39.135
wan_get_domain=
wan_hostname=
wan_hwaddr=00:13:10:0A:F6:CB
wan_hwname=
wan_iface=vlan1
wan_ifname=vlan1
wan_ifnames=vlan1
wan_ipaddr=82.232.58.132
wan_lease=604800
wan_mtu=1500
wan_netmask=255.255.255.0
wan_primary=1
wan_proto=dhcp
wan_run_mtu=1500
wan_unit=0
wan_wins=0.0.0.0

Please, ask if you need other informations to help me resolve my problem.
Thanks for your help smile

So, it seems nobody have hint about this problem.

I think I wil flash my router with the original Linksys firmware in order to check if nvram is still correct, then re-flash with openWRT without modifying the nvram.

Do you think this could solve my problem?

Are you sure that the WiFi connection actually works? If you assign a static IP-address to the PC you are trying to connect, can you then ping the accesspoint?

I was using WEP, and there where some problems with the keys, which caused the same problem as you are describing.

Hi, hjernemadsen

Effectively, I'm using WEP encryption (due to restriction on WiFi clients).

If I assign to a client a static IP I can't ping the AP. So this could be the encryption problem you are talking about?
How do you solve your problem?

Here are nvram variables about WEP:

root@OpenWrt:~# nvram show 2>/dev/null | grep wep
wl0_wep_buf=
wl0_wep_last=
security_mode=wep
wl_wep_bit=64
wl0_wep=enabled
wl0_wep_bit=64
wl_wep_last=
wl_wep=enabled
wl_wep_gen=home42sharedp:2C7F41FA43:BC4115E05F:300033626F:AA463BF04A:1
wl0_wep_gen=
wl_wep_buf=home42sharedp:0987654321:BC4115E05F:300033626F:AA463BF04A:1

And here the variables relatives to "key":

root@OpenWrt:~# nvram show 2>/dev/null | grep key
eou_key_index=1
wl0_key1=0987654321
wl0_key2=BC4115E05F
wl0_key3=300033626F
wl0_key4=AA463BF04A
wl_wpa_gtk_rekey=3600
wl_key1=0987654321
wl_key2=BC4115E05F
wl_key3=300033626F
wl_key4=AA463BF04A
wl_radius_key=
eou_private_key=20e05d155850e109b77b494cba163fd9b8dfab401a3c6c30dff9889d4c189df24c7c7f29e925a49554450e559faee9b6d831d34cd21f414a72582920e1d385c10e87f73d6427169f2b774f02e669a676707bdb58da47ba36da4920e148a3620413efdede8439eaa6df37a90e2fbba3ee1d16d5914e87001ed061a875c8ae1af9
wl0_wpa_gtk_rekey=3600
wl0_key=1
wl0_radius_key=
wl_key=1
eou_public_key=ba4cba239f1fa5e1ba654a081e7e147c6cf37515ea010fbf9fdb5b7b59e0d45d06c17b42d3d54f4e32dca68fde3481b6c91a5808a6b11ca5dd48e90faa594b47b32bdbbcd51b3239b9a8a766dab968a662af6824eda3a369d9b1aed11903ef1e5b01c2a6eb06f32b1e62458f2610138a73f63f577ead6d805a8ddafd5c10255b11

Hoping this could help.

Thanks by advance.

Yes. That is exactly the problem I have experienced.

The problem is that the wifi tool, does not choose the correct key, when configuring the WEP encryption on the access-point. If you take a look at the output of iwconfig, the encryption key used by the access point is wl0_key4 instead of wl0_key1.

The easiest way to fix this, is to insert the following command into /etc/init.d/S40etwork, just after it calls wifi up:

iwconfig eth1 key [1] `nvram get wl0_key1`

I have a patch for the wifi-tool, which you can use instead, if you recompile it on your own. It is available here:

http://forum.openwrt.org/viewtopic.php?id=2153

The line correct truly the WEP key, but it seems that I still can't get IP from Wifi.

I'll try your patch in the next hours, just the time to learn how to compile the firmware with the modification.
In this time, there's just a line or two (with the arrow in front of line) in my log that I think could be strange:

Jan  1 00:00:09 (none) kern.warn kernel: vlan0: Setting MAC address to  00 13 10 0a f6 ca.
Jan  1 00:00:09 (none) kern.warn kernel: VLAN (vlan0):  Underlying device (eth0) has same MAC, not checking promiscious mode.
Jan  1 00:00:09 (none) kern.debug kernel: vlan0: add 01:00:5e:00:00:01 mcast address to master interface
Jan  1 00:00:09 (none) kern.info kernel: device eth1 entered promiscuous mode
Jan  1 00:00:09 (none) kern.info kernel: eth1: attempt to add interface with same source address.
Jan  1 00:00:09 (none) kern.info kernel: br0: port 2(eth1) entering learning state
Jan  1 00:00:09 (none) kern.info kernel: br0: port 1(vlan0) entering learning state
Jan  1 00:00:09 (none) kern.info kernel: br0: port 2(eth1) entering forwarding state
Jan  1 00:00:09 (none) kern.info kernel: br0: topology change detected, propagating
Jan  1 00:00:09 (none) kern.info kernel: br0: port 1(vlan0) entering forwarding state
Jan  1 00:00:09 (none) kern.info kernel: br0: topology change detected, propagating
Jan  1 00:00:11 (none) kern.warn kernel: vlan1: Setting MAC address to  00 13 10 0a f6 cb.
Jan  1 00:00:11 (none) user.info : info, udhcpc (v0.9.9-pre) started
Jan  1 00:00:11 (none) kern.debug kernel: vlan1: add 01:00:5e:00:00:01 mcast address to master interface

[...]

Jan  1 00:00:12 (none) user.info : deleting routers
--> Jan  1 00:00:12 (none) user.info : route: SIOC[ADD|DEL]RT: No such process

[...]

Jan  1 00:00:13 (none) kern.info kernel: br0: port 2(eth1) entering disabled state
Jan  1 00:00:27 (none) kern.info dnsmasq[640]: started, version 2.22 cachesize 150
Jan  1 00:00:27 (none) kern.info dnsmasq[640]: DHCP, IP range 192.168.1.100 -- 192.168.1.115, lease time 12h
Jan  1 00:00:27 (none) kern.info dnsmasq[640]: DHCP, IP range 192.168.1.100 -- 192.168.1.115, lease time 12h
Jan  1 00:00:27 (none) kern.info dnsmasq[640]: using local addresses only for domain lan
Jan  1 00:00:27 (none) kern.info dnsmasq[640]: read /etc/hosts - 2 addresses
--> Jan  1 00:00:27 (none) kern.err dnsmasq[640]: failed to read /etc/ethers:No such file or directory

Are these lines normal?

The discussion might have continued from here.