Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
wpa_supplicant - HOWTO?
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
indietrash
Guru
Guru


Joined: 17 Sep 2008
Posts: 353
Location: Norway

PostPosted: Mon Oct 26, 2009 2:09 pm    Post subject: wpa_supplicant - HOWTO? Reply with quote

how do you actually use wpa_supplicant?

I have emerged it and edited /etc/wpa_supplicant/wpa_supplicant.conf like so:

Code:
# The below line not be changed otherwise we refuse to work
ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration
ctrl_interface_group=wheel

# Let wpa_supplicant take care of scanning and AP selection
ap_scan=1

network={
   ssid="Kaninslakt"
   #psk="mypassphrase
   psk=mypassphrase
}

network={
  ssid="HiN"
  key_mgmt=NONE
}


and /etc/conf.d/net like so:

Code:
wpa_supplicant_wlan0="-Diwlagn"




but what now? how do I use this?
Back to top
View user's profile Send private message
noice
Guru
Guru


Joined: 05 Dec 2005
Posts: 473
Location: italia, Ischia

PostPosted: Mon Oct 26, 2009 2:34 pm    Post subject: Reply with quote

you have to configure /etc/conf.d/net..
it's mine: (i don't use dhcp)
Code:
config_wlan0=( "192.168.1.7 netmask 255.255.255.0" )
routes_wlan0=( "default via 192.168.1.1" )
modules_wlan0=( "wpa_supplicant" )
wpa_supplicant_wlan0="-Dwext"

and
Code:
/etc/init.d/net.wlan0 start

_________________
Noice

when you post remove comments
Code:
grep -vh '^[[:space:]]*\(#\|$\)' "$@"
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: Mon Oct 26, 2009 3:55 pm    Post subject: Reply with quote

For a dhcp connection :

Code:

#WPA_SUPPLICANT
modules=( "wpa_supplicant" )
wpa_supplicant_wlan0="-Dwext"
config_wlan0=( "dhcp" )
Back to top
View user's profile Send private message
pappy_mcfae
Watchman
Watchman


Joined: 27 Dec 2007
Posts: 5999
Location: Pomona, California.

PostPosted: Tue Oct 27, 2009 5:21 am    Post subject: Reply with quote

wpa_supplicant_wlan0="-Diwlagn"is incorrect. There is only one way to setup wpa_supplicant in /etc/conf.d/net:
Code:
wpa_supplicant_wlan0="-Dwext"
.
Any other interface declaration will fail!

Blessed be!
Pappy
_________________
This space left intentionally blank, except for these ASCII symbols.
Back to top
View user's profile Send private message
indietrash
Guru
Guru


Joined: 17 Sep 2008
Posts: 353
Location: Norway

PostPosted: Tue Oct 27, 2009 7:23 am    Post subject: Reply with quote

d2_racing wrote:
For a dhcp connection :

Code:

#WPA_SUPPLICANT
modules=( "wpa_supplicant" )
wpa_supplicant_wlan0="-Dwext"
config_wlan0=( "dhcp" )


where does this go? in /etc/conf.d/net? and how do I use any of it? as in - how do I proceed to get my wlan0 interface on net?
Back to top
View user's profile Send private message
bonzai.it
n00b
n00b


Joined: 09 Oct 2009
Posts: 47
Location: Somewhere in the Apennines

PostPosted: Tue Oct 27, 2009 7:44 am    Post subject: Reply with quote

indietrash wrote:
where does this go? in /etc/conf.d/net? and how do I use any of it? as in - how do I proceed to get my wlan0 interface on net?

Have yoo looked at this http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4? It explains everything...
But if you use a DE my advice is networkmanager http://www.gentoo-wiki.info/NetworkManager: it's so handy.
_________________
" ... I have became comfortably dumb ... "
Back to top
View user's profile Send private message
indietrash
Guru
Guru


Joined: 17 Sep 2008
Posts: 353
Location: Norway

PostPosted: Tue Oct 27, 2009 8:54 am    Post subject: Reply with quote

that doesn't really explain anything. it's a horrible document.

I don't use a desktop environment, but Network Manager is desktop environment independent.. I absolutely despise Network Manager. it has never given me anything but trouble. I'll give it a go though, and see if it serves me better now than it has done in the past.
Back to top
View user's profile Send private message
bloedie
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2006
Posts: 88
Location: Germany

PostPosted: Tue Oct 27, 2009 9:30 am    Post subject: Reply with quote

Hi.

Did you tried out the package

wireless-tools

http://en.gentoo-wiki.com/wiki/Wireless_Networking


I like this very much.

Cu.
Bloedie
Back to top
View user's profile Send private message
indietrash
Guru
Guru


Joined: 17 Sep 2008
Posts: 353
Location: Norway

PostPosted: Tue Oct 27, 2009 9:48 am    Post subject: Reply with quote

wireless-tools don't do wpa.
Back to top
View user's profile Send private message
noice
Guru
Guru


Joined: 05 Dec 2005
Posts: 473
Location: italia, Ischia

PostPosted: Tue Oct 27, 2009 10:09 am    Post subject: Reply with quote

indietrash wrote:
d2_racing wrote:
For a dhcp connection :

Code:

#WPA_SUPPLICANT
modules=( "wpa_supplicant" )
wpa_supplicant_wlan0="-Dwext"
config_wlan0=( "dhcp" )


where does this go? in /etc/conf.d/net? and how do I use any of it? as in - how do I proceed to get my wlan0 interface on net?

Code:
dhcpcd wlan0

_________________
Noice

when you post remove comments
Code:
grep -vh '^[[:space:]]*\(#\|$\)' "$@"
Back to top
View user's profile Send private message
bonzai.it
n00b
n00b


Joined: 09 Oct 2009
Posts: 47
Location: Somewhere in the Apennines

PostPosted: Tue Oct 27, 2009 10:18 am    Post subject: Reply with quote

indietrash wrote:
where does this go? in /etc/conf.d/net? and how do I use any of it? as in - how do I proceed to get my wlan0 interface on net?

As stated in the orrible document :D you should add some general config info in /etc/init,d/net as those d2_racing provide you then set specific ESSID settings in /etc/wpa_supplicant/wpa_supplicant.conf.

indietrash wrote:
Code:
network={
   ssid="Kaninslakt"
   #psk="mypassphrase
   psk=mypassphrase
}


This should work with WPA
_________________
" ... I have became comfortably dumb ... "
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: Tue Oct 27, 2009 11:50 am    Post subject: Reply with quote

Before we do the setup, we should check if his wireless card can find something :P

Code:

# ifconfig -a
# iwconfig
# iwlist scan
Back to top
View user's profile Send private message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 683

PostPosted: Sat Oct 31, 2009 5:35 am    Post subject: Reply with quote

Code:
pigeon@eee ~ $ cat /etc/conf.d/net
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
pigeon@eee ~ $ sudo grep -v psk /etc/wpa_supplicant/wpa_supplicant.conf|grep -v \#
network={
   ssid="leave_me_alone"
   key_mgmt=WPA-PSK
   priority=10
}

network={
   key_mgmt=NONE
   priority=-9999999
}

pigeon@eee ~ $
There is, of course, a 'psk=<64 character hex passphrase>' line, but I chose not to share it. As you can see, my /etc/conf.d/net file is completely blank. You don't need it if you're using dhcp to get an ip address. You just need to ensure that /etc/init.d/net.wlan0 exists and is a symlink to /etc/init.d/net.lo

Note that you will either have:
Code:
psk="up to 63 character [a-zA-Z0-9] passphrase"
or
psk=64 character [0-9a-fA-F] passphrase
Note the quotes.
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: Sat Oct 31, 2009 3:23 pm    Post subject: Reply with quote

Are you sure that you don't need to tell net.lo that you actually use wpa_supplicant instead of iwconfig ?
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Sat Oct 31, 2009 4:11 pm    Post subject: Reply with quote

d2_racing wrote:
Are you sure that you don't need to tell net.lo that you actually use wpa_supplicant instead of iwconfig ?

If you do not install net-wireless/wireless-tools this might just work. Maybe the default order changed as well but I have no baselayout1 system with wlan anymore to test this.
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: Sat Oct 31, 2009 4:17 pm    Post subject: Reply with quote

Ok, but the best way is to actually configure it inside /etc/conf.d/net instead of hoping that the script will handle it.
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Sat Oct 31, 2009 4:33 pm    Post subject: Reply with quote

d2_racing wrote:
Ok, but the best way is to actually configure it inside /etc/conf.d/net instead of hoping that the script will handle it.


We have seen many examples where an old "more configured" xorg.conf or hal policy broke things. I tend to only edit config files if necessary and only by the minimum required to get things working. I guess everyone has to decide this on his own.
Back to top
View user's profile Send private message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 683

PostPosted: Sat Oct 31, 2009 8:45 pm    Post subject: Reply with quote

sera wrote:
d2_racing wrote:
Are you sure that you don't need to tell net.lo that you actually use wpa_supplicant instead of iwconfig ?
If you do not install net-wireless/wireless-tools this might just work. Maybe the default order changed as well but I have no baselayout1 system with wlan anymore to test this.
Code:
pigeon@eee ~ $ eix wireless-tools;cat /etc/conf.d/net;sudo ifconfig
[I] net-wireless/wireless-tools
     Available versions:  29 [M](~)30_pre6 [M](~)30_pre7 [M](~)30_pre8 {linguas_cs linguas_fr multicall nls}
     Installed versions:  29(12:39:18 10/11/09)(nls -multicall)
     Homepage:            http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
     Description:         A collection of tools to configure IEEE 802.11 wireless LAN cards

# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).
eth0      Link encap:Ethernet  HWaddr 00:23:54:45:57:85 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:27

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:20205 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20205 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1111864 (1.0 MiB)  TX bytes:1111864 (1.0 MiB)

ra0       Link encap:Ethernet  HWaddr 00:22:43:25:a3:fb 
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:63407384 errors:1 dropped:0 overruns:0 frame:0
          TX packets:937394 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2739010260 (2.5 GiB)  TX bytes:261753746 (249.6 MiB)
          Interrupt:19

pigeon@eee ~ $
You do not need /etc/conf.d/net even if wireless-tools is installed. If you have installed wpa_supplicant, openrc assumes you intend to use it. And yes, I'm sure, because that's how my system is set up. Note that I'm using baselayout-2. I have no idea if the same setup would work in baselayout-1, but I'd be surprised if it didn't. I don't ever remember having to configure /etc/conf.d/net except for systems with a static IPs.

indietrash - does it work? If it doesn't, what error message does it give?
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Sat Oct 31, 2009 9:26 pm    Post subject: Reply with quote

With baselayout2 /etc/conf.d/net together with /etc/init.d/net.lo shouldn't be used anymore as they both got deprecated with the newest openrc release. Also the now deprecated net.lo script for baselayout2 differs from the one for baselayout1.

The most complete resource for new style networking I've seen so far is located at http://www.gentoo-quebec.org/wiki/index.php/500-Entretien:Migration_vers_openrc_0.5.x_Gentoo It's in French so.
Back to top
View user's profile Send private message
pappy_mcfae
Watchman
Watchman


Joined: 27 Dec 2007
Posts: 5999
Location: Pomona, California.

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

You can find the english version here. I wrote it, Gentoo Quebec translated and edited it.

Blessed be!
Pappy
_________________
This space left intentionally blank, except for these ASCII symbols.
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Sun Nov 01, 2009 11:12 am    Post subject: Reply with quote

pappy_mcfae wrote:
You can find the english version here. I wrote it, Gentoo Quebec translated and edited it.

Blessed be!
Pappy


This thread contains a lot of things which are wrong or just badly formulated. Also it is missing a few things and splits the needed info to get a grasp of the concept over the hole thread.

Better use a translatinon by google of the document at gentoo-quebec.
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 01, 2009 8:06 pm    Post subject: Reply with quote

And if the translation is not great, I can help you with that :P
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