OpenWrt Forum Archive

Topic: Wrt54gsv4 RC3 clientmode problem

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

I succesfully flashed the RC3 firmware using the original webinterface using
openwrt-wrt54gs_v4-squashfs.bin (14-Sep-2005 19:21  1.5M)
and followed the instructions in http://wiki.openwrt.org/ClientModeHowto, first bridged than routed client. I also tried other howto's like the one on martybugs.net and others. No success. I scanned the forum but did not find a solution. So I started again using the original instructions.

configuration steps I took:

removed firewal
installed wl using wired connection
erased nvram
lan_ipaddres = 192.168.6.1
wan_ipaddrs = 192.168.1.128 or 192.168.7.1
wan_proto=static, dhcp or none
wl0_mode=wet or sta

after commit and rebooting i can connect fine using (wired) lan and can use ' wl join ...' to connect to wireless lan and see using iwconfig that the wireless interface is up on eth1.

I expect to be able to ping the router of the wireless lan, is this correct? In any case i can't ping it.

my questions:
Is my assumption wrong and am I missing something or is there something not ok in rc3 on the wrtgsv4?
Do I have to set a bridge to be able to ping the router? I tried the bridge using if_names for bridged client configuration but it failed.
I'm prepared to do additional research but I need a hint.

Greetings
Nico de Groot

Hi!
I seem to have a bit similar problem. You see I live in such town where town provides internet-connection with WLAN. (www.panoulu.net, actually this is the closest one: http://www.panoulu.net/ap/details.php?a … lu.local.) Unfortunately (or not) my flat has got selective glasses. That means that WLAN wouldn work inside. So I need somethig inbetween. For starters I tought that Linskys wrt54g with openwrt would do the trick, but it seems to be dissapointment - so far.
I think it should be able to be done, since at the same time I've got borrowed SCM 2662 (an usb-gadged with wlan-card at the end of usb-cable) and in windows that is workin just great (as the toilet in trains).


So, What has been done:
- got rid of dhcp-server
- got rid of firewall
- set wl0_mode to sta and wet (both have been tried out)
- set correct channel
- set correct ssid
- set wl0_akm open

1st round: (http://wiki.openwrt.org/ClientModeHowto, 1.1.1 bridged client mode)
- set lan_ifnames "vlan0 eth1"
- set wan_ifname vlan1
==> not working
- set wifi_ifname=eht1
- set wifi_proto=dhcp
- ifup wifi
=> still not working

2nd round (http://wiki.openwrt.org/ClientModeHowto, 1.1.2 routed client mode)
- set lan_ifnames vlan0
- set lan_ifname br0
- set wan_ifname=eth1
- set lan_ipaddr=192.168.1.1
- set lan_proto=static
- set wan_proto=dhcp
- ifup wan; /sbin/wifi
Expecting 10.20.*.* address from dhcp
==> not working

iwconfig gives:
root@OpenWrt:~# iwconfig eth1
eth1      IEEE 802.11-DS  ESSID:"panoulu" 
          Mode:Repeater  Frequency:2.417 GHz  Access Point: 00:0E:D7:B0:FC:A1   
          Tx-Power:31 dBm   
          RTS thr=2347 B   Fragment thr=2346 B   
          Encryption key:off
          Link Quality:0/0  Signal level:-74 dBm  Noise level:-98 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:218  Invalid misc:0   Missed beacon:0

root@OpenWrt:~# ifup wan
info, udhcpc (v0.9.9-pre) started
debug, Sending discover...
root@OpenWrt:~# debug, Sending discover...
debug, Sending discover...
info, No lease, forking to background.


So as I understand it - that should be working. But it's not.
So far I am out of ideas. Maybe I could be desperate and tried to change the hw-address (if there is some plot between cisco-equipment..) but that soution doesn't seem likely.

Any ideas are highly appreciated!
- How could I debug what there is happening on arp-level?
- Could I somehow sniff-around and see wether the other end is reseiving me?
- any ideas?
- something I forgot to do?

RumaX wrote:

Hi!
I seem to have a bit similar problem. You see I live in such town where town provides internet-connection with WLAN. (www.panoulu.net, actually this is the closest one: http://www.panoulu.net/ap/details.php?a … lu.local.) Unfortunately (or not) my flat has got selective glasses. That means that WLAN wouldn work inside. So I need somethig inbetween. For starters I tought that Linskys wrt54g with openwrt would do the trick, but it seems to be dissapointment - so far.
I think it should be able to be done, since at the same time I've got borrowed SCM 2662 (an usb-gadged with wlan-card at the end of usb-cable) and in windows that is workin just great (as the toilet in trains).


So, What has been done:
- got rid of dhcp-server
- got rid of firewall
- set wl0_mode to sta and wet (both have been tried out)
- set correct channel
- set correct ssid
- set wl0_akm open

1st round: (http://wiki.openwrt.org/ClientModeHowto, 1.1.1 bridged client mode)
- set lan_ifnames "vlan0 eth1"
- set wan_ifname vlan1
==> not working
- set wifi_ifname=eht1
- set wifi_proto=dhcp
- ifup wifi
=> still not working

2nd round (http://wiki.openwrt.org/ClientModeHowto, 1.1.2 routed client mode)
- set lan_ifnames vlan0
- set lan_ifname br0
- set wan_ifname=eth1
- set lan_ipaddr=192.168.1.1
- set lan_proto=static
- set wan_proto=dhcp
- ifup wan; /sbin/wifi
Expecting 10.20.*.* address from dhcp
==> not working

iwconfig gives:
root@OpenWrt:~# iwconfig eth1
eth1      IEEE 802.11-DS  ESSID:"panoulu" 
          Mode:Repeater  Frequency:2.417 GHz  Access Point: 00:0E:D7:B0:FC:A1   
          Tx-Power:31 dBm   
          RTS thr=2347 B   Fragment thr=2346 B   
          Encryption key:off
          Link Quality:0/0  Signal level:-74 dBm  Noise level:-98 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:218  Invalid misc:0   Missed beacon:0

root@OpenWrt:~# ifup wan
info, udhcpc (v0.9.9-pre) started
debug, Sending discover...
root@OpenWrt:~# debug, Sending discover...
debug, Sending discover...
info, No lease, forking to background.


So as I understand it - that should be working. But it's not.
So far I am out of ideas. Maybe I could be desperate and tried to change the hw-address (if there is some plot between cisco-equipment..) but that soution doesn't seem likely.

Any ideas are highly appreciated!
- How could I debug what there is happening on arp-level?
- Could I somehow sniff-around and see wether the other end is reseiving me?
- any ideas?
- something I forgot to do?

Hello ,
And what have you done with your Firewall startup script ?
Only deleted ?

It is stupid  to think that the erasing of your firewall rules is ok for Internet access over wlan , you must not delete , you have to CHANGE THE FIREWALL RULES !
In the right direction ....
Put something like that in  /etc/init.d/S45Firewall :

#!/bin/sh
. /etc/functions.sh

WAN=$(nvram get wan_ifname)
WIFI=$(nvram get wifi_ifname)

IPT=/usr/sbin/iptables

for T in filter nat mangle ; do
  $IPT -t $T -F
    $IPT -t $T -X
    done

    $IPT -t filter -A INPUT -m state --state INVALID -j DROP
    $IPT -t filter -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
    $IPT -t filter -A INPUT -i $WIFI -j DROP

    $IPT -t filter -A FORWARD -m state --state INVALID -j DROP
    $IPT -t filter -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
    $IPT -t filter -A FORWARD -i $WIFI -j DROP
    $IPT -t filter -A FORWARD -o $WIFI -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
    $IPT -t nat -A POSTROUTING -o $WIFI -j MASQUERADE

Damn , I think you can read that at the clientmode -howto
Remember , the  Router can handle different Networks , to use it , you have to do Network adress translating or in short
NAT
Exactly this does the script -example above
Without something like that it will never work
if you use bridget client then your internal network have to be in the same adress -range as your wlan -network
It can be that i am wrong , please correct me then .
Hope this helps a little bit
have a nice day !

Don't set both wifi_ifname and wan_ifname to the same interface or there'll be a conflict over the device. Interfaces should only show up once in the *ifname(s) variables.

(note: wl0_ifname is unrelated to ifup and is an exception to this rule)

Since you're not bridging (and it really doesn't make sense to) you'll want to use wl0_mode=sta. This also means that you'll have to eventually restore the firewall to fix NAT or you won't be able to get online from behind the router.

Also, "wifi" turns on the wifi radio and sets the parameters, it really should go before 'ifup wan' since wan is your wireless.

"wl status" might give you a better indication as to what your connection is.

The same for me, None bridged Client with WPA2 (tkip) is not working for me, have someone a discription ?

Hmm, here the same. I can't get WPA2 (tkip) working in bridged client mode. I can't ping the ap_2_AP router. No encryption, WEP encryption and WPA (tkip) encryption works fine.

Both routers are WRT54GS v1.0 hardware. I'm using nbd's standard pre-rc4 images from 18-Nov.

EDIT: Since the problem is still present in the pre-rc4 images I created a ticket in trac.

Here are my wl0_* NVRAM setting from both the client Wrt and the Wrt in ap mode:

root@ap_1_CLIENT:/# strings /dev/nvram | sort | grep ^wl0
wl0_akm=psk2
wl0_channel=13
wl0_country_code=All
wl0_crypto=tkip
wl0_gmode=2
wl0_ifname=eth1
wl0_infra=1
wl0_key1=deadbeef12345deadbeef12345
wl0_key=1
wl0_mode=wet
wl0_radio=1
wl0_ssid=OpenWrtTest
wl0_wep=disabled
wl0_wpa_psk=test1234test
wl0gpio2=0
wl0gpio3=0
wl0id=0x4320
root@ap_1_CLIENT:/#
root@ap_2_AP:/# strings /dev/nvram | sort | grep ^wl0
wl0_akm=psk2
wl0_channel=13
wl0_country_code=All
wl0_crypto=tkip
wl0_gmode=2
wl0_ifname=eth1
wl0_infra=1
wl0_key1=deadbeef12345deadbeef12345
wl0_key=1
wl0_mode=ap
wl0_radio=1
wl0_ssid=OpenWrtTest
wl0_wep=disabled
wl0_wpa_psk=test1234test
wl0gpio2=0
wl0gpio3=0
wl0id=0x4320
root@ap_2_AP:/# ipkg list_installed | grep ^nas
nas - 3.90.37-13 -
root@ap_2_AP:/#
root@ap_1_CLIENT:/# iwconfig eth1
eth1      IEEE 802.11-DS  ESSID:"OpenWrtTest"
          Mode:Repeater  Frequency:2.472 GHz  Access Point: 00:12:17:D4:36:44
          Tx-Power:31 dBm
          RTS thr=2347 B   Fragment thr=2346 B
          Encryption key:off
          Link Signal level:-23 dBm  Noise level:-96 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:0   Missed beacon:0

root@ap_1_CLIENT:/#

(Last edited by olli_04 on 22 Nov 2005, 11:15)

thank you Joachim. You (in a way) forced me to study litlebit about iptables (http://www.linuxguruz.com/iptables/howt … WTO-1.html)
But but.. it still puzzles me.. I mean I think I should be able to obtain IP addresses from DHCP (from towns server) accross the network evenif I didn't have the Firewall set.

Now what I've done:
- bugged even more people wiht my petty problem - thanks everyone so far
- flashed nbd's pre-RC4

-set client mode (sta)

nvram set lan_ifnames=vlan0
nvram set lan_ifname=br0
nvram set wan_ifname=eth1
nvram set lan_ipaddr=192.168.1.1
nvram set lan_proto=static
nvram set wan_proto=dhcp
- set correct ssid
- set correct channel (as above)

And I am unhappy to inform you guys that the response is the same.. Still iwconfig (or wl status) gives the same and no addresses are distributed through WLAN/DHCP..

BTW: If I was getting IP's from DHCP would they be written in nvram (no?).. How does it take them in use? How can I see if they are in use? (check route?, check ifconfig?)
As you can see I am completely lost here.

So, I finally capitulate to get bridged client mode with WPA2 (tkip) preshared key and the nas binary working.

Seems that it's impossible to get this configuration going (after one day of testing) in White Russian.

(Last edited by olli_04 on 22 Nov 2005, 16:20)

Hi,

@olli_04
i had similar problems with WPA-PSK and client-mode (routed mode).
My AP runs RC3 with nas and WPA-PSK (AES)
when i try tho connect the client (wl0_mode=sta) it fails,  the station was not authorize on the AP.
by playing with some machines i realize that this on which run RC2 will work fine.
So i setup the station with RC2  and it work creat.
here the config for AP(RC3) and STA(RC2):
nas -P /tmp/nas.lan.pid -l eth1 -H 34954 -i eth1 -A -m 4 -k abcxyz -s wlan -w 4 -g 3600
nas -P /tmp/nas.lan.pid -H 34954 -i eth1 -S -m 4 -k abcxyz -s wlan -w 4

perhaps this solve the problem for you too?

olli_04 wrote:

So, I finally capitulate to get bridged client mode......

Thanks for the tip. I don't like to downgrade to an unsupported RC2 version. I like to use the current stable versions.

I'm currently a bit annoyed from the propritary Broadcom stuff (this includes nas, wl and et drivers) and I will not support this in the future on IRC or in the forum.

Questions on generic OpenWrt stuff are still welcome.

(Last edited by olli_04 on 22 Nov 2005, 17:19)

Ok it seems that like a strike form the magician the blasted thing just started to work. Thanks everyone for your efforts.

RumaX: can you post your wifi_* wl0_* and wan_* settings ?

new:
-------------
Now it works ! (wrt54gs v1.1)

set lan_ifnames=vlan0   ( instead of "vlan0 vlan1")
set lan_ifname=br0
set wan_ifname=eth1
set wifi_ifname=""  ( instead of "eth1")
set wl0_channel=<<mychannel>>

and

wl join "mynet"

(Last edited by dev on 24 Nov 2005, 19:15)

The discussion might have continued from here.