From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-128852-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1R80UV-0007LV-C7
	for garchives@archives.gentoo.org; Mon, 26 Sep 2011 02:00:20 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 219AF21C2A6;
	Mon, 26 Sep 2011 01:59:56 +0000 (UTC)
Received: from svr-us4.tirtonadi.com (unknown [69.65.43.212])
	by pigeon.gentoo.org (Postfix) with ESMTP id 357B821C0F3
	for <gentoo-user@lists.gentoo.org>; Mon, 26 Sep 2011 01:58:10 +0000 (UTC)
Received: from mail-fx0-f53.google.com ([209.85.161.53])
	by svr-us4.tirtonadi.com with esmtpsa (TLSv1:RC4-SHA:128)
	(Exim 4.69)
	(envelope-from <pandu@poluan.info>)
	id 1R80SP-003Jhq-Q8
	for gentoo-user@lists.gentoo.org; Mon, 26 Sep 2011 08:58:10 +0700
Received: by fxh2 with SMTP id 2so6165331fxh.40
        for <gentoo-user@lists.gentoo.org>; Sun, 25 Sep 2011 18:58:05 -0700 (PDT)
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Received: by 10.223.17.219 with SMTP id t27mr9524892faa.123.1317002285437;
 Sun, 25 Sep 2011 18:58:05 -0700 (PDT)
Received: by 10.223.97.70 with HTTP; Sun, 25 Sep 2011 18:58:05 -0700 (PDT)
Received: by 10.223.97.70 with HTTP; Sun, 25 Sep 2011 18:58:05 -0700 (PDT)
In-Reply-To: <CAA2qdGV5H5JOk9ii4sPaNCe=mNUDi1izqHYTFyZ2GsD2Q7jczw@mail.gmail.com>
References: <CAA2qdGV5H5JOk9ii4sPaNCe=mNUDi1izqHYTFyZ2GsD2Q7jczw@mail.gmail.com>
Date: Mon, 26 Sep 2011 08:58:05 +0700
Message-ID: <CAA2qdGUM1CkrpvifJ9rgPnOu4zO80Paj_+tCHW=uwTMcP2ORXw@mail.gmail.com>
Subject: Re: [gentoo-user] WPA2 connection configuration?
From: Pandu Poluan <pandu@poluan.info>
To: gentoo-user@lists.gentoo.org
Content-Type: multipart/alternative; boundary=001517440f6664531604adce7db4
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - svr-us4.tirtonadi.com
X-AntiAbuse: Original Domain - lists.gentoo.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - poluan.info
X-Archives-Salt: 
X-Archives-Hash: ec7f2a199cbf5abe62b76e5601d9205a

--001517440f6664531604adce7db4
Content-Type: text/plain; charset=UTF-8

On Sep 26, 2011 6:37 AM, "Mark Knecht" <markknecht@gmail.com> wrote:
>
> On Sun, Sep 25, 2011 at 1:59 PM, Florian Philipp <lists@binarywings.net>
wrote:
> > Am 25.09.2011 22:38, schrieb Mark Knecht:
> >> Hi,
> >>    Can anyone supply an example of correctly setting up wpa_supplicant
> >> to connect to a WEP2 home network?
> >>
> >>    If got the modules installed and the hardware telling me it sees
> >> all sorts of ESSIDs but so far I cannot figure out how to give it the
> >> password correctly. I've been trying to follow this page but it
> >> completely eludes me.
> >>
> >> http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=4
> >>
> >> Thanks in advance,
> >> Mark
> >>
> >
> > This should be sufficient:
> > network={
> >        ssid="network_ssid"
> >        key_mgmt=WPA-PSK
> >        psk="password"
> > }
> >
> > Hope this helps,
> > Florian Philipp
>
> Thanks Florian. I really appreciate the help. It was enough to get
> things working after I realized I have a mind block about routes. This
> email is coming to you over wireless so things are alright now, but I
> have some confusion about switching between networks:
>
> Looking here:
>
> slinky ~ # cat /etc/conf.d/net
> config_eth0="192.168.1.55 netmask 255.255.255.0"
> routes_eth0="default via 192.168.1.1"
>
> modules="wpa_supplicant"
>
> config_wlan0="192.168.1.100 netmask 255.255.255.0"
> routes_wlan0="default via 192.168.1.1"
>
> slinky ~ #
>
> I specified routes for both eth0 and wlan0 thinking Gentoo would use
> the one thats up, but it doesn't. It seems that even when I shut off
> eth0 it still tries to use the eth0 route. To get his working I had to
> comment out the eth0 route completely.
>

I suggest using the postup() and predown() facilities instead:

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=5

In postup(), create the default route e.g. ip route add default via $DG_IP
dev $IFACE metric $METRIC

In predown(), delete the default route. Same command, but 'delete' instead
of 'add'.

Note: metric comes into play only when eth0 and wlan0 are up simultaneously;
the lowest metric wins.

> So, is there a way to point the default to 192.168.1.1 and have the
> network use the one interface that's up?
>

Well, the default gateway on eth0 and wlan0 has the same IP. I'm not sure
iproute2 can stomach that.

> Also, is there a way to have the system use wireless anytime he wired
> connector isn't hooked up, of do I manually have to switch to root and
> then do
>
> /etc/init.d/net.eth0 stop
> /etc/init.d/net.wlan start
>
> to switch over?
>

ifplugd or netplug.

Rgds,

--001517440f6664531604adce7db4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p><br>
On Sep 26, 2011 6:37 AM, &quot;Mark Knecht&quot; &lt;<a href=3D"mailto:mark=
knecht@gmail.com">markknecht@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On Sun, Sep 25, 2011 at 1:59 PM, Florian Philipp &lt;<a href=3D"mailto=
:lists@binarywings.net">lists@binarywings.net</a>&gt; wrote:<br>
&gt; &gt; Am 25.09.2011 22:38, schrieb Mark Knecht:<br>
&gt; &gt;&gt; Hi,<br>
&gt; &gt;&gt; =C2=A0 =C2=A0Can anyone supply an example of correctly settin=
g up wpa_supplicant<br>
&gt; &gt;&gt; to connect to a WEP2 home network?<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; =C2=A0 =C2=A0If got the modules installed and the hardware te=
lling me it sees<br>
&gt; &gt;&gt; all sorts of ESSIDs but so far I cannot figure out how to giv=
e it the<br>
&gt; &gt;&gt; password correctly. I&#39;ve been trying to follow this page =
but it<br>
&gt; &gt;&gt; completely eludes me.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; <a href=3D"http://www.gentoo.org/doc/en/handbook/handbook-x86=
.xml?part=3D4&amp;chap=3D4">http://www.gentoo.org/doc/en/handbook/handbook-=
x86.xml?part=3D4&amp;chap=3D4</a><br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Thanks in advance,<br>
&gt; &gt;&gt; Mark<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt; This should be sufficient:<br>
&gt; &gt; network=3D{<br>
&gt; &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0ssid=3D&quot;network_ssid&quot;<br>
&gt; &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0key_mgmt=3DWPA-PSK<br>
&gt; &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0psk=3D&quot;password&quot;<br>
&gt; &gt; }<br>
&gt; &gt;<br>
&gt; &gt; Hope this helps,<br>
&gt; &gt; Florian Philipp<br>
&gt;<br>
&gt; Thanks Florian. I really appreciate the help. It was enough to get<br>
&gt; things working after I realized I have a mind block about routes. This=
<br>
&gt; email is coming to you over wireless so things are alright now, but I<=
br>
&gt; have some confusion about switching between networks:<br>
&gt;<br>
&gt; Looking here:<br>
&gt;<br>
&gt; slinky ~ # cat /etc/conf.d/net<br>
&gt; config_eth0=3D&quot;192.168.1.55 netmask 255.255.255.0&quot;<br>
&gt; routes_eth0=3D&quot;default via 192.168.1.1&quot;<br>
&gt;<br>
&gt; modules=3D&quot;wpa_supplicant&quot;<br>
&gt;<br>
&gt; config_wlan0=3D&quot;192.168.1.100 netmask 255.255.255.0&quot;<br>
&gt; routes_wlan0=3D&quot;default via 192.168.1.1&quot;<br>
&gt;<br>
&gt; slinky ~ #<br>
&gt;<br>
&gt; I specified routes for both eth0 and wlan0 thinking Gentoo would use<b=
r>
&gt; the one thats up, but it doesn&#39;t. It seems that even when I shut o=
ff<br>
&gt; eth0 it still tries to use the eth0 route. To get his working I had to=
<br>
&gt; comment out the eth0 route completely.<br>
&gt;</p>
<p>I suggest using the postup() and predown() facilities instead:</p>
<p><a href=3D"http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=
=3D4&amp;chap=3D5">http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?p=
art=3D4&amp;chap=3D5</a></p>
<p>In postup(), create the default route e.g. ip route add default via $DG_=
IP dev $IFACE metric $METRIC</p>
<p>In predown(), delete the default route. Same command, but &#39;delete&#3=
9; instead of &#39;add&#39;.</p>
<p>Note: metric comes into play only when eth0 and wlan0 are up simultaneou=
sly; the lowest metric wins.</p>
<p>&gt; So, is there a way to point the default to 192.168.1.1 and have the=
<br>
&gt; network use the one interface that&#39;s up?<br>
&gt;</p>
<p>Well, the default gateway on eth0 and wlan0 has the same IP. I&#39;m not=
 sure iproute2 can stomach that.</p>
<p>&gt; Also, is there a way to have the system use wireless anytime he wir=
ed<br>
&gt; connector isn&#39;t hooked up, of do I manually have to switch to root=
 and<br>
&gt; then do<br>
&gt;<br>
&gt; /etc/init.d/net.eth0 stop<br>
&gt; /etc/init.d/net.wlan start<br>
&gt;<br>
&gt; to switch over?<br>
&gt;</p>
<p>ifplugd or netplug.</p>
<p>Rgds,<br>
</p>

--001517440f6664531604adce7db4--