Hi All,
I've noticed that in RHEL 6.1, setting mac addresses in Cobbler (and, thus, in /etc/sysconfig/network-scripts/ifcfg-* -> HWADDR) sometimes results in interfaces being renamed. In /etc/udev/rules.d/70-persistent-net.rules, I end up with:
# PCI device 0x8086:0x105e (e1000e) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:4a:2e:91", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x105e (e1000e) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:4a:2e:90", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x14e4:0x164c (bnx2) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:11:a1:60", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x14e4:0x164c (bnx2) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:11:a1:62", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x8086:0x105e (e1000e) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:4a:2e:91", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x14e4:0x164c (bnx2) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:11:a1:62", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x14e4:0x164c (bnx2) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:11:a1:60", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x105e (e1000e) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:4a:2e:90", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
The above is the result of specifying the 4 MAC addresses in Cobbler for eth0/1/2/3. It ended up renaming eth0 to rename4 and eth1 to rename5!? By removing the first 4 entries out of 70-persistent-net.rules, it brought up eth0/1/2/3 correctly.
Any suggestions on how to manage consistent naming of NICs on RHEL 6?
Thanks in advance. Gonzalo
Hi Gonzalo,
Maybe this can help writing your udev rule based on the pci bus numbering:
lspci | grep Eth | awk '{print "KERNEL=="eth*", ID=="0000:"$1"", NAME="eth"count++"""}' >> /etc/udev/rules.d/70-persistent-net.rules
cheers peter
On 02/07/2012 08:42 AM, Gonzalo Servat wrote:
Hi All,
I've noticed that in RHEL 6.1, setting mac addresses in Cobbler (and, thus, in /etc/sysconfig/network-scripts/ifcfg-* -> HWADDR) sometimes results in interfaces being renamed. In /etc/udev/rules.d/70-persistent-net.rules, I end up with:
# PCI device 0x8086:0x105e (e1000e) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:4a:2e:91", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x105e (e1000e) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:4a:2e:90", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x14e4:0x164c (bnx2) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:11:a1:60", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x14e4:0x164c (bnx2) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:11:a1:62", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x8086:0x105e (e1000e) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:4a:2e:91", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x14e4:0x164c (bnx2) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:11:a1:62", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x14e4:0x164c (bnx2) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:64:11:a1:60", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x105e (e1000e) (custom name provided by external tool) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:4a:2e:90", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
The above is the result of specifying the 4 MAC addresses in Cobbler for eth0/1/2/3. It ended up renaming eth0 to rename4 and eth1 to rename5!? By removing the first 4 entries out of 70-persistent-net.rules, it brought up eth0/1/2/3 correctly.
Any suggestions on how to manage consistent naming of NICs on RHEL 6?
Thanks in advance. Gonzalo
cobbler mailing list cobbler@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler
On Tue, Feb 7, 2012 at 7:27 PM, Peter Mumenthaler mumenthaler@puzzle.chwrote:
Hi Gonzalo,
Maybe this can help writing your udev rule based on the pci bus numbering:
lspci | grep Eth | awk '{print "KERNEL=="eth*", ID=="0000:"$1"", NAME="eth"count++"""}' >> /etc/udev/rules.d/70-persistent-net.rules
Hi Peter,
Thanks for your reply. Are you suggesting I just append more interfaces to the file? Shouldn't I either write it to a new file or overwrite the existing one? I'm not sure when /lib/udev/write_net_rules gets triggered and rewrites 70-persistent-net.rules.
- Gonzalo
I'm just hitting this one now. The culprit: http://fedoraproject.org/wiki/Features/ConsistentNetworkDeviceNaming http://domsch.com/blog/?p=455 To reverse it: http://www.arachnoid.com/linux/network_names/index.html
Going forward, it's probably best to "go with the flow". To get it working right now, I've just excluded the 'post_install_network_config' snippet and doogled the 'network_config' & 'pre_install_network_config' snippets (mine were custom already; n/s if the doogling is necessary with the stock scripts). The whole Cobbler eth-renaming thing isn't necessary anymore with the "new way", so RHEL6-stly network snippets can be simplified considerably.
From: cobbler-bounces@lists.fedorahosted.org [mailto:cobbler-bounces@lists.fedorahosted.org] On Behalf Of Gonzalo Servat Sent: Tuesday, February 07, 2012 3:39 AM To: mumenthaler@puzzle.ch; cobbler mailing list Subject: Re: [cobbler] NIC naming in RHEL 6.x
On Tue, Feb 7, 2012 at 7:27 PM, Peter Mumenthaler <mumenthaler@puzzle.chmailto:mumenthaler@puzzle.ch> wrote: Hi Gonzalo,
Maybe this can help writing your udev rule based on the pci bus numbering:
lspci | grep Eth | awk '{print "KERNEL=="eth*", ID=="0000:"$1"", NAME="eth"count++"""}' >> /etc/udev/rules.d/70-persistent-net.rules
Hi Peter,
Thanks for your reply. Are you suggesting I just append more interfaces to the file? Shouldn't I either write it to a new file or overwrite the existing one? I'm not sure when /lib/udev/write_net_rules gets triggered and rewrites 70-persistent-net.rules.
- Gonzalo
******************************************************* This message (including any files transmitted with it) may contain confidential and/or proprietary information, is the property of Interactive Data Corporation and/or its subsidiaries, and is directed only to the addressee(s). If you are not the designated recipient or have reason to believe you received this message in error, please delete this message from your system and notify the sender immediately. An unintended recipient's disclosure, copying, distribution, or use of this message or any attachments is prohibited and may be unlawful. *******************************************************
cobbler@lists.fedorahosted.org