May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

default network name to old “eth0” on RHEL 7 / Fedora 19 disable ipv 6

Tags: biosdevname=0, default network device, GRUB_CMDLINE_LINUX, how to change network name to old eth0, net.ifnames=0, net.ifnames=0 biosdevname=0, Red Hat Enterprise Network name

Step 1) add kernel boot args & regenerate the grub config

The following kernel boot arguments need to be added:
biosdevname=0
net.ifnames=0

Open /etc/default/grub with your favorite editor and add those two options to the line starting with GRUB_CMDLINE_LINUX:

[root@apache2 ~]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=”$(sed ‘s, release .*$,,g’ /etc/system-release)”
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=”console”
GRUB_CMDLINE_LINUX=”crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet”
GRUB_DISABLE_RECOVERY=”true”
[root@apache2 ~]#

Will look like this:
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=”$(sed ‘s, release .*$,,g’ /etc/system-release)”
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=”console”
GRUB_CMDLINE_LINUX=”crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet net.ifnames=0 biosdevname=0″
GRUB_DISABLE_RECOVERY=”true”

root@apache2 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file …
Found linux image: /boot/vmlinuz-3.10.0-327.18.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.18.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-327.13.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.13.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-8ac53b429efd489eb5771be2120e30d7
Found initrd image: /boot/initramfs-0-rescue-8ac53b429efd489eb5771be2120e30d7.img
done
[root@apache2 ~]#
[root@apache2 ~]# cd /etc/sysconfig/network-scripts/

[root@apache2 network-scripts]# mv ifcfg-eno16777736 ifcfg-eth0
[root@apache2 network-scripts]# vi ifcfg-eth0

BOOTPROTO=”static”
IPV4_FAILURE_FATAL=”no”
DEVICE=”eth0″
ONBOOT=”yes”
IPADDR=”192.168.1.72″
PREFIX=”24″
NETMASK=”255.255.255.0″
GATEWAY=”192.168.1.254″
DNS1=”8.8.8.8″

root@apache2 network-scripts]# systemctl stop NetworkManager
[root@apache2 network-scripts]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
[root@apache2 network-scripts]#

Step 2) add a udev symlink, just to make sure

Basically adding the biosdevname=0 and net.ifnames=0 arguments to grub should be enough. But here’s another way just in case:

[root@test ~]# ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

[root@apache2 ~]# ifconfig -a
eth0: flags=4163 mtu 1500
inet 192.168.1.72 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:fed4:db04 prefixlen 64 scopeid 0x20 ether 00:0c:29:d4:db:04 txqueuelen 1000 (Ethernet)
RX packets 191 bytes 19824 (19.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 125 bytes 18952 (18.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Disable IPv6:

First check that IPv6 is enabled or not:
lsmod | grep -i ipv6

Search for the line “GRUB_CMDLINE_LINUX” and add the following at the beginning: “ipv6.disable=1?

Will look like this:
GRUB_CMDLINE_LINUX=”ipv6.disable=1 rd.lvm.lv=rootvg/usrlv…

Create a new configuration based on the currently running system using grub2-mkconfig command:
grub2-mkconfig -o /boot/grub2/grub.cfg

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>