Prev: Capturing a signal from a composite video socket
Next: NYC LOCAL: Tuesday 11 May 2010 Lisp NYC Meet and NYLUG Hack Meet
From: Rahul on 12 May 2010 11:34 marrgol <marspamrgol(a)gspammail.com> wrote in news:4bea0d1f$0$2587 $65785112(a)news.neostrada.pl: > kudzu does when detecting new hardware. > > OK, I've found it interesting so I played with this today a little > and here's what had worked for me: > Thanks very much marrgol! What happens is that it seems to try bringing up an interface called eth0_rename. eth0_rename Link encap:Ethernet HWaddr 00:07:43:06:88:45 inet6 addr: fe80::207:43ff:fe06:8845/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:2840 (2.7 KiB) Interrupt:66 Memory:dc7fe000-dc7fefff eth1 Link encap:Ethernet HWaddr 00:26:B9:58:E5:9D inet addr:10.0.0.12 Bcast:10.0.255.255 Mask:255.255.0.0 inet6 addr: fe80::226:b9ff:fe58:e59d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1616 errors:0 dropped:0 overruns:0 frame:0 TX packets:253 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:933862 (911.9 KiB) TX bytes:41189 (40.2 KiB) Interrupt:146 Memory:d8000000-d8012800 Any idea what this is? cat /etc/udev/rules.d/59-my.net.rules KERNEL=="eth*", ACTION=="add", SYSFS{address}=="00:26:B9:58:E5:9D", NAME="eth1" KERNEL=="eth*", ACTION=="add", SYSFS{address}=="00:07:43:06:88:45", NAME="eth2" What's strange is that the entries I had deleted from hwconf seem to always come back abter a reboot. Here's the new ifcfg- files that were generated too, if that helps: cat /etc/sysconfig/network-scripts/ifcfg-eth0_rename # Chelsio Communications Inc Unknown device 0035 DEVICE=eth0_rename BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:07:43:06:88:45 [root(a)eu012 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 # Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet DEVICE=eth1 BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:26:b9:58:e5:9d [root(a)eu012 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2 # Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet DEVICE=eth2 BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:26:b9:58:e5:9e -- Rahul
From: marrgol on 12 May 2010 14:12 On 2010-05-12 17:34, Rahul wrote: > What happens is that it seems to try bringing up an interface called > eth0_rename. > > > eth0_rename Link encap:Ethernet HWaddr 00:07:43:06:88:45 > inet6 addr: fe80::207:43ff:fe06:8845/64 Scope:Link > > eth1 Link encap:Ethernet HWaddr 00:26:B9:58:E5:9D > inet addr:10.0.0.12 Bcast:10.0.255.255 Mask:255.255.0.0 > inet6 addr: fe80::226:b9ff:fe58:e59d/64 Scope:Link > > Any idea what this is? Not really, but if you happen to still have, after all those experiments, the file /etc/udev/rules.d/70-persistent.net.rules look for an entry corresponding to eth0 in it and remove it. And you seem to have more than two NICs, maybe you should take into account all of them? > cat /etc/udev/rules.d/59-my.net.rules > KERNEL=="eth*", ACTION=="add", SYSFS{address}=="00:26:B9:58:E5:9D", > NAME="eth1" > KERNEL=="eth*", ACTION=="add", SYSFS{address}=="00:07:43:06:88:45", > NAME="eth2" I think in CentOS this is only effective for unconfigured interfaces. Once configured, i.e. when they already have corresponding /etc/sysconfig/network-scripts/ifcfg-* files, they can be renamed by changing the filename ifcfg-$NAME and the DEVICE=$NAME line inside of it - udev and network scripts in CentOS have this feature available out of the box: ~ # cat /etc/udev/rules.d/60-net.rules ACTION=="add", SUBSYSTEM=="net", IMPORT{program}="/lib/udev/rename_device" SUBSYSTEM=="net", RUN+="/etc/sysconfig/network-scripts/net.hotplug" I'm pretty sure the first line does the interface renaming based on ifcfg-$NAME / DEVICE=$NAME related to NIC's MAC address, and the second brings the interface up. Instead of doing the manual rename, you can run system-config-network to do that. > What's strange is that the entries I had deleted from hwconf seem to > always come back abter a reboot. That's normal with kudzu enabled. kudzu keeps information about the hardware it knows in it. If you plug in something new kudzu can see it's not there and that's how it knows it must be configured. (Unfortunately) for network interfaces kudzu also checks if there are /etc/sysconfig/network-scripts/ifcfg-* files present - this is why you have to remove both the file and the corresponding entry from hwconf to force re-detection and re-configuration of a network interface. -- mrg
From: Pascal Hambourg on 12 May 2010 14:15 Rahul a �crit : > > What happens is that it seems to try bringing up an interface called > eth0_rename. > > eth0_rename Link encap:Ethernet HWaddr 00:07:43:06:88:45 [...] > Any idea what this is? ethX_rename is a temporary name assigned by udev in the process of renaming an interface (in case multiple interface names have to be swapped). > cat /etc/udev/rules.d/59-my.net.rules > KERNEL=="eth*", ACTION=="add", SYSFS{address}=="00:26:B9:58:E5:9D", > NAME="eth1" > KERNEL=="eth*", ACTION=="add", SYSFS{address}=="00:07:43:06:88:45", > NAME="eth2" Looks like the interface should have been renamed as eth2 by the second udev rule but something went wrong during the process. I have seen it happen, but never found out why. > What's strange is that the entries I had deleted from hwconf seem to > always come back abter a reboot. udev and the hotplug stuff will recreate the entry at the next boot. > Here's the new ifcfg- files that were generated too, if that helps: > > cat /etc/sysconfig/network-scripts/ifcfg-eth0_rename > # Chelsio Communications Inc Unknown device 0035 > DEVICE=eth0_rename > BOOTPROTO=dhcp > ONBOOT=yes > HWADDR=00:07:43:06:88:45 > [root(a)eu012 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 > # Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet > DEVICE=eth1 > BOOTPROTO=dhcp > ONBOOT=yes > HWADDR=00:26:b9:58:e5:9d > [root(a)eu012 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2 > # Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet > DEVICE=eth2 > BOOTPROTO=dhcp > ONBOOT=yes > HWADDR=00:26:b9:58:e5:9e Hmm, here eth2 is associated to a different hardware interface and MAC address.
From: Rahul on 12 May 2010 17:16 marrgol <marspamrgol(a)gspammail.com> wrote in news:4beaef87$0$2598$65785112 @news.neostrada.pl: > And you seem to have more than two NICs, maybe you should > take into account all of them? > There's two on board 1 Gi NICs ( 00:26:*) but I only use one of these. -- Rahul
From: Rahul on 12 May 2010 18:05
marrgol <marspamrgol(a)gspammail.com> wrote in news:4beaef87$0$2598$65785112(a)news.neostrada.pl: > Not really, but if you happen to still have, after all those > experiments, the file /etc/udev/rules.d/70-persistent.net.rules > Nope. No such file. All I have is: 05-udev-early.rules 50-udev.rules 60-net.rules 60-raw.rules 90-dm.rules 90-ib.rules bluetooth.rules 40-multipath.rules 51-hotplug.rules 60-pcmcia.rules 85-pcscd_ccid.rules 90-hal.rules 95-pam-console.rules > I'm pretty sure the first line does the interface renaming based on > ifcfg-$NAME / DEVICE=$NAME related to NIC's MAC address, and the second > brings the interface up. > > Instead of doing the manual rename, you can run system-config-network > to do that. > The problem is that system-config-network is a GUI. I have a bunch (100+) of machines that automatically install themselves via net-PXE. So a command line automatable solution is my only option. :( -- Rahul |