shellvim /etc/default/grup
#在 GRUB_CMDLINE_LINUX 这一项中后面添加 net.ifnames=0 biosdevname=0
# 原始内容> GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
新内容> GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 rhgb quiet"
shell1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback `00:00:00:00:00:00` brd 00:00:00:00:00:00 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether `00:0c:29:1f:25:8b` brd ff:ff:ff:ff:ff:ff 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether `00:0c:29:1f:25:9f` brd ff:ff:ff:ff:ff:
shellvim /etc/udev/rules.d/70-persistent-net.rules
# 写入以下内容,需要修改的参数是 ATTR{address} 和 NAME
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:25:9f", ATTR{type}=="1", KERNEL=="eth*", NAME="ens34"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:1f:25:8b", ATTR{type}=="1", KERNEL=="eth*", NAME="ens33"
shell# vim /etc/sysconfig/network-scripts/ifcfg-ens34
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
NAME="ens34"
DEVICE="ens34"
ONBOOT="yes"
shell`grub2-mkconfig -o /boot/grub2/grub.cfg `reboot
本文作者:ZYW
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 ™ 许可协议。转载请注明出处!