# Interfaz MAC order

**URL:** <https://forums.rockylinux.org/t/interfaz-mac-order/13419>\
**Category:** Rocky Linux Help & Support\
**Created:** [April 2, 2024, 12:16pm UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419 "2024-04-02T12:16:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominTxomin](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/domintxomin/32/2727_2.png) [@dominTxomin](https://forums.rockylinux.org/u/dominTxomin)\
**Post date:** [April 2, 2024, 12:16pm UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419/1 "2024-04-02T12:16:41Z")

</div>

Good afternoon  
The ROCKY LINUX operating system recognizes my network interfaces but it recognizes them in this order:  
eth0: 00:00:00:00:aa:20  
eth1: 00:00:00:00:aa:21  
eth2: 00:00:00:00:aa:22

And I want it to be this:  
eth0: 00:00:00:00:aa:22  
eth1: 00:00:00:00:aa:21  
eth2: 00:00:00:00:aa:20

I can’t get it to work. I have tried to generate the file /etc/udev/rules.d/70-persistent-net.rules:  
SUBSYSTEM==“net”, ACTION==“add”, DRIVERS==“?_“, ATTR{address}==“00:00:00:00:aa:22”, NAME=“eth0”  
SUBSYSTEM==“net”, ACTION==“add”, DRIVERS==”?_”, ATTR{address}==“00:00:00:00:aa:21”, NAME=“eth1”  
SUBSYSTEM==“net”, ACTION==“add”, DRIVERS==“?\*”, ATTR{address}==“00:00:00:00:aa:20”, NAME=“eth2”  
I have modified the files: /etc/sysconfig/network-scripts/ifcfg-eth0, ifcfg-eth1 and ifcfg-eth2 putting HWADDR with the MAC

And nothing, there is no way. Any suggestions?  
Thank you

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [April 2, 2024, 12:18pm UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419/2 "2024-04-02T12:18:33Z")

</div>

> [@dominTxomin](#):
>
> I want it to be this

Why? Why does it matter what the names are?

---

<div class="post-metadata">

**Author:** ![dominTxomin](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/domintxomin/32/2727_2.png) [@dominTxomin](https://forums.rockylinux.org/u/dominTxomin)\
**Post date:** [April 2, 2024, 12:26pm UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419/3 "2024-04-02T12:26:36Z")

</div>

eth0 is on the motherboard and eth1 and eth2 go on an additional pci with two interfaces.

I want to control the order so that eth0 is always the one on the motherboard whether the additional PCI is plugged in or not.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [April 2, 2024, 12:47pm UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419/4 "2024-04-02T12:47:43Z")

</div>

EL8 and EL9 should use persistent names by default. That is not names like “eth0”. [https://access.redhat.com/documentation/en-us/red\_hat\_enterprise\_linux/9/html/configuring\_and\_managing\_networking/consistent-network-interface-device-naming\_configuring-and-managing-networking](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/consistent-network-interface-device-naming_configuring-and-managing-networking)

> [@dominTxomin](#):
>
> I have modified the files: /etc/sysconfig/network-scripts/ifcfg-eth0, ifcfg-eth1 and ifcfg-eth2 putting HWADDR with the MAC
> 
> And nothing, there is no way.

The EL9 does not use `/etc/sysconfig/network-scripts/ifcfg-*`, so I presume that you have Rocky 8. Docs might differ form EL9: [Chapter&nbsp;1.&nbsp;Implementing consistent network interface naming Red Hat Enterprise Linux 8 | Red Hat Customer Portal](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/consistent-network-interface-device-naming_configuring-and-managing-networking#doc-wrapper)  
I have not seriously looked at ifcfg-files in years (since ~EL7.3); I do use NetworkManager to do the config.

On initial install the Anaconda installer generates connections for each interface – at least on some conditions. The installer adds `802-3-ethernet.mac-address`, but does not set `connection.interface-name` for a connection. That connection is bound to interface with that MAC, regardless of the name.

If one adds connection manually with `nmcli con add`, then one must supply `ifname`. It is possible to later add `802-3-ethernet.mac-address` and remove the `connection.interface-name` with `nmcli con mod`.

When system boots and NetworkManager activates connections, it does pass the current name of interface to FirewallD (along with value of `connection.zone`) and FirewallD uses that name when creating rules.

* * *

Therefore, (1) names are not important for the NetworkManager+FirewallD setup, and (2) the name of the interface on the motherboard should persist, stay same, whether addon card is there or not.

Why does you system get those `eth[012]` names to begin with?  
Is there some other configuration that desperately depends on names?

---

<div class="post-metadata">

**Author:** ![dominTxomin](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/domintxomin/32/2727_2.png) [@dominTxomin](https://forums.rockylinux.org/u/dominTxomin)\
**Post date:** [April 3, 2024, 2:30pm UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419/5 "2024-04-03T14:30:59Z")

</div>

Hello thank you very much.  
I have explained myself poorly. My problem is not the names but the order of the interfaces.  
I have Rocky 8. I have a shared application with old versions of CentOS and that’s why I stick with eth0, eth1, etc. But that, the name of the interfaces seems fine to me and I have no problem with that.

I explain again what I have and what I want to achieve:

- I have computers with only the two network interfaces on the motherboard and I have other computers to which a PCI with 2 additional network interfaces is added.

What happens to me on my RL8:

- Devices only with the two network interfaces on the motherboard:  
eth0 and eth1 (Ok, correct)
- Equipment with both motherboard + additional PCI network card:  
eth0, eth1, eth2 and eth3 (eth0 and eth1 are those of the additional PCI and eth2 and eth3 are those of the motherboard)
- What I want is that the motherboard interfaces are always the first (eth0 and eth1) and the rest (if they exist) are eth2, eth3

In the old versions (I am talking about CentOS 6 and 7) it worked for me by generating the file /etc/udev/rules.d/70-persistent-net.rules. In that file I related the MAC to the name of the interface (eth0, eth1, etc) but now in Rocky Linux 8.7 this has not worked for me (I’m also missing something else).

I don’t know how to do it in RL8. Anyway, I’m going to read what you gave me in case it helps me.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [April 3, 2024, 2:53pm UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419/6 "2024-04-03T14:53:22Z")

</div>

> [@dominTxomin](#):
>
> My problem is not the names but the order of the interfaces.

I disagree with that description. You don’t actually care about the “order” as long as that one interface on the motherboard _always gets the same name_ – “eth0”. Persistently.

> [@dominTxomin](#):
>
> I have a shared application with old versions of CentOS and that’s why I stick with eth0

In other words, you do have an application for which you have to tell the name of interface. (Or worse yet, one that is hardcoded with name “eth0”.) That might add requirement that the name has to be not only persistent, but “eth0” too. Unfortunately.

* * *

The old eth_N_ styles have _never_ been officially persistent. I had CentOS 7 (VM), where names “eth0” and “eth1” did swap interfaces on _every_ boot. That is when I started to bind NM connections with MAC.

Looking at my system:

```auto
dmesg | grep eth0
[1.776101] e1000e 0000:00:1f.6 eth0: (PCI Express:2.5GT/s:Width x1) 10:..:42
[1.776104] e1000e 0000:00:1f.6 eth0: Intel(R) PRO/1000 Network Connection
[1.776197] e1000e 0000:00:1f.6 eth0: MAC: 13, PHY: 12, PBA No: FFFFFF-0FF
[1.777186] e1000e 0000:00:1f.6 eno1: renamed from eth0

```

The device `eno1` had initially name `eth0`.

You want to rename some interface to `eth0`. At that moment there is probably some other interface with name `eth0`, which probably creates name conflict that leads to failure?

---

<div class="post-metadata">

**Author:** ![dominTxomin](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/domintxomin/32/2727_2.png) [@dominTxomin](https://forums.rockylinux.org/u/dominTxomin)\
**Post date:** [April 15, 2024, 9:52am UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419/7 "2024-04-15T09:52:57Z")

</div>

Hello. I see the ethx interfaces correctly

→ ifconfig  
eth0: flags=4099\<UP,BROADCAST,MULTICAST\> mtu 1500  
ether 00:00:00:00:aa:20 txqueuelen 1000 (Ethernet)  
RX packets 0 bytes 0 (0.0 B)  
RX errors 0 dropped 0 overruns 0 frame 0  
TX packets 0 bytes 0 (0.0 B)  
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0  
device interrupt 16

eth1: flags=4099\<UP,BROADCAST,MULTICAST\> mtu 1500  
ether 00:00:00:00:aa:21 txqueuelen 1000 (Ethernet)  
RX packets 0 bytes 0 (0.0 B)  
RX errors 0 dropped 0 overruns 0 frame 0  
TX packets 0 bytes 0 (0.0 B)  
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0  
device interrupt 17

eth2: flags=4099\<UP,BROADCAST,MULTICAST\> mtu 1500  
ether 00:00:00:00:aa:22 txqueuelen 1000 (Ethernet)  
RX packets 0 bytes 0 (0.0 B)  
RX errors 0 dropped 0 overruns 0 frame 0  
TX packets 0 bytes 0 (0.0 B)  
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0  
device interrupt 16

What I want to do in Rocky Linux 8.7 is make eth2 be eth0 and eth0 be eth2

I have configured this:

cat ifcfg-eth0  
TYPE=Ethernet  
PROXY\_METHOD=none  
BROWSER\_ONLY=no  
DEFROUTE=yes  
IPV4\_FAILURE\_FATAL=no  
IPV6INIT=no  
IPV6\_AUTOCONF=yes  
IPV6\_DEFROUTE=yes  
IPV6\_FAILURE\_FATAL=no  
IPV6\_ADDR\_GEN\_MODE=eui64  
NAME=eth0  
DEVICE=eth0  
ONBOOT=no  
BOOTPROTO=static  
MACADDR=00:00:00:00:aa:22

cat ifcfg-eth2  
TYPE=Ethernet  
PROXY\_METHOD=none  
BROWSER\_ONLY=no  
DEFROUTE=yes  
IPV4\_FAILURE\_FATAL=no  
IPV6INIT=no  
IPV6\_AUTOCONF=yes  
IPV6\_DEFROUTE=yes  
IPV6\_FAILURE\_FATAL=no  
IPV6\_ADDR\_GEN\_MODE=eui64  
NAME=eth2  
DEVICE=eth2  
ONBOOT=no  
BOOTPROTO=static  
MACADDR=00:00:00:00:aa:20

I can’t change the order

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [April 15, 2024, 11:25am UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419/8 "2024-04-15T11:25:49Z")

</div>

> [@dominTxomin](#):
>
> What I want to do in Rocky Linux 8.7 is make eth2 be eth0 and eth0 be eth2

Lets presume that the system starts with `eth0 eth1 eth2`

Now, some system – be it udev, systemd, initscripts, or whatever –  
has a rule: _Rename eth0 eth2_  
That must fail, because you can’t create `eth2` while there is already another `eth2`.

_If_ there were two orders:  
_Rename eth0 mythird_  
_Rename eth2 eth0_  
and _if_ they were used in that _order_, then there would not be name conflicts.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [June 14, 2024, 11:26am UTC](https://forums.rockylinux.org/t/interfaz-mac-order/13419/9 "2024-06-14T11:26:31Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
