Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
madwifi-ng ap/sta mode on one card
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tekknokrat
Apprentice
Apprentice


Joined: 17 Apr 2005
Posts: 278
Location: Magdeburg

PostPosted: Thu Sep 28, 2006 5:26 pm    Post subject: madwifi-ng ap/sta mode on one card Reply with quote

I try to use my card as an accespoint but also as an station connected to another accesspoint

manually (no need to set mode or channel settings works out of the box for me):
Code:

wlanconfig ath0 create wlandev wifi0 wlanmode ap
wlanconfig ath1 create wlandev wifi0 wlanmode sta nosbeacon
iwconfig ath1 essid "WLAN"
iwconfig ath0 essid "thinktwice"
ifconfig ath0 192.168.10.1 netmask 0xffffff00
ifconfig ath1 up --> seems to be neccessary for associating
dhpcd -d ath1


I have configured nat/forwarding via iptables and all works well when configured manually. but trying to integrate this config in wireless and net script permanently fails.

Heres my net script:
Code:

config_ath0=( "192.168.10.1/24" )
config_eth0=( "192.168.11.1 netmask 255.255.255.0" )
config_ath1=( "dhcp" )

preup() {
        if [[ ${IFACE} == "ath0" ]] ; then
                sleep 2
                wlanconfig ath0 create wlandev wifi0 wlanmode ap -bssid
        fi

        if [[ ${IFACE} == "ath1" ]] ; then
                sleep 2
                wlanconfig ath1 create wlandev wifi0 wlanmode sta nosbeacon
        fi

}
postdown() {
        if [[ ${IFACE} == "ath0" ]] ; then
                wlanconfig ath0 destroy
        fi
        if [[ ${IFACE} == "ath1" ]] ; then
                wlanconfig ath1 destroy
        fi
}


wireless:
Code:

sleep_scan_ath1="5"
sleep_associate_ath1="30"
unique_ap="no"
essid_ath0="thinktwice"
channel_thinktwice="11"

prefferred_aps_ath1=( "nicht_für_jeden" "WLAN" )
associate_order_ath1="preferredonly"
key_nicht_f_r_jeden="`cat /root/wep128`"


When starting via /etc/init.d/net.ath0 start && /etc/init.d/net.ath1 start
ap mode on ath0 initialises fine but after that Associating of ath1 fails. I recognised that after the init script iwconfig didn't has assigned an target essid so my result is something
like

/etc/init.d/net.ath1 start
Code:

 ^[[32;01m*^[[0m       iwconfig provides wireless
 ^[[32;01m*^[[0m       ifconfig provides interface
 ^[[32;01m*^[[0m       dhcpcd provides dhcp
 ^[[32;01m*^[[0m   Running preup function
ath1
 ^[[32;01m*^[[0m   Configuring wireless network for ath1
 ^[[32;01m*^[[0m   Scanning for access points
 ^[[32;01m*^[[0m     Found "WLAN" at 00:03:C9:A3:4A:D7
 ^[[32;01m*^[[0m     Found 00:03:C9:B9:67:F1 (WEP required)
 ^[[32;01m*^[[0m     Found 00:02:2D:3C:E7:1A (WEP required)
 ^[[32;01m*^[[0m     Found "WLAN" at 00:30:F1:65:A4:9F
 ^[[32;01m*^[[0m     Found "FRITZ!Box Fon WLAN 7141" at 00:15:0C:D2:22:4A (WEP required)
 ^[[31;01m*^[[0m   Couldn't associate with any access points on ath1 --> this message appears very fast
 ^[[31;01m*^[[0m   Failed to configure wireless for ath1


and iwconfig ath1 shows something like:
Code:

ath1      IEEE 802.11g  ESSID:""
          Mode:Managed  Channel:0  Access Point: Not-Associated
          Bit Rate:0 kb/s   Tx-Power:17 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/94  Signal level=-95 dBm  Noise level=-95 dBm
          Rx invalid nwid:286  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

seems like it is never initialised with an essid.

I also tried with depend_ath0 { net.ath1 } so that ath1 was initialised first but for getting ap/sta work it is neccessary that ap is created first.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Sep 28, 2006 11:20 pm    Post subject: Reply with quote

Does it work if you set essid_ath1="WLAN" ?
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
tekknokrat
Apprentice
Apprentice


Joined: 17 Apr 2005
Posts: 278
Location: Magdeburg

PostPosted: Sat Sep 30, 2006 12:14 pm    Post subject: Reply with quote

Quote:

Does it work if you set essid_ath1="WLAN" ?


No it is the same problem. Tried everything with setting essid directly and preffered_aps. I'm wondering that scanning works fine but after that the message "Couldn't associate with any access points on ath1" comes really fast although I have sleep_associate_ath1="30" set.[/code]
Back to top
View user's profile Send private message
tekknokrat
Apprentice
Apprentice


Joined: 17 Apr 2005
Posts: 278
Location: Magdeburg

PostPosted: Sun Oct 08, 2006 5:34 pm    Post subject: Reply with quote

So I found a workaround for this.
First there is a typo at prefferrered_aps ( must be preferred_aps) which was responsible that associating failed.

The other problem ist that if ap is brought up before the sta the quality of the sta link significantly decreases.

A little workaround is that here:

Code:

config_ath1=( "dhcp" )

depend_ath0( ) {
        need net.ath1
        }

preup() {
        if [[ ${IFACE} == "ath0" ]] ; then
                echo dummy
        fi

        if [[ ${IFACE} == "ath1" ]] ; then
                sleep 2
                wlanconfig ath0 create wlandev wifi0 wlanmode ap -bssid
                wlanconfig ath1 create wlandev wifi0 wlanmode sta nosbeacon
        fi

}
postdown() {
        if [[ ${IFACE} == "ath0" ]] ; then
                wlanconfig ath0 destroy
        fi


I use ath1 as an dependency to ath0 and have the creation stuff in the ath1 preup.
this works because then station is first associated and after that accesspoint.

Disadvantage is that ath0 is not created if associating of ath1 fails.
What I am missing is a fallback_FUNCTION part like preup or postdown in baselayout for this situations.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum