AlmaLinux / cloud-images

Packer templates and other tools for building AlmaLinux images for various cloud platforms.
MIT License
146 stars 48 forks source link

Is it safe to set net.ifnames=0 in AlmaLinux 8 and AlmaLinux 9? #139

Closed bbaassssiiee closed 1 year ago

bbaassssiiee commented 1 year ago

I noticed the boot command has net.ìfnames=0. It's OK to have one network interface eth0, but with dual-homed machines it could be a problem.

https://github.com/AlmaLinux/cloud-images/blob/d5288617240e3d132a7cb8a9107da01b39e98af5/variables.pkr.hcl#L37

Red Hat's description of the problem (requires access). Other references:

codyro commented 1 year ago

I'm not sure what the problem is with setting net.ifnames=0. With multiple interfaces it would just be named in the order detected (EG; eth0, `eth1, etc).

Would you mind elaborating on what you believe the issue would be?

bbaassssiiee commented 1 year ago

The order can change after reboot because the kernel is stateless. Problem is described here https://access.redhat.com/solutions/2435891

LKHN commented 1 year ago

@bbaassssiiee Hi! Thanks for the reporting!

It's same as the upstream.

Output from Red Hat Enterprise Linux 9.2 Beta KVM Guest Image :

[root@localhost ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:b1:5a:8f brd ff:ff:ff:ff:ff:ff
    altname enp1s0
    inet 192.168.122.92/24 brd 192.168.122.255 scope global dynamic noprefixroute eth0
       valid_lft 3523sec preferred_lft 3523sec
    inet6 fe80::5054:ff:feb1:5a8f/64 scope link
       valid_lft forever preferred_lft forever
[root@localhost ~]# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt3)/vmlinuz-5.14.0-283.el9.x86_64 root=UUID=0d4475ec-29e3-451c-839b-29c2762c130f console=tty0 console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M
[root@localhost ~]# cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="9.2 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.2"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.2 Beta (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.2 Beta"