Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto re-try wireless [almost solved]
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
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 179
Location: Melbourne, AU

PostPosted: Sat Nov 21, 2009 8:24 pm    Post subject: Howto re-try wireless [almost solved] Reply with quote

How do i setup the wireless network so that that it keeps retrying to connect
At the moment it tries to connect once then stops
I'd like it to alternate between managed and ad-hoc

Code:
modules=("iwconfig")
essid_wlan0="chris"
adhoc_essid_wlan0="stuff"
config_chris=("192.168.1.113/24")
routes_chris=("default via 192.168.1.254")
dns_servers_chris=( "192.168.1.254" )
config_stuff=("192.168.1.10/24")
Code:

Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection


Last edited by chris... on Sun Nov 22, 2009 4:50 am; edited 1 time in total
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Sat Nov 21, 2009 9:06 pm    Post subject: Reply with quote

wpa-supplicant can manage AP connections like this pretty well (perhaps 5-20 seconds of time to reconnect to new AP) and apparently supports adhoc mode too. It allows configuring priorities to specify preferred wireless networks. I think it would work well for you. It doesn't necessarily require wpa, by the way, but supports unsecured, and probably poorly secured (WEP) networks too.
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 179
Location: Melbourne, AU

PostPosted: Sat Nov 21, 2009 11:23 pm    Post subject: Reply with quote

wpa-supplicant will continuously try connecting between ad-hoc and managed?
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sun Nov 22, 2009 2:02 am    Post subject: Reply with quote

I'm not an expert on that, but WICD can do a lot of stuff, so instead of using the manual way, maybe you should try WICD to test if it's working with that little program.
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Sun Nov 22, 2009 2:23 am    Post subject: Reply with quote

I'm pretty sure wicd uses wpa_supplicant.

Quote:
instead of using the manual way


it's fully automated, just doesn't provide more than a crappy interface to wpa_supplicant.conf (wpa_cli exists but is a pain to use). but wpa_supplicant.conf is easy enough to create. here's an example with a low-priority block for connection to open networks and a block with WPA enabled.
Code:

network={
        key_mgmt=NONE
        priority=-9999999
}
network={
        ssid="your-essid"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="your-passkey"
        priority=10
}

You'll have to figure out how to add an ad-hoc network yourself. It seems to be supported according to google, but I've never done it.
Quote:
wpa-supplicant will continuously try connecting between ad-hoc and managed?


It will continually poll the surrounding air, checking to see what wireless networks are available, and connect to a higher priority network when it is available. it will then stay on that network until it is either unavailable or an even higher priority network is available.
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 179
Location: Melbourne, AU

PostPosted: Sun Nov 22, 2009 3:26 am    Post subject: Reply with quote

ok i've got wpa_supplicant working but not with an ad-hoc network
in the doco it says to add "mode=1" to the network block, but that doesnt seem to work

i can manually get an ad-hoc network working

ok ad-hoc seems to work when i set
Code:
ap_scan=2

will have to wait till i get back home to see if it works as expected with a managed ap
Back to top
View user's profile Send private message
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 179
Location: Melbourne, AU

PostPosted: Sun Nov 22, 2009 9:56 am    Post subject: Reply with quote

OK, it mostly works apart from connecting to a managed network
It'll connect to an ad-hoc network
It'll connect as ad-hoc but doesnt realise its the only computer and wont try a managed network, but that may be becuase it wont connect to a managed network in the first place
It'll swap between trying to connect to 2 different access points but not connect to either

wpa-supplicant wont seem work with ad-hoc and managed
if i want to use managed i need to set ap_scan=1
if i want to use ad-hoc i need to set ap_scan=2
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Sun Nov 22, 2009 6:35 pm    Post subject: Reply with quote

interesting. I can see that being the case. Did you set the managed network priority higher than the ad-hoc network? care to post your wpa_supplicant.conf?
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 179
Location: Melbourne, AU

PostPosted: Sun Nov 22, 2009 8:50 pm    Post subject: Reply with quote

one is 11n
two is 11g
I'm using iwlagn and iwl3945 wireless modules
all work manually in ad-hoc and managed mode

Code:
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=1
country=AU

network={
  ssid="one"
  key_mgmt=NONE
  priority=2
}
network={
  ssid="two"
  key_mgmt=NONE
  priority=1
}
network={
  ssid="adhoc"
  key_mgmt=NONE
  mode=1
}


iwl3945 has "two" as a higher priority so it prefers the 11g router
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Mon Nov 23, 2009 9:10 pm    Post subject: Reply with quote

Shouldn't the advocate net have a priority too?
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 179
Location: Melbourne, AU

PostPosted: Tue Nov 24, 2009 3:57 am    Post subject: Reply with quote

no, its the default 0
however, setting it makes no difference
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