[gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
On 2024-05-20, Dale wrote: A 3.0 card is supposed to work fine in a 2.0 slot. > You, or anyone, have any idea why that card would kill my network? > I suspect the card itself is fine. It did see the drive. I just > need the internet to work since it may be used in a NAS rig. Is it causing the network interface to not show up at all in lspci? Is it causing the network device name to change? Or is the network interface still detected, still named the same, and just doesn't send/receive packets? It could be some sort of interrupt sharing problem. Even with PCI express, cards still sometimes have to share interrupts. Intel/IBM made that bad decision 45 years ago, and we're still suffering because of it. If that the problem, sometimes you can avoid it by physically rearranging the cards. The later PCI hosts/boards finally came up with a way to avoid it, but a lot of cards still don't support that. -- Grant
[gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
On 2024-05-21, Dale wrote: > So they both show up. When I try to start the network, it says: > > ERROR: Interface enp3s0 does not exist. Are you sure the network interface name hasn't changed? What does "ifconfig -a" or "ip addr" show? After booting up, what does "dmesg | grep enp" show? > Ensure that you have loaded the correct kernel module for your hardware. > > > I find that odd since it obviously sees the card. It's in the list > above after all. So, it sees the card but can't see it. 0_o Odd. Identifying the presense of a PCI card and creating the device by which is is accessed are two different things. > I tried different slots for the SATA card and they all do the same > thing. Wouldn't each slot have a different interrupt? No. If cards are using legacy interrupts (most do) there are four interrupts (A,B,C,D) that are shared by all cards (just like there always were). Newer cards and motherboards can use something called MSI or MSI-X interrupts that aren't shared, but in my experience the use of those isn't very widespread. > It was at this point, I checked your suggestion. I looked and noticed > that the network card was now at slot 4 not slot 3 like it used to be. > So, I created a new link to slot 4. The network came up. So, > basically, it changed names as you suggested. I thought the purpose of > the enp* names was that they are consistent. They are consistent through reboots. They are not consistent if you change hardware. > Adding or removing cards wouldn't change the names of cards, like > network cards. Yes, it can. > It seems, in this case at least, the names can change. Any way to > make adding the card not change this?? I tend to not have a monitor > or keyboard connected to this rig. If you want consisent network device names (even when you change hardware), you need to either 1. create udev rules that assign device names based on MAC addresses. 2. use a network configuration subsystem that assigns device names and configurations based on MAC addresses. -- Grant
[gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
On 2024-05-21, Dale wrote: >> If you want consisent network device names (even when you change >> hardware), you need to either >> >> 1. create udev rules that assign device names based on MAC addresses. >> >> 2. use a network configuration subsystem that assigns device names >> and configurations based on MAC addresses. > > Do you, or someone else, know of a good howto on how to use MAC > addresses like that? Given this thing is usually remotely accessed, I > really need it to be consistent with or without the card. Maybe you > have a bookmarked link saved somewhere. I'm on openrc to. I'll google > around but you, or someone else here, may have a really good and simple > howto link. The udev way is probably the most universal. Some distros will create udev rules automagically so that network interface names persist over hardware changes, but Gentoo doesn't. 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" - I used to use "ethN" instead of "netN", but those names are used internally by the kernel during startup, and people were warned not to use them in udev rules because of certain race conditions that might happen. I never ran into problems using "ethN" names, but eventually decided not to push my luck. The network configuration route depends on what network configuration (and possibly init) system you use. I know how to do it that way on Ubunutu (which is systemd based) using netplan... -- Grant
[gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
On 2024-05-21, Dale 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" >> - > > Examples do help a lot. I do use the enp* naming scheme. My > understanding, that is the "new" way. The suffix for those enp* names comes from the PCI bus subsystem based on bus number, slot number, etc. [Yes, slot number apparently does change based on what PCIe cards are present. No, that doesn't make sense to me either] > Based on your config, I would need to change the NAME= to enp* names > and that would correct that. I suppose you could, but I would not use enp* names. Those could conflict with the autogenerated names. > Where you have ATTR, is that a quote or did you edit to remove a > number, MAC address, IP or something? What I posted is exactly what's in the file (without the --- delimiters). Here's more documentation: https://wiki.gentoo.org/wiki/Udev https://wiki.archlinux.org/title/udev https://wiki.archlinux.org/title/Network_configuration#Change_interface_name [The arch Wiki is always a good fallback if the Gentoo manual/Wiki don't have what you're looking for.] > If it is one of those, where do I find that info? I checked > ifconfig and didn't see a MAC address. I also checked lspci -v. > I'm not sure where you get the needed info from. BTW, right now, > I'm on my main rig. The only thing you need to change from my example would be the mac address(es) (e.g. 2c:f0:5d:6f:10:af) and the names (e.g. net0). > I have the package net-misc/networkmanager installed. Most likely > pulled in by something else. Could I use it to configure this? Possibly, I don't use networkmanager and don't know how it works on Gentoo. I use the default Gentoo netifrc scheme https://wiki.gentoo.org/wiki/Netifrc. > I also have KDE installed on the NAS box, it is also a backup rig in > case my main rig dies. It may have a GUI that I could use. I'm not > opposed to the command line way tho. Biggest thing, copy and paste > would be nice. I don't know much of anything about KDE. -- Grant
[gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
On 2024-05-28, Dale wrote: > Grant Edwards wrote: >> On 2024-05-21, Dale 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
Re: [gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
Grant Edwards wrote: > On 2024-05-20, Dale wrote: > > A 3.0 card is supposed to work fine in a 2.0 slot. > >> You, or anyone, have any idea why that card would kill my network? >> I suspect the card itself is fine. It did see the drive. I just >> need the internet to work since it may be used in a NAS rig. > Is it causing the network interface to not show up at all in lspci? > > Is it causing the network device name to change? > > Or is the network interface still detected, still named the same, and > just doesn't send/receive packets? > > It could be some sort of interrupt sharing problem. Even with PCI > express, cards still sometimes have to share interrupts. Intel/IBM > made that bad decision 45 years ago, and we're still suffering because > of it. If that the problem, sometimes you can avoid it by physically > rearranging the cards. > > The later PCI hosts/boards finally came up with a way to avoid it, but > a lot of cards still don't support that. > > -- > Grant It does show up in lspci. This is the output of lspci -tv. The SATA card is about 4 down. The network is about 6 down. -[:00]-+-00.0 Advanced Micro Devices, Inc. [AMD/ATI] RX780/RX790 Host Bridge +-02.0-[01]--+-00.0 NVIDIA Corporation GK107 [NVS 510] | \-00.1 NVIDIA Corporation GK107 HDMI Audio Controller +-07.0-[02]00.0 ASMedia Technology Inc. ASM1166 Serial ATA Controller +-09.0-[03]00.0 NEC Corporation uPD720200 USB 3.0 Host Controller +-0a.0-[04]00.0 Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller +-11.0 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] +-12.0 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller +-12.1 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0 USB OHCI1 Controller +-12.2 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller +-13.0 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller +-13.1 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0 USB OHCI1 Controller +-13.2 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller +-14.0 Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller +-14.1 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 IDE Controller +-14.2 Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) +-14.3 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller +-14.4-[05]0e.0 Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link) +-14.5 Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller +-18.0 Advanced Micro Devices, Inc. [AMD] Family 10h Processor HyperTransport Configuration +-18.1 Advanced Micro Devices, Inc. [AMD] Family 10h Processor Address Map +-18.2 Advanced Micro Devices, Inc. [AMD] Family 10h Processor DRAM Controller +-18.3 Advanced Micro Devices, Inc. [AMD] Family 10h Processor Miscellaneous Control \-18.4 Advanced Micro Devices, Inc. [AMD] Family 10h Processor Link Control So they both show up. When I try to start the network, it says: ERROR: Interface enp3s0 does not exist. Ensure that you have loaded the correct kernel module for your hardware. I find that odd since it obviously sees the card. It's in the list above after all. So, it sees the card but can't see it. 0_o Odd. I tried different slots for the SATA card and they all do the same thing. Wouldn't each slot have a different interrupt? It's been ages since I had to deal with any of that. Mostly it was on IDE drives and the master/slave thing. Oh, the other odd thing, it sees drives connected to the SATA card as well. It was at this point, I checked your suggestion. I looked and noticed that the network card was now at slot 4 not slot 3 like it used to be. So, I created a new link to slot 4. The network came up. So, basically, it changed names as you suggested. I thought the purpose of the enp* names was that they are consistent. Adding or removing cards wouldn't change the names of cards, like network cards. It seems, in this case at least, the names can change. Any way to make adding the card not change this?? I tend to not have a monitor or keyboard connected to this rig. This is great tho. I now have one extra SATA card already here. Another that I ordered a couple weeks ago that is still on the way. I also have two more from Amazon on the way. Two 10 port cards, two 8 port ones. That's 36 drives. I think I'm all stocked up on SATA cards now. I need more hard drives, still. According to du, I have 67TBs of data here not including backups. 0_0 We got it all working. It never occurred to me that the slot number would change. Still,
Re: [gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
On Tue, May 21, 2024 at 6:38 AM Dale wrote: > > So, I created a new link to slot 4. The network came up. So, > basically, it changed names as you suggested. I thought the purpose of > the enp* names was that they are consistent. Adding or removing cards > wouldn't change the names of cards, like network cards. Nope, persistent names are only persistent as long as there are no hardware changes. Under the old system if you had 10 NICs on a host, on any reboot some of them could change names, at least in theory. Under the new system if you have 10 NICs on one host and don't touch the hardware, the names will never change. Under the old system if you had 1 NIC in a host, the name would never change even if the hardware did change. Under the new system if you have 1 NIC in a host, the name could change if the hardware changes. It is basically a tradeoff, which makes life much better if you have multiple NICs, and marginally worse if you have only one. However, hardware changes than can cause a name change are probably rare, and if you have only one NIC then ideally your network manager can just use wildcards to not care so much about the name. I usually stick e* in my networkd config for the device name on single-NIC hosts. If you have multiple NICs then I maybe there is a better way to go about it - maybe there is a network manager that can use more data from the NIC itself to track them. -- Rich
Re: [gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
Dale: ... > ERROR: Interface enp3s0 does not exist. > Ensure that you have loaded the correct kernel module for your hardware. ... Do: cat /proc/net/dev Regards, /Karl Hammar
Re: [gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
On Tue, 21 May 2024 06:51:51 -0400, Rich Freeman wrote: > I usually stick e* > in my networkd config for the device name on single-NIC hosts. If you > have multiple NICs then I maybe there is a better way to go about it - > maybe there is a network manager that can use more data from the NIC > itself to track them. systemd .network definitions can match on MAC address, if that helps. -- Neil Bothwick ... "I dropped my toothpaste," Tom said, Crestfallen. pgpGZMKuEyY6P.pgp Description: OpenPGP digital signature
Re: [gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
Grant Edwards wrote: > On 2024-05-21, Dale wrote: > >> So they both show up. When I try to start the network, it says: >> >> ERROR: Interface enp3s0 does not exist. > Are you sure the network interface name hasn't changed? What does > "ifconfig -a" or "ip addr" show? > > After booting up, what does "dmesg | grep enp" show? > >> Ensure that you have loaded the correct kernel module for your hardware. >> >> >> I find that odd since it obviously sees the card. It's in the list >> above after all. So, it sees the card but can't see it. 0_o Odd. > Identifying the presense of a PCI card and creating the device by > which is is accessed are two different things. > >> I tried different slots for the SATA card and they all do the same >> thing. Wouldn't each slot have a different interrupt? > No. If cards are using legacy interrupts (most do) there are four > interrupts (A,B,C,D) that are shared by all cards (just like there > always were). Newer cards and motherboards can use something called > MSI or MSI-X interrupts that aren't shared, but in my experience the > use of those isn't very widespread. > >> It was at this point, I checked your suggestion. I looked and noticed >> that the network card was now at slot 4 not slot 3 like it used to be. >> So, I created a new link to slot 4. The network came up. So, >> basically, it changed names as you suggested. I thought the purpose of >> the enp* names was that they are consistent. > They are consistent through reboots. They are not consistent if you > change hardware. > >> Adding or removing cards wouldn't change the names of cards, like >> network cards. > Yes, it can. > >> It seems, in this case at least, the names can change. Any way to >> make adding the card not change this?? I tend to not have a monitor >> or keyboard connected to this rig. > If you want consisent network device names (even when you change > hardware), you need to either > > 1. create udev rules that assign device names based on MAC addresses. > > 2. use a network configuration subsystem that assigns device names > and configurations based on MAC addresses. > > -- > Grant Do you, or someone else, know of a good howto on how to use MAC addresses like that? Given this thing is usually remotely accessed, I really need it to be consistent with or without the card. Maybe you have a bookmarked link saved somewhere. I'm on openrc to. I'll google around but you, or someone else here, may have a really good and simple howto link. Well, learned something in the past couple days. Thanks. Dale :-) :-)
Re: [gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
Grant Edwards wrote: > On 2024-05-21, Dale wrote: > > >>> If you want consisent network device names (even when you change >>> hardware), you need to either >>> >>> 1. create udev rules that assign device names based on MAC addresses. >>> >>> 2. use a network configuration subsystem that assigns device names >>> and configurations based on MAC addresses. >> Do you, or someone else, know of a good howto on how to use MAC >> addresses like that? Given this thing is usually remotely accessed, I >> really need it to be consistent with or without the card. Maybe you >> have a bookmarked link saved somewhere. I'm on openrc to. I'll google >> around but you, or someone else here, may have a really good and simple >> howto link. > The udev way is probably the most universal. Some distros will create > udev rules automagically so that network interface names persist over > hardware changes, but Gentoo doesn't. 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" > - > > I used to use "ethN" instead of "netN", but those names are used > internally by the kernel during startup, and people were warned not to > use them in udev rules because of certain race conditions that might > happen. I never ran into problems using "ethN" names, but eventually > decided not to push my luck. > > The network configuration route depends on what network configuration > (and possibly init) system you use. I know how to do it that way on > Ubunutu (which is systemd based) using netplan... > > -- > Grant Examples do help a lot. I do use the enp* naming scheme. My understanding, that is the "new" way. Based on your config, I would need to change the NAME= to enp* names and that would correct that. Where you have ATTR, is that a quote or did you edit to remove a number, MAC address, IP or something? If it is one of those, where do I find that info? I checked ifconfig and didn't see a MAC address. I also checked lspci -v. I'm not sure where you get the needed info from. BTW, right now, I'm on my main rig. I have the package net-misc/networkmanager installed. Most likely pulled in by something else. Could I use it to configure this? I also have KDE installed on the NAS box, it is also a backup rig in case my main rig dies. It may have a GUI that I could use. I'm not opposed to the command line way tho. Biggest thing, copy and paste would be nice. ;-) I'm trying to hoe weeds in my garden at the moment. Hoe a little, take a break, then repeat. I did sharpen the edge on my hoe tho. If I touch it, it's cut. Makes it a lot easier. Thanks. Dale :-) :-)
Re: [gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
Grant Edwards wrote: > On 2024-05-21, Dale 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" >>> - >> Examples do help a lot. I do use the enp* naming scheme. My >> understanding, that is the "new" way. > The suffix for those enp* names comes from the PCI bus subsystem based > on bus number, slot number, etc. [Yes, slot number apparently does > change based on what PCIe cards are present. No, that doesn't make > sense to me either] > >> Based on your config, I would need to change the NAME= to enp* names >> and that would correct that. > I suppose you could, but I would not use enp* names. Those could > conflict with the autogenerated names. > >> Where you have ATTR, is that a quote or did you edit to remove a >> number, MAC address, IP or something? > What I posted is exactly what's in the file > (without the --- delimiters). > > Here's more documentation: > > https://wiki.gentoo.org/wiki/Udev > https://wiki.archlinux.org/title/udev > https://wiki.archlinux.org/title/Network_configuration#Change_interface_name > > [The arch Wiki is always a good fallback if the Gentoo manual/Wiki > don't have what you're looking for.] > >> If it is one of those, where do I find that info? I checked >> ifconfig and didn't see a MAC address. I also checked lspci -v. >> I'm not sure where you get the needed info from. BTW, right now, >> I'm on my main rig. > The only thing you need to change from my example would be the mac > address(es) (e.g. 2c:f0:5d:6f:10:af) and the names (e.g. net0). > >> I have the package net-misc/networkmanager installed. Most likely >> pulled in by something else. Could I use it to configure this? > Possibly, I don't use networkmanager and don't know how it works on > Gentoo. I use the default Gentoo netifrc scheme > https://wiki.gentoo.org/wiki/Netifrc. > >> I also have KDE installed on the NAS box, it is also a backup rig in >> case my main rig dies. It may have a GUI that I could use. I'm not >> opposed to the command line way tho. Biggest thing, copy and paste >> would be nice. > I don't know much of anything about KDE. > > -- > Grant 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" I got the ATTR address from ifconfig. I'm not real sure on the other ATTR variables tho. I did this on my main rig. It is commented out at the moment. I'll use it as a guide on the NAS box tho. May enable this on my main rig, just so they all the same. Ironically, I removed the net.enp* from the default runlevel and put dhcpd back. It starts no matter where the card is located with that. It just sees it, starts it and carries on. Still, I'd like all my installs to be done the same way. It's hard enough to remember how to do things. :/ Thanks. Dale :-) :-)
Re: [gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
Grant Edwards wrote: > On 2024-05-28, Dale wrote: >> Grant Edwards wrote: >>> On 2024-05-21, Dale 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? 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?? Dang it's humid outside. I feel like I need diving gear out there so I can breathe. O_O Dale :-) :-)
Re: [gentoo-user] Re: PCIe version 2, 3 etc and how to know which a card is.
On Tuesday, 28 May 2024 19:02:09 BST Dale wrote: > Grant Edwards wrote: > > On 2024-05-28, Dale wrote: > >> Grant Edwards wrote: > >>> On 2024-05-21, Dale 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. signature.asc Description: This is a digitally signed message part.