Changing the Ethernet card name

Hi,

My installation of Leap 42.3 seems to have worked (not fully tested yet).
During the installation, I was given the illusion to be able to assign a name to the Ethernet card. I wanted to call it eth0 but it was already set at ‘p5p1’ and impossible to change.
Never mind I thought, I can surely change it after installation. But no. If I go to Yast,Network Settings, I get a warning that they card is managed by “Netwrok Manager” and that some options might not be able to change. Sure enough clicking on Overview does not let me change it.
Same if I change the Network Manager Service to Wicked or “Network Services Disabled”.

So, how can I change the Ethernet card name from p1p5 to eth0?
Since I’m here, how can I change the MAC ? Here there’s a method for OpenSuse : any problems ?

Thanks.

If you are using NetworkManager, I don’t think you can change the name.

With “wicked”, if I click on “Edit” for the network card, and then click the Hardware tab, I can see where to change the device name. However, it is grayed out, so I don’t think I can change it with “wicked” either. I seem to recall that it could be changed in earlier times, before “wicked” existed (using “ifup” scripts).

Was this a clean install or an upgrade? By default, openSUSE 42.3 uses the traditional naming schema, rather than predictable naming via udev.
https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

What is returned by the following?

hwinfo --netcard
ls -l /etc/sysconfig/network/ifcfg-*

Clean install, just downloaded a few hours ago. Ethernet works, I can use the browser and install sw.

What is returned by the following?

hwinfo --netcard
24: PCI 200.0: 0200 Ethernet controller
  [Created at pci.378]
  Unique ID: ql7q.tDN_uRRXtx5
  Parent ID: z8Q3.ng67qneT12D
  SysFS ID: /devices/pci0000:00/0000:00:1c.0/0000:02:00.0
  SysFS BusID: 0000:02:00.0
  Hardware Class: network
  Model: "Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller"
  Vendor: pci 0x10ec "Realtek Semiconductor Co., Ltd."
  Device: pci 0x8168 "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller"
  SubVendor: pci 0x1028 "Dell"
  SubDevice: pci 0x0798 
  Revision: 0x15
  Driver: "r8169"
  Driver Modules: "r8169"
  Device File: p5p1
  I/O Ports: 0xd000-0xdfff (rw)
  Memory Range: 0xdf204000-0xdf204fff (rw,non-prefetchable)
  Memory Range: 0xdf200000-0xdf203fff (rw,non-prefetchable)
  IRQ: 127 (34313 events)
  HW Address: d4:81:d7:88:8f:10
  Permanent HW Address: d4:81:d7:88:8f:10
  Link detected: yes
  Module Alias: "pci:v000010ECd00008168sv00001028sd00000798bc02sc00i00"
  Driver Info #0:
    Driver Status: r8169 is active
    Driver Activation Cmd: "modprobe r8169"
  Config Status: cfg=no, avail=yes, need=no, active=unknown
  Attached to: #17 (PCI bridge)

25: PCI 300.0: 0282 WLAN controller
  [Created at pci.378]
  Unique ID: y9sn.+QLhmLi1GnE
  Parent ID: HnsE.I53tIMmAZQD
  SysFS ID: /devices/pci0000:00/0000:00:1c.5/0000:03:00.0
  SysFS BusID: 0000:03:00.0
  Hardware Class: network
  Model: "Intel Wireless 3165"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x3165 "Wireless 3165"
  SubVendor: pci 0x8086 "Intel Corporation"
  SubDevice: pci 0x4410 
  Revision: 0x79
  Driver: "iwlwifi"
  Driver Modules: "iwlwifi"
  Device File: wlan0
  Features: WLAN
  Memory Range: 0xdf100000-0xdf101fff (rw,non-prefetchable)
  IRQ: 128 (2451 events)
  HW Address: 70:1c:e7:84:a3:6e
  Permanent HW Address: 70:1c:e7:84:a3:6e
  Link detected: no
  WLAN channels: 1 2 3 4 5 6 7 8 9 10 11 12 13 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140
  WLAN frequencies: 2.412 2.417 2.422 2.427 2.432 2.437 2.442 2.447 2.452 2.457 2.462 2.467 2.472 5.18 5.2 5.22 5.24 5.26 5.28 5.3 5.32 5.5 5.52 5.54 5.56 5.58 5.6 5.62 5.64 5.66 5.68 5.7
  WLAN encryption modes: WEP40 WEP104 TKIP CCMP
  WLAN authentication modes: open sharedkey wpa-psk wpa-eap
  Module Alias: "pci:v00008086d00003165sv00008086sd00004410bc02sc80i00"
  Driver Info #0:
    Driver Status: iwlwifi is active
    Driver Activation Cmd: "modprobe iwlwifi"
  Config Status: cfg=no, avail=yes, need=no, active=unknown
  Attached to: #18 (PCI bridge)


ls -l /etc/sysconfig/network/ifcfg-*
-rw------- 1 root root 147 May 15 12:10 ifcfg-lo
-rw-r--r-- 1 root root 226 May 15 12:10 ifcfg-p5p1

I have tried to rename ifcfg-p5p1 to ifcfg-eth0 but it made absolutely no difference.

Thanks.

BTW, I’m more than happy to re-install everything if there’s something I can do during install that fixes this.
Thanks,

Can you show us the output of the following please?

ip a
cat /etc/sysconfig/network/ifcfg-p5p1

Check the udev rule defined in /etc/udev/rules.d/70-persistent-net.rules…

cat /etc/udev/rules.d/70-persistent-net.rules

I don’t like this, how do I disable this?

You basically have three options:

You disable the assignment of fixed names, so that the unpredictable kernel names are used again. For this, simply mask udev's .link file for the default policy: ln -s /dev/null /etc/systemd/network/99-default.link
You create your own manual naming scheme, for example by naming your interfaces "internet0", "dmz0" or "lan0". For that create your own .link files in /etc/systemd/network/, that choose an explicit name or a better naming scheme for one, some, or all of your interfaces. See systemd.link(5) for more information.
You pass the net.ifnames=0 on the kernel command line

https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: p5p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether d4:81:d7:88:8f:10 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.245/24 brd 192.168.1.255 scope global dynamic p5p1
       valid_lft 78435sec preferred_lft 78435sec
    inet6 fe80::d681:d7ff:fe88:8f10/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 70:1c:e7:84:a3:6e brd ff:ff:ff:ff:ff:ff

cat /etc/sysconfig/network/ifcfg-p5p1
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IFPLUGD_PRIORITY='0'
IPADDR=''
MTU=''
NAME='RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller'
NETMASK='255.255.255.0'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='ifplugd'


# This file was automatically generated by the /usr/lib/udev/write_net_rules
# program,run by the persistent-net-generator.rules rules file.
#
# You can modify it,as long as you keep each rule on a single
# line,and change only the value of the NAME= key.
# PCI device 0x8086:0x3165 (iwlwifi)
# This file was automatically generated by the /usr/lib/udev/write_net_rules
# program,run by the persistent-net-generator.rules rules file.
#
# You can modify it,as long as you keep each rule on a single
# line,and change only the value of the NAME= key.
# PCI device 0x8086:0x3165 (iwlwifi)
# This file was automatically generated by the /usr/lib/udev/write_net_rules
# program,run by the persistent-net-generator.rules rules file.
#
# You can modify it,as long as you keep each rule on a single
# line,and change only the value of the NAME= key.
# PCI device 0x8086:0x3165 (iwlwifi)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="70:1c:e7:84:a3:6e", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"


I have seen that. I was not sure what to do, just create the symbolic link in ln -s /dev/null /etc/systemd/network/99-default.link ?
The /etc/systemd/network directory does not exist on my system though.

Try adding the something like the following to /etc/udev/rules.d/70-persistent-net.rules…

ATTR{address}=="d4:81:d7:88:8f:10", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0"

then reboot.

That seems to have worked, thanks a lot!
Is there a way to mark this thread as resolved ?

We don’t do that here. You’re free to reply with a title edited to mark it as such though.

O,k, I’ll need to open another thread though : cloning the MAC address does not work with eth0 (it oscillates between connects and disconnects
manytimes a minute).