FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 07-29-2011, 10:04 PM
Josef Wolf
 
Default How to configure ifplugd?

Hello everybody,

I would like to configure my laptops (Ubuntu-10.10 and 11.04) to automatically
use eth0 when the cable is plugged and to fall back to wlan0 when the cable is
pulled. Ifplugd seems to be a tool just for that. So I tried to go this route.

This is what I have so far:


root@meinekiste:/# cat /etc/network/interfaces
auto lo
iface lo inet loopback

# ifplugd manpage says interfaces should not be brought up automatically
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


root@meinekiste:/# cat /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="my-ssid"
proto=WPA2
group=CCMP
pairwise=CCMP
key_mgmt=WPA-PSK
psk="my-private-key"
}


root@meinekiste:/# cat /etc/default/ifplugd
INTERFACES="eth0 wlan0"
HOTPLUG_INTERFACES=""
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"
ARGS_eth0="-q -f -u0 -d1 -w -I"
root@meinekiste:/#


With this configuration, I can bring up/down eth0 and wlan0 manually with
ifup/ifdown and everything works fine.

Ifplugd brings up/down eth0 when the cable is plugged/pulled. But ifplugd
totally ignores the wlan0 interface, no matter whether I include wlan0
in the INTERFACES variable in /etc/default/ifplugd or not.

/etc/ifplugd/action.d/action_wpa seems to suggest that ifplugd should be able
to manage wireless connections. But here, ifplugd don't touch wlan0 at all.

When I remove "auto wlan0" from /etc/network/interfaces, no communication is
possible when the cable is pulled, since ifplugd fails to "ifup wlan0". When I
do "ifup wlan0" manually, everything works fine.

When I put "auto wlan0" into /etc/network/interfaces, I get double routes like

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 wlan0

and the traffic goes to nirvana somewhere. I need to manually "ifdown wlan0"
in order to get things working again.

Any ideas what am I missing?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-30-2011, 10:10 AM
Brian
 
Default How to configure ifplugd?

On Sat 30 Jul 2011 at 00:04:13 +0200, Josef Wolf wrote:

> This is what I have so far:
>
>
> root@meinekiste:/# cat /etc/network/interfaces
> auto lo
> iface lo inet loopback
>
> # ifplugd manpage says interfaces should not be brought up automatically
> iface eth0 inet dhcp
>
> auto wlan0

allow-hotplug wlan0

> iface wlan0 inet dhcp

iface wlan0 inet manual

> wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Excellent help here:

http://manual.aptosid.com/en/inet-ifplug-en.htm

Note the link at the end of the page.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-30-2011, 02:24 PM
Tom H
 
Default How to configure ifplugd?

On Sat, Jul 30, 2011 at 6:10 AM, Brian <ad44@cityscape.co.uk> wrote:
> On Sat 30 Jul 2011 at 00:04:13 +0200, Josef Wolf wrote:


>> This is what I have so far:
>>
>> * root@meinekiste:/# cat /etc/network/interfaces
>> * auto lo
>> * iface lo inet loopback
>>
>> * # ifplugd manpage says interfaces should not be brought up automatically
>> * iface eth0 inet dhcp
>>
>> * auto wlan0
>
> allow-hotplug wlan0

The aptosid page that you link to below specifically says not to use
"allow-hotplug" for ifplugd to function. It's udev that uses
"allow-hotplug".


>> iface wlan0 inet dhcp
>
> iface wlan0 inet manual
>
>> wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
>
> http://manual.aptosid.com/en/inet-ifplug-en.htm

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-30-2011, 04:06 PM
Brian
 
Default How to configure ifplugd?

On Sat 30 Jul 2011 at 10:24:00 -0400, Tom H wrote:

> The aptosid page that you link to below specifically says not to use
> "allow-hotplug" for ifplugd to function. It's udev that uses
> "allow-hotplug".

What it actually says is:

# governed by ifplugd ... do not use allow-hotplug or auto options

An ifplugd process is only being run for eth0. Please study the second
image on the same page.

"allow-hotplug" relates to the wlan0 interface (which is not being
monitored by an ifplugd process).

Things become a lot clearer on turning over a page by using the link at
the bottom of the referenced page.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-30-2011, 09:22 PM
Tom H
 
Default How to configure ifplugd?

On Sat, Jul 30, 2011 at 12:06 PM, Brian <ad44@cityscape.co.uk> wrote:
> On Sat 30 Jul 2011 at 10:24:00 -0400, Tom H wrote:
>
>> The aptosid page that you link to below specifically says not to use
>> "allow-hotplug" for ifplugd to function. It's udev that uses
>> "allow-hotplug".
>
> What it actually says is:
>
> *# governed by ifplugd ... do not use allow-hotplug or auto options
>
> An ifplugd process is only being run for eth0. Please study the second
> image on the same page.
>
> "allow-hotplug" relates to the wlan0 interface (which is not being
> monitored by an ifplugd process).
>
> Things become a lot clearer on turning over a page by using the link at
> the bottom of the referenced page.

I know what the purpose of "allow-hotplug" is and what's siad on the
aptosid page. It seemed to me that you were advising the OP to add
"allow-hotplug ..." to "/etc/network/interfaces".

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-05-2011, 12:25 PM
Josef Wolf
 
Default How to configure ifplugd?

[sorry for the delayed reply. I was on vacation without internet access ]

On Sat, Jul 30, 2011 at 11:10:02AM +0100, Brian wrote:
> On Sat 30 Jul 2011 at 00:04:13 +0200, Josef Wolf wrote:
>
> > This is what I have so far:
> >
> >
> > root@meinekiste:/# cat /etc/network/interfaces
> > auto lo
> > iface lo inet loopback
> >
> > # ifplugd manpage says interfaces should not be brought up automatically
> > iface eth0 inet dhcp
> >
> > auto wlan0
>
> allow-hotplug wlan0

This doesn't make any difference.

> > iface wlan0 inet dhcp
>
> iface wlan0 inet manual

With this, even "ifup wlan0" fails to bring up wlan. What's the problem with
using DHCP here? With DHCP, at least "ifup wlan0" is able to bring up
wireless.

> > wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
>
> Excellent help here:
>
> http://manual.aptosid.com/en/inet-ifplug-en.htm

When I follow those steps, neither eth0 nor wlan0 is brought up by
ifplugd. IMHO, eth0 should be a static interface and wlan0 should not be
listed at all to avoid it to be managed by a separate ifplugd process.

With my original configuration, at least eth0 came up/down when I
plug/pull the cable.

> Note the link at the end of the page.

Note that wlan already works fine here if I bring it up manually with ifup.


I think I come closer now. There appear to be two problems here:

1. /etc/ifplugd/action.d/action_wpa calls "wpa_action $IFACE check" which in
turn checks whether $WPA_CLI_PIDFILE exists. Since wpa_cli is not run in
daemon mode, the pidfile does not exist and action_wpa silently skips the
management of the wireless interface.

2. If I comment the check described above, wpa_action calls wpa_cli to
disconnect/reconnect wlan0. But this disconnect/reconnect is only on
wpa_supplicant level. When the cable is plugged, the wireless interface
is disconnected on wpa_supplicant level, but ifconfig shows that it is
still UP and "route -n" shows that the routes are also still present.
Therefore, packets are routed to the wireless interface (which is disabled
on wpa_supplicant level) instead of eth0, resulting in dysfunctional
networking.

I think it would be better if /etc/ifplug/action.d/action_wpa would use
ifup/ifdown instead of wpa_cli to activate/deactivate wlan0.

Opinions?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 04:27 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org