:: Re: [Dng] John Goerzen asks, "Has m…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Isaac Dunham
Date:  
À: Steve Litt
CC: dng
Sujet: Re: [Dng] John Goerzen asks, "Has modern Linux lost its way?"
On Thu, Feb 12, 2015 at 09:42:07AM -0500, Steve Litt wrote:
> On Thu, 12 Feb 2015 11:25:46 +0100
> Didier Kryn <kryn@???> wrote:
>
> >      Same kind of dislike towards network-manager. This is the first 
> > package I use to remove after installing Debian. The reason: I don't 
> > know really what it does and how, but it goes in the middle of my
> > way. I am well off with ifplugd, wpa_supplicant and a roaming
> > configuration of wlan0.

>
> Didier,
>
> Please, please, PLEASE post instructions on how to do everything
> discussed in the preceding paragraph. I've had a lot of trouble
> replacing NetworkManager/Wicd with wpa_supplicant and iwlist, even
> though I know it's perfectly possible.
>
> If you could place these instructions on the web and let us know the
> URL, I know I'd be eternally grateful, and I bet I'm not alone.


I've done it myself, many times. But I don't have a website to point
you at.
I can provide an overview of how you do it, and some references.
(If you want to copy/extend/distribute this, please do so!)

OVERVIEW:
iwlist doesn't really work nicely with wpa_supplicant*; a better approach
is to create a minimal wpa_supplicant.conf that contains the line:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=networking

start wpa_supplicant (as root):
wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

then run "wpa_cli" (as root or any user in group "networking")
and at the prompt there enter:
> scan
> scan_results


Or use "wpa_cli scan; sleep 5; wpa_cli scan_results" where sleep is just
to wait for results from the scan to become available.

To configure wpa_supplicant to connect to an open network:
Append this to wpa_supplicant.conf:
network={
        ssid="Private_SSID"
        key_mgmt=NONE
}


For a WPA network "WPA_SSID":
wpa_passphrase "WPA_SSID" passphrase >>/etc/wpa_supplicant/wpa_supplicant.conf

For a WEP network "WEP_SSID":
network={
       ssid="WEP_SSID"
       key_mgmt=IEEE8021X
       eap=MD5
       wep_key0=ffffffffff
}


Add as many of these entries as you need to
/etc/wpa_supplicant/wpa_supplicant.conf; each network= stanza defines
an alternate network (or set of networks) to connect to.

After configuring wpa_supplicant, run
wpa_cli reconfigure
wpa_cli reassociate
#now check if you're connected:
wpa_cli status

You will now have to manually configure the interface; this may be
just running the dhcp client:
dhclient wlan0

Once you have wpa_supplicant running, you may want to add the proper
configuration to /etc/network/interfaces for future use:
# you may prefer to use "manual wlan0" and then add this to rc.local:
# ifup wlan0 &
auto wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf



*While iwlist gives you a list of SSIDs, it doesn't really clarify
whether an "encrypted" network is WPA or WEP. If you only need to use
WEP or open networks, iwlist and iwconfig are adequate.

SECURITY:
/etc/wpa_supplicant/wpa_supplicant.conf should be chmod o-rwx unless
you intend to let anyone with access to your computer read network
passwords.

Anyone in the group specified at the top of wpa_supplicant.conf will be
able to connect to wpa_supplicant and control it; you may wish to give
them g+rw access to wpa_supplicant.conf
(In the example the group is "networking".)
Internally, the way this works is that /var/run/wpa_supplicant/ is
chown root:$GROUP
and contains a series of sockets named for the interfaces controlled.


REFERENCES:
First off, the manpages you should be reading:
ifup(8), interfaces(5), wpa_supplicant.conf(5), wpa_supplicant(8),
wpa_cli(8), wpa_action(8), wpa_passphrase(8)


Links:
https://wiki.debian.org/WPA
https://wiki.debian.org/WiFi/HowToUse#Command_Line