[Cialug] How is this possible?

Zachary Kotlarek zach at kotlarek.com
Mon Apr 3 14:03:26 CDT 2017


On 3 Apr 2017, at 10:44, Tom Sellers wrote:

> I tried removing the added 3com card and booting with a cd version and it
> sees the built in adapter as eth0 with 00.0c.76.be.b9.a9 as correct.  I
> don't seem to be able to make it boot up with both adapters installed
> without the adapters being reversed as shown in the ifconfig above.


First I want to note that any NIC can have *any* number of IP addresses attached, including 0. While not the most common configuration it’s entirely possible to have more than one address assigned to a single interface; for example, you might have two logical networks — one with routable IPs and one with link-local IPs — on the same wire. You can also assign the same IP address to any number of NICs; you can have more than one physical wire comping into a box that you want to treat as the same logical network.

But I don’t think any of that is what’s happening here. I think you’re just not getting interfaces enumerated in the order you expect.

In general the order of NICs is not guaranteed to be deterministic by the kernel. Frequently they’ll come up in the same order because they’re scanned the same way at each boot, but that’s not guarantee the kernel makes. Even if it could make that guarantee names would still change every time you added or removed a NIC.

Which is why udev provides a way to explicitly assign stable names to devices. Many distros automatically create udev configuration to ensure that NICs come up with the same name at every boot even if you make other changes to the system, and when that happened the device your system is calling eth0 was enumerated first, for whatever reason. Now it’s “stuck” that way because udev forces the name on every boot; it doesn’t happen when you boot from other disks because those disks don’t include the udev config.

So there are two options, and you can do either or both:
1. Edit your udev config to assign the names you prefer
2. Edit your other config to use the names as assigned

Also note that there’s no inherent meaning to any of the names, and you aren’t limited to calling them “ethX”. For example,  I have the interfaces with names like “uplink” using udev config like this:
	KERNEL=="eth*", ATTR{address}=="01:23:45:67:89:ab”, NAME="uplink"
Which I find useful because I don’t have to remember what eth4 does. The location of the udev rules file for NICs is distro-specific; mine is in /etc/udev/rules.d/00-local-rules.conf

	Zach
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2483 bytes
Desc: S/MIME digital signature
URL: <http://cialug.org/pipermail/cialug/attachments/20170403/32887e76/attachment.bin>


More information about the Cialug mailing list