Hi all, I'm trying to undersand how udev and configuration of network interfaces work together. I read a few articles explaining how udev works, how to define rules, ... but, having a look at for instance a SuSe 9.3 configuration, there are two things that are not clear to me: 1 - I understand that they are udev rules defining the naming convention used to create something like ifcfg-eth-id-00:12:79:d5:9e:25 in /etc/sysconfig/network/ but I don't really understand how this file is "connected" to, for instance, eth0. It was my understanding that rules placed in /etc/udev/rules.d would have made the trick but I had a look there and see nothing related to eth0. Where/how is it define that what you see with an ifconfig corresponds to what is written in ifcfg-eth-id-00:12:79:d5:9e:25? 2 - I was my understanding that the use of udev would have allowed a really "slim" /dev folder but when I look at /dev, I still see the hundred of devices I used to see on kernel 2.4 - based distribution?? I've no problem, just curiosity but any hint/explanation would be appreciated :-) Regards, Gaël
Gaël Lams skrev:
Hi all,
I'm trying to undersand how udev and configuration of network interfaces work together. I read a few articles explaining how udev works, how to define rules, ... but, having a look at for instance a SuSe 9.3 configuration, there are two things that are not clear to me: 1 - I understand that they are udev rules defining the naming convention used to create something like ifcfg-eth-id-00:12:79:d5:9e:25 in /etc/sysconfig/network/ but I don't really understand how this file is "connected" to, for instance, eth0. It was my understanding that rules placed in /etc/udev/rules.d would have made the trick but I had a look there and see nothing related to eth0. Where/how is it define that what you see with an ifconfig corresponds to what is written in ifcfg-eth-id-00:12:79:d5:9e:25?
2 - I was my understanding that the use of udev would have allowed a really "slim" /dev folder but when I look at /dev, I still see the hundred of devices I used to see on kernel 2.4 - based distribution??
I've no problem, just curiosity but any hint/explanation would be appreciated :-)
Hiya! I'm not sure I see what you're looking for, but if it's the naming of the NIC's, it's made in /etc/udev/rules.d/30-net_persistent_names.rules Like in one of my boxes, there's a line: SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:0c:29:54:a6:44", IMPORT="/lib/udev/rename_netiface %k eth0" That in short renames "00:0c:29:54:a6:44" to "eth0" for simple use. -- Anders Norrbring Norrbring Consulting
Hi, First of all, thanks for the reply.
I'm not sure I see what you're looking for, but if it's the naming of the NIC's, it's made in /etc/udev/rules.d/30-net_persistent_names.rules
Like in one of my boxes, there's a line:
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:0c:29:54:a6:44", IMPORT="/lib/udev/rename_netiface %k eth0"
That in short renames "00:0c:29:54:a6:44" to "eth0" for simple use.
In fact I was thinking for something like this but I checked on several of my SuSe Professional 9.3 servers and in /etc/udev/rules.d, what I see is: 20-cdrom.rules 41-usb.rules 45-volume_label.rules 50-udev.rules It's missing the net_persistent_names files so I'm wondering how it works. Actually all this interest is due to a problem I've on VMWare virtual machines where configuring the network interface to use another driver (vmxnet) misses up the configuration, ending with a "no configuration found for eth0". Tha'ts why I decided it was time to understand how the whole stuff works. I discovered that in /sys/class/net/eth0/ there is a link to the corresponding device in /sys/devices and I'm wondering, as there is no persisten_name rule on my SuSe 9.3, how/where this "mapping" between eth0 and, for instance, ifcfg-mac_address, is made. Thanks any help, Gaël
Gaël Lams skrev:
Hi,
First of all, thanks for the reply.
I'm not sure I see what you're looking for, but if it's the naming of the NIC's, it's made in /etc/udev/rules.d/30-net_persistent_names.rules
Like in one of my boxes, there's a line:
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:0c:29:54:a6:44", IMPORT="/lib/udev/rename_netiface %k eth0"
That in short renames "00:0c:29:54:a6:44" to "eth0" for simple use.
In fact I was thinking for something like this but I checked on several of my SuSe Professional 9.3 servers and in /etc/udev/rules.d, what I see is: 20-cdrom.rules 41-usb.rules 45-volume_label.rules 50-udev.rules
It's missing the net_persistent_names files so I'm wondering how it works.
Actually all this interest is due to a problem I've on VMWare virtual machines where configuring the network interface to use another driver (vmxnet) misses up the configuration, ending with a "no configuration found for eth0". Tha'ts why I decided it was time to understand how the whole stuff works.
I discovered that in /sys/class/net/eth0/ there is a link to the corresponding device in /sys/devices and I'm wondering, as there is no persisten_name rule on my SuSe 9.3, how/where this "mapping" between eth0 and, for instance, ifcfg-mac_address, is made.
Aaah.. I missed the 9.3 part.. :) The file I referred to is in v10. Anyway, you can actually rename the file ifcfg-xxxxx to ifcfg-eth0 in your /etc/sysconfig/network directory. I believe I've seen some posts about it on the VMware forums, but unfortunately I can't recall where or what.. But it had some relevance if I'm not mistaken. -- Anders Norrbring Norrbring Consulting
Hi
Aaah.. I missed the 9.3 part.. :) The file I referred to is in v10. Anyway, you can actually rename the file ifcfg-xxxxx to ifcfg-eth0 in your /etc/sysconfig/network directory.
I believe I've seen some posts about it on the VMware forums, but unfortunately I can't recall where or what.. But it had some relevance if I'm not mistaken.
Actually I already tried calling it ifcfg-eth0 and this way the configuration is found and ifconfig gives the "good" answer and when I start /etc/init.d/network the status for eth0 is a "done" but ... I cannot communicate with nothing, the ping gives me network unreachable (and it's not a firewall problem because there is no firewall inbetween). That's why I was trying to understand how the whole hotplud/udev/network stuff was working. Actually I will probably try to add the persistent_name file in rules.d to see whether it works this way. But, even not taking into account my problem with vmware, I'm still curious regarding these two points: - how the ifcfg-xxxxx is "mapped" to eth0 because I still don't understand. I can see that the link from /sys/class/net/eth0/ to ../../../devices/pci0000:00/0000:00:11.0 is missing, but I don't understand what makes this link being created - why there are still all the devices defined in /dev if, wiith udeh/hotplug, ony the existing devices should be created Kind regards, Gaël
Gaël Lams skrev:
Hi
Aaah.. I missed the 9.3 part.. :) The file I referred to is in v10. Anyway, you can actually rename the file ifcfg-xxxxx to ifcfg-eth0 in your /etc/sysconfig/network directory.
I believe I've seen some posts about it on the VMware forums, but unfortunately I can't recall where or what.. But it had some relevance if I'm not mistaken.
Actually I already tried calling it ifcfg-eth0 and this way the configuration is found and ifconfig gives the "good" answer and when I start /etc/init.d/network the status for eth0 is a "done" but ... I cannot communicate with nothing, the ping gives me network unreachable (and it's not a firewall problem because there is no firewall inbetween).
That's why I was trying to understand how the whole hotplud/udev/network stuff was working. Actually I will probably try to add the persistent_name file in rules.d to see whether it works this way.
But, even not taking into account my problem with vmware, I'm still curious regarding these two points: - how the ifcfg-xxxxx is "mapped" to eth0 because I still don't understand. I can see that the link from /sys/class/net/eth0/ to ../../../devices/pci0000:00/0000:00:11.0 is missing, but I don't understand what makes this link being created - why there are still all the devices defined in /dev if, wiith udeh/hotplug, ony the existing devices should be created
Well, there are some interesting reading in /usr/share/doc/packages/udev and /usr/share/doc/packages/sysconfig In the latter one (on my 10.0) there's even a README.Persistent_Interface_Names which possibly can help you.. :) Unfortunately I don't have any 9.3 available at this point, even all my virtual machines are upgraded to either 10.0 or 10.1.. And frankly, I don't remember exactly how it was done in 9.3.. Maybe somebody else can shed some light on it if you don't find anything useful in the docs files. -- Anders Norrbring Norrbring Consulting
participants (2)
-
Anders Norrbring
-
Gaël Lams