Discussion:
(unknown)
snowyxx
2013-04-26 03:32:34 UTC
Permalink
Hi Boss,
So sorry to mail you in this rude way (if you look into this mail, I kn=
ow is
not support mail, but god guide missing people, right?=A0 )
I am finding a solution to my problem=85.
I have some machines with 8 net interfaces, I want to name one as eth0,=
I
need a solution to work for all machine ( I will clone OS from one to
others), so I could not just modify the rule file under /etc/udev/rules=
=2Ed=A0

I need setup a math condition works for all machine.=20
I want to change=A0 /lib/udev/rules.d/75-persistent-net-generator.rules=
file
to only match MACs
But my problem is that interface names turn out did not ordered by MACs=
,
It suppose=A0 00:0d:48:08:92:9a named as eth0, but not.

Is there any way to let interfaces named by MACs order?=20

***@APM:~# dmesg |grep eth
[=A0=A0 10.429663] e1000e 0000:03:00.0: eth0: (PCI Express:2.5GB/s:Widt=
h x4)
00:0d:48:08:92:9b
[=A0=A0 10.429665] e1000e 0000:03:00.0: eth0: Intel(R) PRO/1000 Network
Connection
[=A0=A0 10.429742] e1000e 0000:03:00.0: eth0: MAC: 0, PHY: 1, PBA No: C=
85839-002
[=A0=A0 12.421678] e1000e 0000:03:00.1: eth1: (PCI Express:2.5GB/s:Widt=
h x4)
00:0d:48:08:92:9a
[=A0=A0 12.421680] e1000e 0000:03:00.1: eth1: Intel(R) PRO/1000 Network
Connection
[=A0=A0 12.421756] e1000e 0000:03:00.1: eth1: MAC: 0, PHY: 1, PBA No: C=
85839-002
[=A0=A0 16.061712] e1000e 0000:04:00.0: eth2: (PCI Express:2.5GB/s:Widt=
h x4)
00:0d:48:08:92:9d
[=A0=A0 16.061714] e1000e 0000:04:00.0: eth2: Intel(R) PRO/1000 Network
Connection
[=A0=A0 16.061791] e1000e 0000:04:00.0: eth2: MAC: 0, PHY: 1, PBA No: C=
85839-002
[=A0=A0 17.041738] e1000e 0000:04:00.1: eth3: (PCI Express:2.5GB/s:Widt=
h x4)
00:0d:48:08:92:9c
[=A0=A0 17.041740] e1000e 0000:04:00.1: eth3: Intel(R) PRO/1000 Network
Connection
[=A0=A0 17.041817] e1000e 0000:04:00.1: eth3: MAC: 0, PHY: 1, PBA No: C=
85839-002
[=A0=A0 17.582614] e1000e 0000:08:00.0: eth4: (PCI Express:2.5GB/s:Widt=
h x1)
00:0d:48:27:86:9d
[=A0=A0 17.582616] e1000e 0000:08:00.0: eth4: Intel(R) PRO/1000 Network
Connection
[=A0=A0 17.582694] e1000e 0000:08:00.0: eth4: MAC: 4, PHY: 8, PBA No: F=
=46FFFF-0FF
[=A0=A0 17.697014] e1000e 0000:07:00.0: eth5: (PCI Express:2.5GB/s:Widt=
h x1)
00:0d:48:27:86:9c
[=A0=A0 17.697016] e1000e 0000:07:00.0: eth5: Intel(R) PRO/1000 Network
Connection
[=A0=A0 17.697094] e1000e 0000:07:00.0: eth5: MAC: 4, PHY: 8, PBA No: F=
=46FFFF-0FF
[ =A0=A017.818793] e1000e 0000:06:00.0: eth6: (PCI Express:2.5GB/s:Widt=
h x1)
00:0d:48:27:86:9b
[=A0=A0 17.818794] e1000e 0000:06:00.0: eth6: Intel(R) PRO/1000 Network
Connection
[=A0=A0 17.818872] e1000e 0000:06:00.0: eth6: MAC: 4, PHY: 8, PBA No: F=
=46FFFF-0FF
[=A0=A0 17.938778] e1000e 0000:05:00.0: eth7: (PCI Express:2.5GB/s:Widt=
h x1)
00:0d:48:27:86:9a
[=A0=A0 17.938780] e1000e 0000:05:00.0: eth7: Intel(R) PRO/1000 Network
Connection
[=A0=A0 17.938859] e1000e 0000:05:00.0: eth7: MAC: 4, PHY: 8, PBA No: F=
=46FFFF-0FF


Yan Xiao








--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug=
" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Tom Gundersen
2013-04-26 07:00:40 UTC
Permalink
I have some machines with 8 net interfaces, I want to name one as eth0, I
need a solution to work for all machine ( I will clone OS from one to
others), so I could not just modify the rule file under /etc/udev/rules.d
You should avoid renaming devices to ethX, this is racy and especially
in recent udev versions it does not work.

You have two options:

1) Rename your devices to something not in the kernel namespace (e.g.,
lan0, lan1, ... or net0, net1, ...).

or

2) Use the predictable interface names, which is the default in recent
versions. This will give you a new set of names (see [0] for details).

HTH,

Tom

[0]: <http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames>
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
snowyxx
2013-04-27 06:48:59 UTC
Permalink
thx

-----Original Message-----
=46rom: Tom Gundersen [mailto:***@jklm.no]=20
Sent: 2013=E5=B9=B44=E6=9C=8826=E6=97=A5 15:01
To: snowyxx
Cc: linux-hotplug
I have some machines with 8 net interfaces, I want to name one as=20
eth0, I need a solution to work for all machine ( I will clone OS fro=
m=20
one to others), so I could not just modify the rule file under=20
/etc/udev/rules.d
You should avoid renaming devices to ethX, this is racy and especially =
in recent udev versions it does not work.

You have two options:

1) Rename your devices to something not in the kernel namespace (e.g., =
lan0, lan1, ... or net0, net1, ...).

or

2) Use the predictable interface names, which is the default in recent =
versions. This will give you a new set of names (see [0] for details).

HTH,

Tom

[0]: <http://www.freedesktop.org/wiki/Software/systemd/PredictableNetwo=
rkInterfaceNames>


--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug=
" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...