centos7 change default interface name to eth0

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7 change default interface name to eth0相关的知识,希望对你有一定的参考价值。

#!/bin/bash

DEFAULTNAME=`ls /etc/sysconfig/network-scripts/ifcfg-en*`

EXPECTNAME=ifcfg-eth0

sed -i ‘s/DEVICE.*/DEVICE=eth0/g‘ $DEFAULTNAME

sed -i ‘s/ONBOOT.*/ONBOOT=yes/g‘ $DEFAULTNAME

mv $INITIALNAME /etc/sysconfig/network-scripts/$EXPECTNAME

sed -i ‘s/GRUB_CMDLINE_LINUX="/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 /g‘ /etc/default/grub

grub2-mkconfig -o /boot/grub2/grub.cfg

echo "please reboot system"


以上是关于centos7 change default interface name to eth0的主要内容,如果未能解决你的问题,请参考以下文章

how to change the original ruby version in Rails app

How to Change File Ownership & Groups in Linux

unity, 不要change Default sharedMaterial

Change default wordpress author link

change your default system opening option using Ubuntu

How to change default used version of Qt/qmake?