Jump to content

Client mode and wireless config


ptrac3

Recommended Posts

Hello evreybody, i'm esperiencing some weird problems with client mode on my pineapple... The Wifi network i want to connect to it's open and needs no password or autentication. Nonetheless i can't get this to work with my pineapple. To enable client mode connection:

1) i've enabled wlan1 via web interface

2) on network tile i choose my open wifi network, clicked connect but nothing happens (the blue led disappears for one second, and then suddenly reappears)

3) sometimes i get "connection initiated. see below for connection details" and in connection information i get "connected" but after one second or few more "not connected"... (the interesting part is that with the connection fail, Wlan1 is disabled again in the network tile)

So i've decided to re-flash (via web interface) and the second time it worked..but now , after a simple reboot nothing happens again..Do you guys have any hints to solve this?

I've noted that executing wifi detect > /etc/config/wireless solve temporary the problem, if i log out from the web interface and shutdown the pineapple (simply detaching the dc cable) i'll have the same problem, and have to overwrite the config again..Why this happens? Thanks in advance!!

Link to comment
Share on other sites

What firmware version are you on?

Best Regards,

Sebkinne

I'm sorry i didn't mention it, i'm on the latest firmware stablesaurus 1.0.4

For diagnosis purposes this is the /etc/config/wireless after the fail in client mode

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11ng'
        option macaddr '00:13:37:a5:11:70'
        option htmode 'HT20'
        list ht_capab 'SHORT-GI-20'
        list ht_capab 'SHORT-GI-40'
        list ht_capab 'RX-STBC1'
        list ht_capab 'DSSS_CCK-40'

config wifi-iface
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'Pineapple5_1170'
        option encryption 'none'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11g'
        option macaddr 'ea:5b:35:df:82:e0'
        option channel '1'

config wifi-iface
        option device 'radio1'
        option network 'wan'
        option ssid 'EnterpriseG'
        option mode 'sta'

config wifi-device 'radio2'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option macaddr '96:f1:76:62:e9:d3'

config wifi-iface
        option device 'radio2'
        option network 'lan'
        option mode 'ap'
        option ssid 'Pineapple5_E9D3'
        option encryption 'none'

config wifi-device 'radio3'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option macaddr 'ba:a1:14:fa:01:6e'

config wifi-iface
        option device 'radio3'
        option network 'lan'
        option mode 'ap'
        option ssid 'Pineapple5_016E'
        option encryption 'none'

And this is the /etc/config/wireless aftter the wifi detect > /etc/config/wireless and with my wifi network succefully connected to (EnterpriseG in my case)

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11ng'
        option macaddr '00:13:37:a5:11:70'
        option htmode 'HT20'
        list ht_capab 'SHORT-GI-20'
        list ht_capab 'SHORT-GI-40'
        list ht_capab 'RX-STBC1'
        list ht_capab 'DSSS_CCK-40'

config wifi-iface
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'Pineapple5_1170'
        option encryption 'none'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11g'
        option macaddr 'ba:a1:14:fa:01:6e'
        option channel '1'

config wifi-iface
        option device 'radio1'
        option mode 'sta'
        option network 'wan'
        option ssid 'EnterpriseG'
Edited by ptrac3
Link to comment
Share on other sites

Do you use something like macchanger?

Seems like something is changing the macs on boot. If not, do you have any other devices plugged in?

Best regards,

Sebkinne

Thanks for the feedback.. I've never used macchanger with pineapple mark v, i've re-tested client mode with only one device connect to the mark v (actually the computer accessing the web interface) and the /etc/config/wireless before and after wifi detect > /etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11ng'
	option macaddr '00:13:37:a5:11:70'
	option htmode 'HT20'
	list ht_capab 'SHORT-GI-20'
	list ht_capab 'SHORT-GI-40'
	list ht_capab 'RX-STBC1'
	list ht_capab 'DSSS_CCK-40'

config wifi-iface
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'Pineapple5_1170'
	option encryption 'none'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11g'
	option macaddr 'ba:a1:14:fa:01:6e'
	option channel '6'

config wifi-iface
	option device 'radio1'
	option network 'wan'
	option ssid 'EnterpriseG'
	option mode 'sta'

config wifi-device 'radio2'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option macaddr '9a:d5:40:f9:82:3f'

config wifi-iface
	option device 'radio2'
	option network 'lan'
	option mode 'ap'
	option ssid 'Pineapple5_823F'
	option encryption 'none'

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11ng'
	option macaddr '00:13:37:a5:11:70'
	option htmode 'HT20'
	list ht_capab 'SHORT-GI-20'
	list ht_capab 'SHORT-GI-40'
	list ht_capab 'RX-STBC1'
	list ht_capab 'DSSS_CCK-40'

config wifi-iface
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'Pineapple5_1170'
	option encryption 'none'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11g'
	option macaddr '9a:d5:40:f9:82:3f'
	option channel '6'

config wifi-iface
	option device 'radio1'
	option mode 'sta'
	option network 'wan'
	option ssid 'EnterpriseG'

I see different MACs infact, really strange.. I can re-flash the firmware but i don't think this will solve the issue.. (moreover i have no infusions installed at all that can cause conflicts)

Edited by ptrac3
Link to comment
Share on other sites

So there is nothing connected over usb?

Either way, try a factory reset using the Webinterface / dip switches. If that doesn't work, attempt a reflash.

Best regards,

Sebkinne

Yes i have never connected anything on the usb of the Mark V.. :( I've tried with factory reset with dip switches and then re-flashed firmware via web interface: the first time client mode works but after i clic "disconnect" and then unplug dc cable client mode fails (i get the connection initiated and below "connected" but after a sec "not connected..refreshin in 10s.")..Am i alone with experiencing this problem? if so it's really strange, i don't know if this initial issue https://forums.hak5.org/index.php?/topic/31363-red-and-green-light-first-boot/ is somehow related to this problem.. Thank you

Edited by ptrac3
Link to comment
Share on other sites

Thanks yabasoya i'll give it a shot, thanks. :) My ap channel is dynamic so it changes during time...(it's not my router fault because if i do a reset on mark v i always get a succefull connection in client mode) However the problem for me it's not editing the wireless config, the interesting fact is that client mode works but just temporary, if i can find a way to make the firmware write a /etc/config/wireless that is like the first i think the problem will be solved but something creates confusion and i have to overwrite the config or do a reset default or re-flash firmware every time i want to connect in client mode..

Link to comment
Share on other sites

Thanks yabasoya i'll give it a shot, thanks. :) My ap channel is dynamic so it changes during time...(it's not my router fault because if i do a reset on mark v i always get a succefull connection in client mode)

I would change 'EnterpriseG' to a static channel. I was merely trying to show you that if your 'EnterpriseG' was on a channel other than 6, it wouldn't connect. So you say that after a factory reset, you can connect to 'EnterpriseG' with wlan1?

However the problem for me it's not editing the wireless config, the interesting fact is that client mode works but just temporary,

So then wlan1 connects to 'EnterpriseG' for a period of time then has trouble connecting?

if i can find a way to make the firmware write a /etc/config/wireless that is like the first i think the problem will be solved but something creates confusion and i have to overwrite the config or do a reset default or re-flash firmware every time i want to connect in client mode..

This is what I have done.. I have done a lot of tinkering with settings in the 'wireless' config file and I am constantly messing it up. After I get things set up the way that I want, I save a copy of the 'wireless' config file on my sd card and rename it "workingprofile". /sd/dip/workingprofile

I set up one of my dipswitches (up,up,up,down,up)with the commands:

cp /sd/dip/workingprofile /etc/config/wireless; uci commit wireless; wifi

Normally I work in (up,up,up,up,up). If I mess up the settings, I switch the dipswitches to (up,up,up,down,up) and reboot. I then switch the dipswitches to (up,up,up,up,up) and reboot again.

Now my 'workingprofile' file has been copied and renamed to /etc/config/wireless and will start working as normal.

Edited by yabasoya
Link to comment
Share on other sites

I would change 'EnterpriseG' to a static channel. I was merely trying to show you that if your 'EnterpriseG' was on a channel other than 6, it wouldn't connect. So you say that after a factory reset, you can connect to 'EnterpriseG' with wlan1?

So then wlan1 connects to 'EnterpriseG' for a period of time then has trouble connecting?

This is what I have done.. I have done a lot of tinkering with settings in the 'wireless' config file and I am constantly messing it up. After I get things set up the way that I want, I save a copy of the 'wireless' config file on my sd card and rename it "workingprofile". /sd/dip/workingprofile

I set up one of my dipswitches (up,up,up,down,up)with the commands:

cp /sd/dip/workingprofile /etc/config/wireless; uci commit wireless; wifi

Normally I work in (up,up,up,up,up). If I mess up the settings, I switch the dipswitches to (up,up,up,down,up) and reboot. I then switch the dipswitches to (up,up,up,up,up) and reboot again.

Now my 'workingprofile' file has been copied and renamed to /etc/config/wireless and will start working as normal.

Thanks a lot for the hint, i've done a few tests and i discovered that the problem is more general than i thought.. Infact i've noted that every time i reboot my /etc/config/wireless changes and the last part will increase so after the second reboot i get

config wifi-iface
        option device   radio3
        option network  lan
        option mode     ap
        option ssid     Pineapple5_C830
        option encryption none

I've tried with dip switches but it's useless because if i reboot i'll have radio(+1) and that will mess things up..:(

If i reboot another time i'll get radio 3 and so on..so that's why i suppse client mode is messing things up, but i don't know why this happens...I think it's firmware related at this point or a faulty hardware i don't know.. Any hints?

So then wlan1 connects to 'EnterpriseG' for a period of time then has trouble connecting?

The connection is stable, for temporary i mean until the next reboot :)

Edited by ptrac3
Link to comment
Share on other sites

ptrac3,

Your first post, bottom line you mention using "wifi detect > /etc/config/wireless". Are you running it just like that? Or are you using the piped version where it first deletes the wireless file? In the post above you mention ever time you reboot your wireless file changes... Are you running that wifi detect command each time before rebooting?

Lets walk the dog on this problem:

1. Boot pineapple (nothing else, do not enable Client Mode, if it does it automatically that's ok but it would be better if it didn't)

2. Look at etc/config/wireless file. There should only be 4 entries, 2 for wlan0 and 2 for wlan1

3. If #2 is good, go to the advanced tab and reboot the pineapple via the button and go to #4. (Don't use any commands like the wifi detect you've been using.) If it's not good go to #5.

4. After it reboots check the etc/config/wireless file again to see if it stayed the same. If it did, chances are you are inflicting the wireless file problems unknowingly and your system is good.

5. If #2 is NOT good and your wireless file has multiple entries. Use: rm /etc/config/wireless && wifi detect > /etc/config/wireless && reboot (Then go to #6.)

6. After it reboots start back at #2

Link to comment
Share on other sites

ptrac3,

Your first post, bottom line you mention using "wifi detect > /etc/config/wireless". Are you running it just like that? Or are you using the piped version where it first deletes the wireless file? In the post above you mention ever time you reboot your wireless file changes... Are you running that wifi detect command each time before rebooting?

Lets walk the dog on this problem:

1. Boot pineapple (nothing else, do not enable Client Mode, if it does it automatically that's ok but it would be better if it didn't)

2. Look at etc/config/wireless file. There should only be 4 entries, 2 for wlan0 and 2 for wlan1

3. If #2 is good, go to the advanced tab and reboot the pineapple via the button and go to #4. (Don't use any commands like the wifi detect you've been using.) If it's not good go to #5.

4. After it reboots check the etc/config/wireless file again to see if it stayed the same. If it did, chances are you are inflicting the wireless file problems unknowingly and your system is good.

5. If #2 is NOT good and your wireless file has multiple entries. Use: rm /etc/config/wireless && wifi detect > /etc/config/wireless && reboot (Then go to #6.)

6. After it reboots start back at #2

Ok thanks a lot, i did first a factory reset and followed your diagram..At the second point a get a clean /etc/config/wireless with four entries:

config wifi-device  radio0
        option type     mac80211
        option channel  11
        option hwmode   11ng
        option macaddr  00:13:37:a5:11:70
        option htmode   HT20
        list ht_capab   SHORT-GI-20
        list ht_capab   SHORT-GI-40
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     Pineapple5_1170
        option encryption none

config wifi-device  radio1
        option type     mac80211
        option channel  11
        option hwmode   11g
        option macaddr  12:4a:8f:86:1e:5f

        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio1
        option network  lan
        option mode     ap
        option ssid     Pineapple5_1E5F
        option encryption none

3. After that i've clicked the reboot in advanced tab

4. i get a non good file with more than 4 entries:

config wifi-device  radio0
        option type     mac80211
        option channel  11
        option hwmode   11ng
        option macaddr  00:13:37:a5:11:70
        option htmode   HT20
        list ht_capab   SHORT-GI-20
        list ht_capab   SHORT-GI-40
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     Pineapple5_1170
        option encryption none

config wifi-device  radio1
        option type     mac80211
        option channel  11
        option hwmode   11g
        option macaddr  12:4a:8f:86:1e:5f

        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio1
        option network  lan
        option mode     ap
        option ssid     Pineapple5_1E5F
        option encryption none

config wifi-device  radio2
        option type     mac80211
        option channel  11
        option hwmode   11g
        option macaddr  ca:4c:a3:3e:62:0b

        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio2
        option network  lan
        option mode     ap
        option ssid     Pineapple5_620B
        option encryption none

5 so i've issued the command rm /etc/config/wireless && wifi detect > /etc/config/wireless && reboot

6. the file it's not good and has more than four entries and it's:

config wifi-device  radio0
        option type     mac80211
        option channel  11
        option hwmode   11ng
        option macaddr  00:13:37:a5:11:70
        option htmode   HT20
        list ht_capab   SHORT-GI-20
        list ht_capab   SHORT-GI-40
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     Pineapple5_1170
        option encryption none

config wifi-device  radio1
        option type     mac80211
        option channel  11
        option hwmode   11g
        option macaddr  ca:4c:a3:3e:62:0b

        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio1
        option network  lan
        option mode     ap
        option ssid     Pineapple5_620B
        option encryption none

config wifi-device  radio2
        option type     mac80211
        option channel  11
        option hwmode   11g
        option macaddr  a6:90:30:bb:84:07

        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio2
        option network  lan
        option mode     ap
        option ssid     Pineapple5_8407
        option encryption none

if i reboot again i get:


config wifi-device  radio0
        option type     mac80211
        option channel  11
        option hwmode   11ng
        option macaddr  00:13:37:a5:11:70
        option htmode   HT20
        list ht_capab   SHORT-GI-20
        list ht_capab   SHORT-GI-40
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40
        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     Pineapple5_1170
        option encryption none

config wifi-device  radio1
        option type     mac80211
        option channel  11
        option hwmode   11g
        option macaddr  ca:4c:a3:3e:62:0b

        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio1
        option network  lan
        option mode     ap
        option ssid     Pineapple5_620B
        option encryption none

config wifi-device  radio2
        option type     mac80211
        option channel  11
        option hwmode   11g
        option macaddr  a6:90:30:bb:84:07

        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio2
        option network  lan
        option mode     ap
        option ssid     Pineapple5_8407
        option encryption none

config wifi-device  radio3
        option type     mac80211
        option channel  11
        option hwmode   11g
        option macaddr  3a:51:f6:ef:cb:69

        # REMOVE THIS LINE TO ENABLE WIFI:
        # option disabled 1

config wifi-iface
        option device   radio3
        option network  lan
        option mode     ap
        option ssid     Pineapple5_CB69
        option encryption none

Edited by ptrac3
Link to comment
Share on other sites

Ok then... That's definitely an issue and you aren't causing it. Maybe something is broken in the startup sequence.

7. Follow Sebkinne's advice and try a factory reset then try the steps over again. If the problem persists

8. Reflash your firmware. And try again.

Good Luck!

Link to comment
Share on other sites

Ok then... That's definitely an issue and you aren't causing it. Maybe something is broken in the startup sequence.

7. Follow Sebkinne's advice and try a factory reset then try the steps over again. If the problem persists

8. Reflash your firmware. And try again.

Good Luck!

Thank you so much for your feedback.. I did a stager upload, put in the sd latest firmware + md5, MK5 flashed evreything and everything was fine.. But if i go to advanced tab, click reboot, and then open /etc/config/wireless at the next reboot i can see the radio2 section.. :( At this point or it's firmware related (but i think it's no feasibile cause other people are not experiencing my problem i suppose) or ther's something faulty in my unit i don't know..

Edited by ptrac3
Link to comment
Share on other sites

I've found something new about this problem that for me it's getting weirder and mysterious..I've flashed several times but it persists so maybe i'm considering something hardware related issue but i'm not sure of this assumption..However what i've noted is that if i do a wifi detect /etc/config/wireless i'll get a working config and everything it's fine, but if i copy the wireless config, rename in wireless.bak and then overwrite with the bad config (and to commit the changes use wifi command) radio1 is still not working..Why? Because on every boot i discovered my pineapple is generating random mac addresses for radio1 so even with a correct config radio1 is not working cause it has to be a mac address match and so /etc/config/wireless must be generated on boot time. I've connected my pineapple through serial and i've found this:

[   32.860000] rtl8187: Invalid hwaddr! Using randomly generated MAC address
[   33.060000] ieee80211 phy1: hwaddr 6a:b9:3c:90:73:f0, RTL8187vB (default) V1 + rtl8225z2, rfkill mask 2
[   33.080000] rtl8187: Customer ID is 0xFF

so this is the proof it's generating random mac addresses but how's that possible? I never installed or even used macchanger, i had no time :)

Actually i have created an init script that is "solving" the problem:

#! /bin/sh /etc/rc.common
#Example script
 
START=10
STOP=15
 
start() {
 
        wifi detect > /etc/config/wireless
        tail /etc/config/wireless -n 17 > /etc/config/wireless2
        cat /etc/config/wireless1 /etc/config/wireless2 > /etc/config/wireless
        wifi
}
 
stop() {
 
        head -20 /etc/config/wireless > /etc/config/wireless1
 
 
}

With this script when i reboot i save the config of radio0 (and so ap said names and stuff like that) and i get a working radio1 because of the mac address match caused by the generation of wireless config at the boot time via wifi detect. What do you guys think of this issue? For you is it hardware or software cause problem? PS:is there a way to flash the pineapple through the serial port like in the MKIV?

Link to comment
Share on other sites

  • 3 weeks later...

This thread has been very educational despite ptrac3's problem, as it's given me the location of the config files and the basic entries for establishing the wireless interfaces. However...

I'm having a lot of trouble groking how to manage the network interfaces on the mk5. The normal cli tools for managing these things, like wpa_supplicant and dhclient are not on this distro. Obviously I can connect to AP's in client mode using the web GUI, but what I've noticed about this is that the mk5 will 'stick' to those AP's when in range. I have to use ifconfig to manually set the AP information to null it out so that the interface will not associate with a particular AP. I have not figured out how to disassociate any other way. Even after reboots. Can someone point me to some tools to help manage this better? Simply selecting "disconnect" in the web GUI does not always disassociate from the AP and upon reboots, doesn't prevent the mk5 from re-associating to that AP.

Also, I'm unclear on the purpose of the br-lan interface. It appears to change based upon various states of the mk5. What's its purpose? How is it controlled and what is the flow for how it's determined?

Thanks in advance.

Link to comment
Share on other sites

I'm pretty sure the wpa_supplicant is used on the pineapple... And if you want to control the wireless interfaces use the WiFi Manager infusion. br-lan is the bridged interface:

  • bridgeds: br0, br-lan
    are used to make multiple virtual or physical network interfaces act as if they were just one network interface (quasi the opposite of VLANs). Can also be used for VPN and bridged interfaces. The Linux Ethernet bridge can be used for connecting multiple Ethernet devices together. The connecting is fully transparent: hosts connected to one Ethernet device see hosts connected to the other Ethernet devices directly. understanding how bridge-interfaces work
Link to comment
Share on other sites

I couldn't find wpa_supplicant anywhere on the pineapple. Nor are any of the normal IP tool commands available (dhclient for one). It seems very black box.

Thanks for the explanation on the br-lan. I can see how this works, although I'm unclear why you'd want to configure eth0 this way, since there's only one port.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...