RE: how to suppress write_net_rules (prevent alteration of my net rules)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks everyone for the quick response.    Useful education for me but, as far as I can tell,
neither of those approaches quite achieves what I'm looking for.

I should explain a bit more about my root-over-nfs setup.    To simplify,  I have two computers,   C1 and C2,
and each machine has two ethernet NICs with MAC addresses   M1a,  M1b,   and M2a , M2b  respectively.
C1  has M1a and M1b

C2  has M2a and M2b

On each machine there is a linux installation which might run on either machine,
either locally or by mounting root over nfs from the other.

I would ideally like a single content for each of my systems' 60-net.rules,  naming all 4 NICs,
and assigning a unique eth[n] name to each one but *only* if the kernel did not already name it eth0
(which is what the kernel does if told to configure a network interface itself for nfs-mount purposes)
In other words,  I want all 4 interfaces to have a consistent name except when in use for mounting root over nfs.

So I would have content looking like


# mobo 8168
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="[M1a]", ... KERNEL!="eth0", NAME="eth1"

# PCI via-rhine
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="[M1b]", ... KERNEL!="eth0", NAME="eth2"

# mobo yukon2
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="[M2a]",  ... KERNEL!="eth0", NAME="eth3"

#  e1000
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="[M2b]",  ... KERNEL!="eth0", NAME="eth4"

And that's what I've done and,  in the absence of write_net_rules ,  it works.

Now  if I may ask questions about your specific suggestions:

Kay Sievers wrote:
> 
> Rules in /etc over-rule rules in /lib with the same name.
> 
> echo "# disable net-generator rules in /lib/udev" > \
>   /etc/udev/rules.d/75-persistent-net-generator.rules
>
That looks perfect  -  except  ...    I already have a  /etc/udev/rules.d/75-persistent-net-generator.rules
and at the top it says:
# do not edit this file, it will be overwritten on update

Is that true?     If so  -  although I can see this would work,   I'm no better off than editing the /lib/udev/write_net_rules am I?

Andrey Borzenkov  wrote:
>
> /lib/udev/rules.d/75-persistent-net-generator.rules should not call
> write_net_rules if NAME is already set, so
>
> KERNEL=="eth0", NAME="eth0"
>

I think I see how this would prevent the renaming but how can I achieve the renaming I *do* want?
It seems to me that adding KERNEL=="eth0", NAME="eth0" would prevent udev from doing anything when
KERNEL!="eth0",  wouldn't it?   I didn't try it but that's my reading of the man page  -
there is no syntax for parenthesising conditions e.g.

( KERNEL=="eth0", NAME="eth0" ) || (  KERNEL!="eth0", NAME="eth1" )
is there?

I have one more question  -   is there any master user-specified profile or config file associated with udev?
Something which orchestrates all the other parts?


Cheers,   John

>
> --
> ciao,
> Marco
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
 		 	   		  --
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux