View previous topic :: View next topic |
Author |
Message |
sall Guru
Joined: 08 Jun 2008 Posts: 314 Location: WV, USA
|
Posted: Fri Jun 13, 2008 7:15 pm Post subject: Wireless on boot (SOLVED) |
|
|
I just got my bcm4318 wireless up and working. now the only thing is how can i have it so it automatically connects when i boot up my pc? Thanks!
Last edited by sall on Sat Jun 14, 2008 10:30 pm; edited 1 time in total |
|
Back to top |
|
|
truc Advocate
Joined: 25 Jul 2005 Posts: 3199
|
Posted: Fri Jun 13, 2008 9:40 pm Post subject: |
|
|
start wpa_supplicant, and then start wpa_cli as a daemon, with a script which will do what you need/wnat when the status of your wireless change - CONNECTED/DISCONNECTED (you usually want to 'start a dhcp client')
For example, I start wpa_cli like that:
wpa_cli -a /etc/wpa_supplicant/my_wpa_cli.sh
and /etc/wpa_supplicant/my_wpa_cli.sh: | #!/bin/sh
# saaaaammmm
INT="$1"
EVENT="$2"
DHCP="dhclient"
# configure_interface, reset_conf_interface {{{
function configure_interface () {
echo "Interface $INT connected (\"${WPA_ID_STR}[${WPA_ID}]\"), trying configure it with ${DHCP%% *}"
$DHCP $1
}
function reset_conf_interface () {
echo "Interface $INT disconnected"
}
# }}}
case "$EVENT" in
"CONNECTED")
configure_interface $INT
;;
"DISCONNECTED")
reset_conf_interface $INT
;;
esac
# vim: set et sw=3 sts=3 foldmethod=marker : |
Hope this helps:) _________________ The End of the Internet! |
|
Back to top |
|
|
sall Guru
Joined: 08 Jun 2008 Posts: 314 Location: WV, USA
|
Posted: Fri Jun 13, 2008 10:23 pm Post subject: |
|
|
i want it to only connect to my specific wireless network, not just turn on the wireless, my wireless already turns on at boot, it just doesn't remember what network and key to use. Does this make my question less vague? In ubuntu i would set up a script to run in /etc/network/interfaces saying:
auto wlan0
auto wlan0 dhcp
essid-wireless linksys132
essid-key 1234567890
I need something likie this to run at boot? |
|
Back to top |
|
|
digital0001 n00b
Joined: 06 Nov 2006 Posts: 21 Location: Portugal
|
Posted: Fri Jun 13, 2008 10:29 pm Post subject: rc script |
|
|
Hi!
I would start it by using:
rc-update add net.wlan0 default
this assuming that your wireless interface is called wlan0.
Your computer might still want to bring up eth0 if you have such
interface, I usally change /etc/conf.d/rc to not bring up eth0.
Hope this helped some.
Cheers |
|
Back to top |
|
|
sall Guru
Joined: 08 Jun 2008 Posts: 314 Location: WV, USA
|
Posted: Fri Jun 13, 2008 10:45 pm Post subject: |
|
|
yeah how do I go about stopping eth0 from being loaded?
I have done:
rc-update add net.wlan0 default
So, my computer does properly bootr up wireless nic. I'd like to know how to have it automatically connect to my essid automatically with a WEP key on boot. Thanks. |
|
Back to top |
|
|
digital0001 n00b
Joined: 06 Nov 2006 Posts: 21 Location: Portugal
|
Posted: Sat Jun 14, 2008 12:30 pm Post subject: Stop eth0, and autoload with wep... |
|
|
Hi again.. here comes some short instructions, there are probably better in the
documentation and the wiki.
To stop eth0 from being loaded.
In /etc/conf.d/rc
The RC_PLUG_SERVICE line should look something like this:
Code: | RC_PLUG_SERVICES="!net.* net.wlan0" |
To configure the wiress inteface I use wpa_supplicant, so it
need emerging if it isn't already.
Then my /etc/conf.d/net looks like this.
Code: | config_eth0=( "dhcp" )
dhcp_eth0="nodns nontp nonis"
modules_wlan0=("wpa_supplicant")
wpa_supplicant_wlan0="-Dwext /etc/wpa_supplicant.conf"
wpa_timeout_wlan0=60
config_wlan0=("dhcp") |
That should configure the wlan0 to use wpa_supplicant
And then the last configurations that is needed to provide a wep key or similar
goes in /etc/wpa_supplicant/wpa_supplicant.conf. The settings there are
dependent on you network, but should not be that hard to configure.
Hope this helps some.
Cheers |
|
Back to top |
|
|
sall Guru
Joined: 08 Jun 2008 Posts: 314 Location: WV, USA
|
Posted: Sat Jun 14, 2008 6:43 pm Post subject: |
|
|
Thanks digital0001, That was perfect adding those lines /etc/conf.d/net and then editing my wpa_supplicant conf to what i needed did the trick. |
|
Back to top |
|
|
|