OpenWrt Forum Archive

Topic: Setting up OpenWRT in client mode

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

I have a WRT54GS running White Russian and am trying to get it into client mode, so that it can latch onto the wifi connection served by my other router 2 floors up and provide an wireless ethernet bridge between the two floors.

I followed the guide in the wiki, and after much hardship and cursing managed to get the router to see my wifi network. I can ping yahoo, etc.

Thing is, it isn't sharing the connection with the client PCs connected through the ethernet ports. It also isn't allowing their dhcp requests to reach the "main" router.

Any ideas?

Set wan_ifname=eth1 (wireless) and turn off local dhcp if desired by disabling dnsmasq script in init.d.

- DL

dl wrote:

Set wan_ifname=eth1 (wireless) and turn off local dhcp if desired by disabling dnsmasq script in init.d.

- DL

Well at least neither the router nor the clients can access the wireless network now smile

When I run ifup wan; /sbin/wifi it no longer can get a signal. I will have another play with it tomorrow and see what I can turn up.

Thanks for the reply!

I've got a number of clients functioning in a similar manner. Maybe it's the "wifi" you're missing. Here's my nvram settings:

root@client1:/# nvram show|sort
size: 1542 bytes (31226 left)
aa0=3
ag0=255
boardflags2=0
boardflags=0x0118
boardnum=42
boardrev=0x10
boardtype=0x0708
boot_ver=v3.4
boot_wait=on
bootnv_ver=2
ccode=0
cctl=0
clkfreq=200
dl_ram_addr=a0001000
eou_device_id=QRCUJGDU
eou_private_key=xxx
eou_public_key=xxx
et0macaddr=00:13:10:9D:7B:8C
et0mdcport=0
et0phyaddr=30
gpio5=robo_reset
il0macaddr=00:13:10:9d:7b:8e
lan_dns=xx.xx.xx.xx
lan_ifname=vlan0
lan_ifnames=vlan0 eth1 eth2
lan_ipaddr=192.168.1.1
lan_netmask=255.255.255.0
lan_proto=static
os_flash_addr=bfc40000
os_ram_addr=80001000
pa0b0=0x15eb
pa0b1=0xfa82
pa0b2=0xfe66
pa0itssit=62
pa0maxpwr=0x4e
pmon_ver=CFE 3.61.13.0
scratch=a0180000
sdram_config=0x0062
sdram_init=0x000b
sdram_ncdl=0xfd0008
sdram_refresh=0x0000
sromrev=2
vlan0hwname=et0
vlan0ports=1 2 3 4 5*
vlan1hwname=et0
vlan1ports=0 5
wan_hostname=client1
wan_ifname=eth1
wan_proto=dhcp
watchdog=5000
wifi_ifname=eth1
wifi_proto=dhcp
wl0_gmode=0
wl0_ifname=eth1
wl0_infra=1
wl0_mode=sta
wl0_radio=1
wl0_ssid=opennewport
wl0_txpwr=100
wl0gpio2=0
wl0gpio3=0
wl0id=0x4320

Added notes:
- I'm in routed mode (broke bridge) in order to provide local firewall
- lan_ifnames is superflous, but if I unset it, it keeps coming back but causes no harm
- I'm providing local dhcp for wired clients.
- wifi interface is set to pickup dhcp address. In my case dnsmasq is disabled on the AP so client radio is picking up dhcp from central dhcp server. If you're both providing dhcp on the lan and picking up dhcp on the wifi you might want to ensure the two are on different subnets.
- no other startup scripts or modifications are in place (actually only to set txpwr).
- Client joins specified ssid on it's own at boot (presumably when bringing up wifi interface) without need of wl join in startup

- DL

(Last edited by dl on 2 Oct 2005, 20:32)

You have tried wl0_mode=sta instead of wet mode as described in the howto?

UPDATE: The client mode howto has been fixed. If you want to use bridging, set wan_proto=none and wl0_mode=sta

(Last edited by nbd on 2 Oct 2005, 15:44)

Ok. I changed the ClientModeHowto again.

We recommend now, that you use:

wl0_mode=sta

I verified this howto with a test setup here again. For the test I used:
- WRT54GS v1.0 (AP 1, in ap mode, this is the OpenWrt standard configuration)
- WL-500g Deluxe (AP 2, in client mode)
- both routers have a standard install of 'White Russian RC3'

Also WEP and WPA between AP 1 and AP 2 worked perfect.

When the router is in:
Bridged client mode (wired clients):
When I connect my Debian box (latest stable) to the LAN ports on the AP 2 I get IP addresses (from the same network) via another DHCP server.

Bridged client mode (wireless clients):
You _can't_ connect any wireless clients, because the AP 2 is not in access point mode (wl0_mode=ap) anymore.

Routed client mode (wired clients):
When I connect my Debian box (latest stable) to the LAN ports on the AP 2 I get IP addresses via another DHCP server.

Routed client mode (wireless clients):
You _can't_ connect any wireless clients, because the AP 2 is not in access point mode (wl0_mode=ap) anymore. You need to run a DHCP server on AP two with a different network (for example 192.168.2.0).


When you would like to extend networks and also connect wireless clients you have to use WDS.


I hope this makes the thing a bit more clear.

(Last edited by olli_04 on 17 Oct 2005, 12:15)

Awesome. After I finish my engineering homework I'll give the new and improved guide a try wink

Thanks guys!

I've added some clarification notes to my example above.

- DL

Hello,

I hafe startet to build my wlan-net with a client config. (White Russian RC3)

all looks good. But when I download a file over http (50 mb) the wlan connection die.

WRT-54g #1
client mode - routed
lan-ip = 192.168.99.253
lan-net = 192.168.99.0/24
wifi-ip = 192.168.2.253
wifi-net = 192.168.2.0/24
wifi-mode=wpa-psk

WRT-54g #2
ap-mode
lan/wifi-ip = 192.168.2.254
lan/wifi-net = 192.168.2.0/24
wifi-mode=wpa-psk

When the connction is die, I go to WRT #1 and run /sbin/wifi. Than the connection is rebuild.

How can I get some debug message??

Thanks and greatings from germany

Thomas

Looks like you have this stability problem too.

thanks... i have it tested...

wget http://openwrt.inf.fh-brs.de/~nbd/linksys-fixup.sh
sh linksys-fixup.sh
nvram commit
reboot

but it´s don´t help.. the connection to the wrt-ap dies..?!

How can i see some debugging output.. dmesg and logread get no informations to the death. :-(

[EDIT]

Hardware-Version from Both WRT´s is 2.2

[/EDIT]

[EDIT2]

ok.. it´s looks good!! .. the problem was on the ap side.. i use´t the script obove on him and now its looks fine... (and littel bit faster *g*)

thanks ;-)

[/EDIT2]

(Last edited by aLiEnTxC on 16 Oct 2005, 22:32)

olli_04 wrote:

...
I verified this howto with a test setup here again. For the test I used:
- WRT54GS v1.0 (AP 1, in ap mode, this is the OpenWrt standard configuration)
- WL-500g Deluxe (AP 2, in client mode)
- both routers have a standard install of 'White Russian RC3'

When the router is in:
Bridged client mode (wired clients):
When I connect my Debian box (latest stable) to the LAN ports on the AP 2 I get IP addresses (from the same network) via another DHCP server.
...

Well, yes, this is how it is supposed to work, but what are the settings?  The Client Mode How-To is confusing to a newbie trying to get client mode to work since it is not clear that sections "1.1.1. Bridged client mode" and "1.1.2. Routed client mode" are independent.  I did both, and was able to get what I think is routed mode (for which I am thankful!), but it is not clear from the How-To or this thread how one goes back to bridge mode.  For bridge mode the How-To says "When your configuration was set to routed client mode before, you need to add the wireless interface to the bridge again and remove it from the wan interface," but how is this done?

I can connect to my Motorola WR850G from my Debian boxes with static ip addresses (but not with dhcp).  The Motorola, running White Russian RC3, connects to a Netgear wireless router with stock firmware, and gets its ip address from it.  The Netgear web admin page sees the Motorola as "HOST1" or "UNKNOWN".  I would like to see my Debian boxes there and I presume that is what bridge mode would do (please educate me if I am mistaken!).  My settings are:

wl0_mode
sta

lan_ifname
br0

lan_ifnames
vlan0

wan_ifname
eth1

lan_ipaddr
192.168.2.1

lan_proto
static

wan_proto
dhcp

If I change wan_proto to "none" as suggested above or wan_ifname to "vlan1" as suggested in the How-To then I lose connectivity with the Netgear router.  It seems that others in this thread are having similar problems.

Any help would be appreciated!

Thanks,
Glenn

If you're attempting to bridge:

lan_ifname=br0
lan_ifnames="vlan0 eth1"

see? lan (vlan0) is bridged with wireless (eth1) which is then connected to the remote AP.

If you just want to connect without bridging (often works better)

lan_ifname=vlan0
wan_ifname=eth1

You could leave br0 but it serves no real purpose; lan is just vlan0 (wired ports on the back) and the wan (internet) connection is eth1. The S45firewall script will automatically setup ip masquerade (NAT) over the wan connection.

Hi mbm,

Thanks for the response.  It inspired me to study the docs at http://openwrt.org/OpenWrtDocs/Configuration, in particular the picture and nvram info in the "Network configuration" section.  I am now armed with a little knowledge.

mbm wrote:

If you're attempting to bridge:

lan_ifname=br0
lan_ifnames="vlan0 eth1"

see? lan (vlan0) is bridged with wireless (eth1) which is then connected to the remote AP.

OK, this makes sense, together with the words below: "lan is just vlan0 (wired ports on the back)," etc.  However, I'm not sure exactly what is supposed to happen, though.

Recall that my goal is to connect my Motorola/OpenWrt in client mode as a bridge to a Netgear/Stock wireless router, and have the Netgear be the DHCP server.  Then (presumably) the Debian boxes I plug into the Motorola and the WinXP box connecting wirelessly to the Netgear would be on the same subnet, and I would see them individually on the Netgear web admin page.  Ideally, their ip addresses could be either fixed or assigned (DHCP) by the Netgear.  This would make it easier for me to find the Debian boxes from the WinXP box, and to use the Netgear features for stuff like parental controls on individual boxes (though truth be told, I don't use them now).  In this hypothetical setup the Motorola would be transparent to the Netgear.

Is this even possible?  Assuming the OpenWrt wan interface (eth1) is bridging to the Netgear whose LAN ip is 192.168.10.1, what value should wan_proto be?  And what value should fixed Debian addresses be?  How about the ff:

lan_ifname=br0
lan_ifnames="vlan0 eth1"
lan_ipaddr=192.168.10.2      <-- I need this to ssh root@192.168.10.2?
wan_proto=static

Debian1 ipaddr: 192.168.10.3
Debian1 gateway: 192.168.10.1
Debian2 ipaddr: dhcp

I'll be first to call this a naive attempt, but any comments would be appreciated.

mbm wrote:

If you just want to connect without bridging (often works better)

lan_ifname=vlan0
wan_ifname=eth1

You could leave br0 but it serves no real purpose; lan is just vlan0 (wired ports on the back) and the wan (internet) connection is eth1. The S45firewall script will automatically setup ip masquerade (NAT) over the wan connection.

This is what is working, now.  Why does it work better?  It seems that it would eliminate the wireless link between the Debian boxes, OK, but is there some other issue?

Thanks,
Glenn

I foloved "clientmodeHOWTO" , but it didn't give any result on my Asus 500g, please anyone... badlyneed openwrt width client mode, I hate to go back to oleg's ...

second quiestion, does it needs bridge, I don wan't bridge at all... simple routing small firewall, thats is what I need, but I can't get eth2 on asus as client

this is what I get constantly

eth2      IEEE 802.11-DS  ESSID:""
          Mode:Repeater  Frequency:2.412 GHz  Tx-Power:31 dBm
          RTS thr=2347 B   Fragment thr=2346 B
          Encryption key:1234-5678-90
          Link Quality:0  Signal level:0  Noise level:159
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

it sets enc, but ssid and mode NOT

(Last edited by hiphin on 10 Nov 2005, 23:43)

Does anybody out there know how to do WPA-RADIUS or WPA-ENTERPRISE client with a WAP54G.

Computers <---> WAP54G <----wireless link-----> WAP54G <-----> RADIUS Server (Microsoft IAS)

Different firmware?

Thanks

rcastle

I am having the same problem as described above.

I have my WL-HDD configured as bridged client.

wl0_mode=sta (have tried wet also)
wan0_proto=none and wan_proto=none (both were there)
wan0_ifname=eth2 (wireless)   wan_ifname reverts to none after reboot
also tried with wan[0]_ifname=none

While logged into the WL-HDD I have contact with the wireless and wired sides of the network. Regardless of my attempts, I have been unable to configure the box to allow communication over the bridged ports.

Is there something special about the WL-HDD, or possible Asus boxes that I haven't seen in the howto? I would love to get this to work completely. Any help would be appreciated.

EDIT:
Amazingly enough, setting wl0_mode=wet solved the problem. I truely thought I had already tried that, but my combination might have been incorrect. wan_ifname=none is also necessary for bridged mode.

(Last edited by joebush on 18 Feb 2006, 21:47)

I just read through this post again and thought I could clarify things for those that are having trouble.


There are two wireless client modes, sta (station) and wet (wireless ethernet). They will both have OpenWrt connect to an AP. Neither of these modes will allow the unit to have wireless clients connect to it. It is no longer an access point.

wl0_mode=sta

In this mode, the wireless interface is going to be the WAN port. This implies that the ethernet ports will all be on the lan. The wireless interface is nothing more than a client connection that gives us access to an external network (internet usually). The bridge must be separated since the traffic on our wireless WAN port is not to be linked directly with the local network.

wl0_mode=wet
In this mode, the wireless interface will still connect as a client to another AP. The difference is that the bridge is still intact, and the clients (connected via an ethernet port) will have direct access to the network behind the AP.

I hope this description will help people better understand the differences between these modes so they can get it set up properly.

(Last edited by joebush on 17 Apr 2006, 12:41)

I'm planning to set my WRT54Gv2 to bridged client mode as described in http://wiki.openwrt.org/ClientModeHowto.

Once I've entered bridged client mode, committed the changes, and rebooted, how do I get back into my WRT54G? Once this mode is entered, does "lan_ipaddr=x.x.x.x" sit on the bridged network as a sort of management IP?

If not, is there a way to give the WRT54G as bridged client an IP address for management? What about making use of the unused WAN port as a management port?

Any help is appreciated. Thanks in advance.

effjay wrote:

If not, is there a way to give the WRT54G as bridged client an IP address for management? What about making use of the unused WAN port as a management port?

I setup my old "wan" port like this

old_ifname=eth1
old_ipaddr=192.168.33.99
old_netmask=255.255.255.0
old_proto=static

So, how do you set up client mode for open AP roaming?  I tried wpa-supplicant but it doesn't seem to work with unencrypted networks.  Much less "any" networks.  Any one have a sh script

#!/bin/sh
NETWORKS=`iwlist eth2 scan | grep ESSID | cut -f2 -d:`
for SSID in $NETWORKS; do
  /bin/echo $SSID
  #something here???
done

I have a wrt54gl in routed client with the whitte russian rc5 and have the same problem

the /sbin/wifi seems to fall down after a while so i put:

* * * * * /sbin/wifi

into crontab...

any other solution please??

mbm wrote:

You could leave br0 but it serves no real purpose; lan is just vlan0 (wired ports on the back) and the wan (internet) connection is eth1. The S45firewall script will automatically setup ip masquerade (NAT) over the wan connection.

my router is not doing so... i can't talk to the computers on the other side of the link, how can i fix it?  I have a Linksys WRT54GL v 1.1

Fixed, i had a problem with the ip configuration of wan interface, now it works perfect with static ip settings.

(Last edited by 0ptimus on 4 Mar 2007, 19:35)

The discussion might have continued from here.