You are not logged in.

#1 2010-05-23 11:41:05

bennylb0
Member
From: Melbourne, Australia
Registered: 2010-05-21
Posts: 66

WPA2 with Netcfg and Newlan

Hi all,

I'm able to connect to the web from the command line easily enough but i would like to automatically connect at boot. I'm using wpa_supplicant to connect and and from what I understand so far I need Netcfg to automate it. I installed Netcfg and went to /etc/network.d/examples to find examples to work with but it isn't there.

Can anyone tell me where I can find and example?

Thanks,

Offline

#2 2010-05-23 12:15:33

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: WPA2 with Netcfg and Newlan

Why not making a script with commands you use to connect from the command line usually? Then you can add the script to xinitrc so it autoconnects when you login to your session.
If you don't use netcfg to connect to the access point while wanting to connect, you don't need it for connecting at startup either. Just make a script. smile
Or maybe you insist on using netcfg?

Offline

#3 2010-05-23 12:21:48

bennylb0
Member
From: Melbourne, Australia
Registered: 2010-05-21
Posts: 66

Re: WPA2 with Netcfg and Newlan

Yeah great idea, I'll give it s shot.

Thanks,

Offline

#4 2010-05-23 12:52:53

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: WPA2 with Netcfg and Newlan

Example, here's my script to connect with ethernet:

#! /bin/bash

echo 'password' | sudo -S ifconfig eth0 up
sudo dhcpcd eth0

Sure, this sudo -S part isn't really secure, but it does the job pretty nicely.
Now, if I want to connect when the session starts, I add this line to .xinitrc (in /home/user/):

exec /path/to/script/script.sh

before! exec openbox-session (or whatever WM or DE you got)

If there's any problems with this approach, reply here, and I may help if I will know. wink

Offline

#5 2010-05-23 13:15:03

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: WPA2 with Netcfg and Newlan

If you have installed netcfg, the examples must be present inside the /etc/network.d/examples/ folder. Not sure why you can't find them, maybe reinstall netcfg?

Connecting automatically on boot is as easy as adding the net-profiles daemon and "NETWORKS=(profile)" to rc.conf. See here for more infos: http://wiki.archlinux.org/index.php/Net … omatically

Offline

#6 2010-05-23 13:20:50

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: WPA2 with Netcfg and Newlan

Yes, but I guess that it's much better to just exec one script on startup except having a daemon running in the background. smile

Offline

#7 2010-05-23 13:28:27

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: WPA2 with Netcfg and Newlan

Sure, pick what you like. I just responded to the OP's question wink
I don't believe net-profiles daemon comes with a noteworthy overhead, though. 

For an overview of different wireless management methods, see here.

Offline

Board footer

Powered by FluxBB