OpenWrt Forum Archive

Topic: station mode (atheros & wgt634u)

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

so i'm connected to the router with the serial cable still.  Ugh, i've never had this much trouble getting the wireless to work.  I'm trying to bridge my netgear router to my linksys router (connected to my cable modem).  Anyway, last time I did this I followed the directions
here:  http://madwifi.org/wiki/UserDocs/FirstTimeHowTo

and here: http://openwrt.pbwiki.com/ClientModeHowto

But this time it isn't working.  I'm all out of ideas.  Whenever I issue this command:
root@OpenWrt:/#wlanconfig ath0 create wlandev wifi0 wlanmode sta

the console starts puking out:

root@OpenWrt:/# device ath0 entered promiscuous mode
br-lan: port 2(ath0) entering learning state
br-lan: topology change detected, propagating
br-lan: port 2(ath0) entering forwarding state

It will continue to do that whenever I try to access my other router (192.168.0.1).  I just prints those three lines over and over and over again.  I read on the madwifi forum that it might be a problem with the madwifi driver not being able to set a mac address, but I don't think that's the case.   Anyway, i persist and issue the following commands:

ifconfig ath0 up
iwconfig ath0 essid "my_essid"
ifconfig ath0 192.168.0.101 netmask 255.255.255.0
route add default gw 192.168.0.1

The route command will puke out those three lines forever until I hit ctrl-c.  Very frustrating.  I just loaded this same model with the same config i'm trying to do now and i must be missing something really stupid. 

Here's my /etc/config/network:
#### stuff from http://openwrt.pbwiki.com/ClientModeHowto
wan_ifnames=ath0
wan_device=ath0

#### VLAN configuration
config switch eth0
        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0 ath0"
        option proto    static
        option ipaddr   192.168.0.101
#### WAN configuration
#config interface       wan
#       option ifname   "eth0.1"
#       option proto    static
#       option ipaddr   192.168.0.101
#       option netmask  255.255.255.0

and here's my /etc/modules.d/50-madwifi:
wlan
wlan_scan_ap
wlan_scan_sta
ath_hal
ath_rate_sample
wlan_acl
wlan_ccmp
wlan_tkip
wlan_wep
wlan_xauth
ath_pci autocreate=none

and my /etc/init.d/madwifi:
#!/bin/sh /etc/rc.common
START=20
boot() {
        iwpriv ath0 mode 0
}

I noticed that the nwid is going crazy if I run iwconfig.  I can see that i'm connected in managed mode to my other access point, i can see the mac address it's using but I also see the nwid number really really high.  It increments by about 10 every second.
Rx invalid nwid:11592

Hopefully i've made a simple mistake.  any ideas anyone? sad

-j

if you want to bridge from a client connection with madwifi you must enable the 4 address header mode (wds). if I remember correctly you could do that with iwpriv ath0 wds 1, along with what you do above, before you bring the interface up. (and hopefully whatever access point you are using supports this)

this isn't the traditional way to use wds, of course (can you even call it wds?), normally you do it ap-ap

I didn't use wds the last time I did this, but i'll give your suggestion a try.  The router i'm connecting to is a linksys wrt54g, factory firmware.  I'm not sure it supports wds, but i'll guess i'll find out.  Using sta worked for me last time though. sad

awesome.  I scoured a different /etc/config/network off this forum and I got it to work.  I have noooooo idea why my notes didn't work for a remake of what I did last week ( http://devices.natetrue.com/musicap/ ).  I'm still learning a ton.  Anyone have any *good* tutorials for the kamikaze versions of openwrt?  All i can find are lemming-torials.  Rather than learning, I just copy paste, not understanding what or why i'm doing something.  Often, i find that i have to go hit wikipedia to learn about generic concepts before I can even attempt to try and understand what's going on with this router.  Anyone know of a good openwrt centric tutorial (as in teach and show how)?  The wiki for kamikaze is thin.  I'd contribute to it but I'm not in a position to be teaching tongue

Oh yeah, here's the /etc/config/network file I used...

#### VLAN configuration
vlan0hwname=et0
vlan0ports="0 1 2 3 4 5*"
vlan1hwname=et0
vlan1ports="5"

# I don't need the wan port, because the wgt is only client...
# so I have added the wan port to vlan0

#### LAN configuration
lan_proto="static"
lan_ifname="vlan0"
lan_ifnames="vlan0"
lan_ipaddr="192.168.1.2"
lan_dns="192.168.1.1"
lan_gateway="192.168.1.1"

#### WAN configuration
wan_proto=none
wan_ifname=""
# not using wan
#wan_device="vlan1"
#wan_dns=""
----------------


taken from: http://forum.openwrt.org/viewtopic.php?pid=26072

haha, yeah.  You might want to also include this in your network config file:

#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

some things just won't work w/o that. smile  lol

The discussion might have continued from here.