OpenWrt Forum Archive

Topic: Openwrt as WLAN client doesn't get an IP address

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

Hello!
I'm trying to set up my TL-MR3020 with OpenWRT as WiFi routed client as described in http://wiki.openwrt.org/doc/recipes/routedclient (masquerade). My router successfully connects to WiFi network but cannot get an IP from other router DHCP server. Other devices are connects to that WLAN as usually. What should be done to receive a DHCP answer? There is neither firewall on AP nor on client.

Config files:

/etc/config/wireless:

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'platform/ar933x_wmac'
        option htmode 'HT20'
        option txpower '30'
        option country 'US'

config wifi-iface
        option device 'radio0'
        option encryption 'psk2'
        option wds '1'
        option mode 'sta'
        option ssid 'TTECR_EIKS'
        option key '8F85KsiU'
        option network 'wan'

/etc/config/network:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd09:9471:0dff::/48'

config interface 'lan'
        option ifname 'eth0'
        option force_link '1'
        option ip6assign '60'
        option proto 'static'
        option ipaddr '192.168.89.254'
        option netmask '255.255.255.0'

config interface 'wan'
        option proto 'dhcp'

iwconfig wlan0:

wlan0     IEEE 802.11bgn  ESSID:"TTECR_EIKS"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 10:7B:EF:5B:1E:80   
          Bit Rate=21.7 Mb/s   Tx-Power=15 dBm   
          RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=36/70  Signal level=-74 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:105   Missed beacon:0

syslog:

Fri Apr 17 13:44:18 2015 daemon.notice netifd: Network device 'wlan0' link is down
Fri Apr 17 13:44:18 2015 kern.info kernel: [15903.140000] br-lan: port 2(wlan0) entered disabled state
Fri Apr 17 13:44:18 2015 kern.info kernel: [15903.160000] br-lan: port 2(wlan0) entered disabled state
Fri Apr 17 13:44:18 2015 daemon.notice netifd: lan (9421): Received SIGTERM
Fri Apr 17 13:44:18 2015 daemon.notice netifd: Interface 'lan' is now down
Fri Apr 17 13:44:18 2015 kern.info kernel: [15903.330000] device eth0 left promiscuous mode
Fri Apr 17 13:44:18 2015 kern.info kernel: [15903.340000] br-lan: port 1(eth0) entered disabled state
Fri Apr 17 13:44:18 2015 kern.info kernel: [15903.350000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Fri Apr 17 13:44:18 2015 kern.info kernel: [15903.370000] device wlan0 left promiscuous mode
Fri Apr 17 13:44:18 2015 kern.info kernel: [15903.370000] br-lan: port 2(wlan0) entered disabled state
Fri Apr 17 13:44:18 2015 daemon.notice netifd: Interface 'lan' is disabled
Fri Apr 17 13:44:18 2015 daemon.notice netifd: Interface 'lan' has link connectivity loss
Fri Apr 17 13:44:18 2015 daemon.notice netifd: Interface 'lan' is enabled
Fri Apr 17 13:44:18 2015 daemon.notice netifd: Interface 'lan' is setting up now
Fri Apr 17 13:44:18 2015 daemon.notice netifd: Interface 'lan' is now up
Fri Apr 17 13:44:19 2015 user.notice firewall: Reloading firewall due to ifup of lan (eth0)
Fri Apr 17 13:44:20 2015 kern.info kernel: [15904.700000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Fri Apr 17 13:44:22 2015 kern.info kernel: [15906.660000] wlan0: authenticate with 10:7b:ef:5b:1e:80
Fri Apr 17 13:44:22 2015 kern.info kernel: [15906.670000] wlan0: send auth to 10:7b:ef:5b:1e:80 (try 1/3)
Fri Apr 17 13:44:22 2015 kern.info kernel: [15906.680000] wlan0: authenticated
Fri Apr 17 13:44:22 2015 kern.info kernel: [15906.690000] wlan0: associate with 10:7b:ef:5b:1e:80 (try 1/3)
Fri Apr 17 13:44:22 2015 kern.info kernel: [15906.690000] wlan0: RX AssocResp from 10:7b:ef:5b:1e:80 (capab=0x411 status=0 aid=1)
Fri Apr 17 13:44:22 2015 kern.info kernel: [15906.700000] wlan0: associated
Fri Apr 17 13:44:22 2015 kern.info kernel: [15906.700000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Fri Apr 17 13:44:22 2015 daemon.notice netifd: Network device 'wlan0' link is up
Fri Apr 17 13:44:31 2015 kern.info kernel: [15916.170000] wlan0: deauthenticating from 10:7b:ef:5b:1e:80 by local choice (Reason: 3=DEAUTH_LEAVING)
Fri Apr 17 13:44:31 2015 daemon.notice netifd: Network device 'wlan0' link is down
Fri Apr 17 13:44:32 2015 kern.info kernel: [15916.760000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Fri Apr 17 13:44:32 2015 daemon.notice netifd: Interface 'wan' is enabled
Fri Apr 17 13:44:33 2015 kern.info kernel: [15918.250000] wlan0: authenticate with 10:7b:ef:5b:1e:80
Fri Apr 17 13:44:33 2015 kern.info kernel: [15918.270000] wlan0: send auth to 10:7b:ef:5b:1e:80 (try 1/3)
Fri Apr 17 13:44:33 2015 kern.info kernel: [15918.270000] wlan0: authenticated
Fri Apr 17 13:44:33 2015 kern.info kernel: [15918.290000] wlan0: associate with 10:7b:ef:5b:1e:80 (try 1/3)
Fri Apr 17 13:44:33 2015 kern.info kernel: [15918.290000] wlan0: RX AssocResp from 10:7b:ef:5b:1e:80 (capab=0x411 status=0 aid=1)
Fri Apr 17 13:44:33 2015 kern.info kernel: [15918.300000] wlan0: associated
Fri Apr 17 13:44:33 2015 daemon.notice netifd: Network device 'wlan0' link is up
Fri Apr 17 13:44:33 2015 daemon.notice netifd: Interface 'wan' has link connectivity 
Fri Apr 17 13:44:33 2015 daemon.notice netifd: Interface 'wan' is setting up now
Fri Apr 17 13:44:33 2015 daemon.notice netifd: wan (9900): udhcpc (v1.22.1) started
Fri Apr 17 13:44:33 2015 daemon.notice netifd: wan (9900): Sending discover...
Fri Apr 17 13:44:36 2015 daemon.notice netifd: wan (9900): Sending discover...
Fri Apr 17 13:44:39 2015 daemon.notice netifd: wan (9900): Sending discover...

All firewall tables are empty, policy is ACCEPT at all.
Connection is established via script when I switch the slider to 3G position, the script is placed at /etc/hotplug.d/button/00-button

Dan Swano wrote:

Hello!
I'm trying to set up my TL-MR3020 with OpenWRT as WiFi routed client as described in http://wiki.openwrt.org/doc/recipes/routedclient (masquerade). My router successfully connects to WiFi network but cannot get an IP from other router DHCP server.

Config files:

/etc/config/wireless:

...
config wifi-iface
        option device 'radio0'
        option encryption 'psk2'
        option wds '1'
        option mode 'sta'
        option ssid 'TTECR_EIKS'
        option key '8F85KsiU'
        option network 'wan'

Interesting - the only difference between your config and the one on my MR3020 is your "option wds '1'". If i add that to my configuration, the router doesnt get an IP address assigned as well - so just try to remove it.

ninno wrote:

Interesting - the only difference between your config and the one on my MR3020 is your "option wds '1'". If i add that to my configuration, the router doesnt get an IP address assigned as well - so just try to remove it.

Thanks! The question is solved. When I remove wds option the router gets an IP. But now I can't remember why I added this option, I think it was somewhere at openwrt.org howtos...

Dan Swano wrote:
ninno wrote:

Interesting - the only difference between your config and the one on my MR3020 is your "option wds '1'". If i add that to my configuration, the router doesnt get an IP address assigned as well - so just try to remove it.

Thanks! The question is solved. When I remove wds option the router gets an IP. But now I can't remember why I added this option, I think it was somewhere at openwrt.org howtos...

Perfect. Well yes, that option is for real Atheros-WDS (which is perfectly working as well if only Atheros devices are involved on both ends). I did use such a setup for a while.
http://wiki.openwrt.org/doc/recipes/atheroswds

(Last edited by ninno on 21 Apr 2015, 07:03)

The discussion might have continued from here.