Log in

Bekijk de volledige versie : ASUS WL-500gx in client mode



Darkstar
18-06-2005, 23:30
Hi,
I would like to connect to my ISP via WLAN with DHCP and NAT enabled. I can do it manually by issuing following commands:

brctl delif br0 eth1 (maybe its not necessary, but I read it somewhere)
wl ap 0 (no idea what I am doing)
wl scan (not necesarry)
wl scanresults (because I know the SSID, but I just want to be sure...)
wl join SSID key ispkey
udhcpc -i eth1 -s /bin/true
ifconfig eth1 A.B.C.D netmask (not from DHCP but I know myself)
route add default gw A.B.C.D (also not from DHCP, but I know myself)
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

As you can read my message, this works pretty well, but how do I have to set up my router to do this every bootup???? And why do I only get an IP-Address from udhcpc and no other stuff (gateway, dns etc...) and why do I have to set these values by myself?

Can anybody help me with this or do I have to put a Debian on a USB stick?

Regards
Helge.

Darkstar
19-06-2005, 12:30
Ok, it works.

I edited the /usr/local/sbin/post-boot script and now it woks like charm!

My post-boot looks as follows:

#!/bin/sh
brctl delif br0 eth1
wl ap 0
wl join SSID key wepkey
ifconfig eth1 `udhcpc -i eth1 -s /bin/true | awk '{if($0~/obtained/) print $3}'` netmask 255.255.0.0
route add default gw A.B.C.D
iptables -t nat -A POSTROUTING -j MASQUERADE
mv /tmp/local/resolv.conf /tmp/resolv.conf
echo 1 > /proc/sys/net/ipv4/ip_forward


Helge.

Oleg
19-06-2005, 12:32
Why don't you use built-in support for the client mode?

Darkstar
19-06-2005, 18:52
Good question...

Where is this "build in" client mode? I have Firmware 1.9.2.7-6 and I could not find any "Client mode" in the web interface, but I would be glad if you (or somebody else) could tell me how to set it up. In the meantime it works quite well this way.

Darkstar.

Oleg
19-06-2005, 19:02
Well, it's there for about a year. :) And most likely well documented in the ASUS manual. Wireless | Advanced | Extended Mode, then select station or ethernet bridge.

Darkstar
19-06-2005, 19:49
Thats what I selected, but without the "wl join SSID key wepkey" my router does not connect to the specific AP of my ISP, and without "iptables -t nat -A POSTROUTING..." the NAT is not working. At least I know what I am doing, when I put in the commands manually...

I already switched to "Router" operation mode, so that the post-boot script reduces to a "wl join..." and the post-firewall script is only "iptables -t nat...".

Thank you for your great work, without I could not put my commands somewhere.

Darkstar.

Oleg
19-06-2005, 20:42
Switch to home gateway mode, it would do iptables stuff.
as for wep - try using both Open System and Open System or Shared key and use HEX wep key.

Darkstar
23-06-2005, 12:46
I switched to Home Gateway mode, but it doesn't connect to the AP of my ISP. In the post-boot script I first have to kill the udhcpc process, join the AP manually and start the udhcpc again. Starting the process with "-s /tmp/udhcpc" which is a link to /sbin/rc also sets the interface and the route.

Darkstar.

gwl
23-06-2005, 17:22
I switched to Home Gateway mode, but it doesn't connect to the AP of my ISP. In the post-boot script I first have to kill the udhcpc process, join the AP manually and start the udhcpc again. Starting the process with "-s /tmp/udhcpc" which is a link to /sbin/rc also sets the interface and the route.

Darkstar.

I also use the router in client mode, and I have to run a script every time I want to connect. (I never managed to get it working from the web interface)


:rolleyes:

Antiloop
24-06-2005, 00:19
I also use the router in client mode, and I have to run a script every time I want to connect. (I never managed to get it working from the web interface)


:rolleyes:
currently I'm using a WL-HDD with firmware 1.9.2.7-5 and it does automatically connect to the other AP

used it before on a WL500g

gwl
24-06-2005, 12:05
currently I'm using a WL-HDD with firmware 1.9.2.7-5 and it does automatically connect to the other AP

used it before on a WL500g

I tested it this way:
Host AP: Dlink DI-624 (dhcp on; no WDS)
Client AP: Asus WL500G

Configured the Asus to connect to the dlink (no wds support).
After logging into the dlink config page, i can see the MAC of the asus listed in the clients list.
So the Asus DOES connect.
If I connect an ethernet cable to the asus from my laptop, I am only able to reach 192.168.1.1 (the asus router).
In order to get it going, I had to telnet into the router and do something like:


echo "nameserver xxx.xxx.xxx.xxx" > /tmp/resolv.conf
route del default gw
route add default gw xxx.xxx.xxx.xxx eth2
udhcpc -i eth2 -s /bin/true
iptables -t nat -P POSTROUTING DROP
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE;
killall dnsmasq;
dnsmasq;

maybe some of these lines aren't needed... but... just in case ... :)

Oleg
24-06-2005, 12:12
echo "nameserver xxx.xxx.xxx.xxx" > /tmp/resolv.conf
route del default gw
route add default gw xxx.xxx.xxx.xxx eth2
udhcpc -i eth2 -s /bin/true
iptables -t nat -P POSTROUTING DROP
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE;
killall dnsmasq;
dnsmasq;

maybe some of these lines aren't needed... but... just in case ... :)
Well, everything should be done by firmware itself. Just check which values are missing without your script and let me know.



cat /tmp/resolv.conf
route -n
ifconfig eth2
iptables -t nat -L POSTROUTING

Darkstar
24-06-2005, 12:29
I think it is a problem with the AP on the other side.

resolv.conf: it is not set because udhcpc got no IP
route: see above
ifconfig: see above
iptables: everything is ok.

udhcpc is running and even "wl assoc" shows the AP, but somehow it dosn't work. I made it work by killing the udhcpc process on eth1, joining the AP manually with "wl join "SSID" key <not-a-hex-key>" and starting the udhcpc process again. It then gets an IP address and everything works fine. I tried to change the hex key in the nvram entry "wl0_join" but it somehow does not store the key but it reverts to hex format. I didn't try the hex format when I manually joined the AP but I will try this next time. So far it works quite well with this workaround.

Darkstar

Oleg
24-06-2005, 12:34
Keys SHOULD BE SPECIFIED IN HEX FORMAT for WEP, otherwise you will get compatibility problems.

gwl
07-07-2005, 21:42
I tested the client mode again. (twice)
It worked with one AP (dlink di624),
but didn't (fully) work with another one (3Com? Cisco)?

Here's what I configured:
wireless - interface
ssid: #REMOTE_SSID#

wireless - bridge
ap mode: wds only
channel: #REMOTE_CHANNEL#
connect to AP in remote list: yes
allow anonymous: no

remote bridge list: MAC: #REMOTE_MAC#

wireless - advanced
Extended Mode: AP or WDS

then, with the first AP (dllink) it worked.
with the seccond AP, I got connected, but didn't get an IP, (even though, this AP has DHCP), so I set it manually this way:

ifconfig eth2 ##MANUAL_IP## netmask 255.255.0.0 up
echo "nameserver ##DNS_IP##" > /tmp/resolv.conf
route add default gw ##GATEWAY_IP## eth2
iptables -t nat -P POSTROUTING DROP
iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE;
killall dnsmasq;
dnsmasq;

Oleg
10-07-2005, 11:09
WDS is not a client mode! Don't mess the things!
And WDS is not fully supported by all vendors, so some AP combinations will not work this way.

So, this is normal. Client mode is activated by selecting either Station or Ethernet Bridge in the Extended Mode.

gwl
10-07-2005, 18:21
WDS is not a client mode! Don't mess the things!
And WDS is not fully supported by all vendors, so some AP combinations will not work this way.

So, this is normal. Client mode is activated by selecting either Station or Ethernet Bridge in the Extended Mode.

Who said anything about WDS?!?!
the reason for the confusion it that there are no clear instructions on how to do it...
I've only manged to do it after a lot of trial and error.
(and it still doesn't work as it should.. because I have to run a manual script)

It's confusing because the settings needed are on different configuration pages, and the descriptions are misleading...
Why call it: "Station" ?!?! or "Ethernet Bridge in the Extended Mode"....
It may be clear, if you already know it.. but if you don't, then it's meaningless.
wouldn't it be much simpler to have an extra configuration web page labeled "Client Mode" ?!? (and all the settings needed in there)

:cool:

Oleg
10-07-2005, 19:48
Who said anything about WDS?!?!

You. :)


wireless - bridge
ap mode: wds only
channel: #REMOTE_CHANNEL#
connect to AP in remote list: yes
allow anonymous: no

remote bridge list: MAC: #REMOTE_MAC#

wireless - advanced
Extended Mode: AP or WDS

note wds only - am I dreaming?



the reason for the confusion it that there are no clear instructions on how to do it...

I beleive ASUS user manual covers this.



I've only manged to do it after a lot of trial and error.
(and it still doesn't work as it should.. because I have to run a manual script)

Why don't you ask on how to config this? :)



It's confusing because the settings needed are on different configuration pages, and the descriptions are misleading...
Why call it: "Station" ?!?! or "Ethernet Bridge in the Extended Mode"....
It may be clear, if you already know it.. but if you don't, then it's meaningless.
wouldn't it be much simpler to have an extra configuration web page labeled "Client Mode" ?!? (and all the settings needed in there)

:cool:
You've to contact asus tech support then, as since 1.8.x.x this functionality is "provided" natively.

gwl
10-07-2005, 23:40
ok... Oleg.. you win...

What should be selected in "Wireless / Bridge / AP Mode" in order to use client mode?

Oleg
11-07-2005, 09:22
Wireless | Bridge > AP Mode - AP Only
Wireless | Advanced > Extended Mode - Ethernet Bridge
System Setup | Operation Mode - Home Gateway