On Tuesday, 28 May 2024 19:02:09 BST Dale wrote:
> Grant Edwards wrote:
> > On 2024-05-28, Dale <rdalek1...@gmail.com> wrote:
> >> Grant Edwards wrote:
> >>> On 2024-05-21, Dale <rdalek1...@gmail.com> wrote:
> >>>>> Here's my udev rules file that defines my network interface names
> >>>>> for the machine I'm on at the moment:
> >>>>> 
> >>>>> ------------------/etc/udev/rules.d/70-my-persistent-net.rules--------
> >>>>> --------------- SUBSYSTEM=="net", ACTION=="add",
> >>>>> ATTR{address}=="2c:f0:5d:6f:10:af", NAME="net0" SUBSYSTEM=="net",
> >>>>> ACTION=="add", ATTR{address}=="00:1b:21:b1:d1:e9", NAME="net1"
> >>>>> ---------------------------------------------------------------------
> >>>>> ---------------->> 
> >> Got a little busy with my garden.  Found my first zucchini yesterday. 
> >> Ready to pick in a few days.  Found some small tomatoes too.  Anyway. 
> >> Did manage to create this rule tho.  This look reasonable?  I'm thinking
> >> it should be named something else tho.  It could clash with the usual
> >> name. 
> >> 
> >> # PCI device 0x11ab:0x4363 (Intel e1000e)
> >> #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
> >> ATTR{address}=="68:05:ca:42:17:39",ATTR{dev_id}=="0x0", ATTR{type}=="1",
> >> KERNEL=="eth*", NAME="enp3s0"
> > 
> > Did my examples (with the MAC addresses and device names changed) not
> > work?
> > 
> >> I got the ATTR address from ifconfig.  I'm not real sure on the other
> >> ATTR variables tho.
> > 
> > I don't use the other other ATTRs, ACTION, DRIVERS, or KERNEL and I
> > don't know why you added them, so I can't comment.
> > 
> > --
> > Grant
> 
> Well, I found one with google and sort of went by that.  Now that I read
> yours again, yours makes more sense, from what little I know.  o_O
> 
> Is ATTR address the same as Mac address?  If so, why not have the same
> names for all tools????  How's this look?

An ATTR can be any of the identifying attributes of your particular NIC.  Take 
a look in /sys/class/net/ to find out the current name of the device, e.g. 
enp4s0, then look at its attributes:

udevadm info -a /sys/class/net/enp4s0/

You can use any attributes which *uniquely* identify the NIC, e.g. vendor/
device ID, MAC address, etc. to avoid misidentification.


> SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="68:05:ca:42:17:39",
> NAME="dale0"
> 
> 
> I gave it a different name this time.  I'm assuming I'd need to reboot to
> test this or is restarting udev enough??

If it is a remote PC and you're using netifrc, you'll need to create a new 
symlink, e.g.:

ln -s /etc/init.d/net.lo /etc/init.d/net.dale0

You probably know you can stop the predictable device naming by adding to your 
kernel command line:

net.ifnames=0

If you only have one wired NIC, then it will pop up as eth0.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to