Custom netcard name in 70-persistent-ipoib.rules in random moment is not works

Issues related to configuring your network
Post Reply
Wohlstand
Posts: 3
Joined: 2017/04/11 09:55:07

Custom netcard name in 70-persistent-ipoib.rules in random moment is not works

Post by Wohlstand » 2017/04/11 10:08:25

Hello!
I have some weird thing:

I have the network card with mac address 98:de:d0:XX:YY:ZZ and name "eth1" (I have disabled enp*s* naming to have name network cards as I want).
I have the entry in the /etc/udev/rules.d/70-persistent-ipoib.rules file:

Code: Select all

ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="1", ATTR{dev_id}=="0x0", ATTR{address}=="98:de:d0:XX:YY:ZZ", KERNEL=="eth*", NAME="ethwan"
and it worked.

At same time in the /etc/sysconfig/network-scripts/ifcfg-ethwan file I have next config which also customizes mac address:

Code: Select all

TYPE=Ethernet
BOOTPROTO=dhcp
NM_CONTROLLED=no
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
MACADDR="00:80:48:24:1b:16"
NAME=ethwan
UUID=1d7eb423-3431-4f6f-894c-5583ee08f388
DEVICE=ethwan
ONBOOT=yes
What trouble I have?

After some reboot, the ethwan dissappears and appears the eth1 which is getting "00:80:48:24:1b:16" mac address!!! :shock:
And, when I changing "98:de:d0:XX:YY:ZZ" mac address in the /etc/udev/rules.d/70-persistent-ipoib.rules with "00:80:48:XX:YY:ZZ" - it WORKS!!!
And, after some another reboot, the true mac address is returning back into original, and to fix a trouble I have to set same mac in "persistent-ipoib".

Why this thing happens?

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Custom netcard name in 70-persistent-ipoib.rules in random moment is not works

Post by aks » 2017/04/11 13:54:28

I read this udev rule as:

ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="1", ATTR{dev_id}=="0x0", ATTR{address}=="98:de:d0:XX:YY:ZZ", KERNEL=="eth*", NAME="ethwan"

add a networking interface (and then some hardware attributes) with the MAC address 98:de:d0:XX:YY:ZZ and call it ethwan.

Then in the network-script (not reproduced):

An interface called ethwan, and a MAC address of 00:80:48:24:1b:16 (which is different to the above), do DHCP etc. on that interface for layer 3 details.

Are you trying to overwrite the "real" MAC address (98:de:d0 is TPLink and 00:80:48 is the Compex/Commodre/DEC OUI), so if you are, don't use those as they are assigned (I used wireshark's OUI lookup at https://www.wireshark.org/tools/oui-lookup.html to find these OUIs).

What's the "real" MAC address of the interface? What are you trying to achieve?

Wohlstand
Posts: 3
Joined: 2017/04/11 09:55:07

Re: Custom netcard name in 70-persistent-ipoib.rules in random moment is not works

Post by Wohlstand » 2017/04/11 19:27:57

aks wrote: An interface called ethwan, and a MAC address of 00:80:48:24:1b:16 (which is different to the above), do DHCP etc. on that interface for layer 3 details.
Yeah, that is:
- changing name of interface by REAL TPLink mac address
- applying a custom MAC address to same interface and using it for DHCP
aks wrote:What's the "real" MAC address of the interface? What are you trying to achieve?
Real address is TPLink's 98:de:d0:XX:YY:ZZ (Net card itself is TPLink), and I trying to have custom interface name for convenience in the scripts (that server is working as router), but to don't have troubles with my IPS, I keeping same MAC addres, therefore I changing it on a new net card

I also had attempt to link interface name by PCI port (retreived via hwls tool), but that won't work:

Code: Select all

ACTION=="add", SUBSYSTEM=="net", BUS="pci", ID=="0000:02:00.0", NAME="ethwan"

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Custom netcard name in 70-persistent-ipoib.rules in random moment is not works

Post by aks » 2017/04/12 16:36:21

Controlling ifnames (background):
https://access.redhat.com/documentation ... Names.html

First of all disable persistent network interface naming - choose from the options listed as appropriate for you:
https://access.redhat.com/documentation ... aming.html

Troubleshooting hints:
https://access.redhat.com/documentation ... aming.html
(Note the difference in udev rule numbering used)

Post Reply