Re: Is udev necessary for NM plug-in?
- From: Dan Williams <dcbw redhat com>
- To: Mu Qiao <qiaomuf gmail com>
- Cc: networkmanager-list gnome org
- Subject: Re: Is udev necessary for NM plug-in?
- Date: Thu, 22 Apr 2010 08:39:21 -0700
On Thu, 2010-04-22 at 15:04 +0800, Mu Qiao wrote:
> I've made a mistake that I didn't make autoconnect=TRUE for the
> connection. This is why the system configuration was not correctly
> setup:P.
> As a result, I can setup connection totally without udev. So what we
> can benefit from udev? Why does ifupdown use it?
Mainly because the /etc/network/interfaces file describes the network
settings for a particular *interface*, not generic connections that can
be applied to any device. So you have settings for eth0, settings for
wlan0, etc. (apparently these config blocks aren't *necessarily* tied
to a specific interface, but everyone uses them this way)
But the problem (and what NM tries hard to avoid) is that configuration
does not have to be specific to an interface, and you certainly don't
want just one configuration for an interface. If you're at home, eth0
might be using DHCP, but at work it might be static IP.
But since people who use /etc/network/interfaces directly expect that
the block for "eth0" will only apply to eth0. So ifupdown uses udev to
grab the MAC address for eth0, and lock the NMConnection that it makes
out of that /e/n/i block only to eth0. If it didn't do this, then the
NMConnection that it made would apply to *any* ethernet connection,
including a USB dongle you plug in.
Dan
> On Thu, Apr 22, 2010 at 11:12 AM, Mu Qiao <qiaomuf gmail com> wrote:
> > Hi all,
> > I'm writing a plugin for Gentoo.
> >
> > I've read the source code of ifupdown and ifcfg-rh. I find that
> > ifupdown use udev to bind device to connection. The main work it has
> > done during binding is getting the mac address of network interface
> > through udev API and adding it to corresponding connection setting.
> > However, I didn't find the same thing in ifcfg-rh.
> >
> > So I've tried to omit the udev part for my gentoo plugin. After
> > starting NetworkManager, although I can see the connection managed by
> > my plugin via nm-applet, ifconfig command shows that the network isn't
> > correctly setup.
> > Do I need to set mac address for each connection to let them work
> > correctly? Or there are other things that I didn't handle in the right
> > way? I've tried to remove mac address saved in
> > /etc/sysconfig/network-scripts/ifcfg-eth*, but NM still works
> > correctly.
> > --
> > Best wishes,
> > Mu Qiao
> >
>
>
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]