On Sep 26, 2011 6:37 AM, "Mark Knecht" <markkne...@gmail.com> wrote:
>
> On Sun, Sep 25, 2011 at 1:59 PM, Florian Philipp <li...@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,

Reply via email to