CentOS7修改网卡名称

[root@controller ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 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: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:50:56:3a:78:ee brd ff:ff:ff:ff:ff:ff
inet 192.168.128.85/24 brd 192.168.128.255 scope global eno16777736
valid_lft forever preferred_lft forever

如果改为eth0、eth1,该如何操作呢?

1.修改配置

[root@controller ~]# vi /etc/default/grub
GRUB_CMDLINE_LINUX 加上 net.ifnames=0 biosdevname=0

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
2.重新加载配置 
grub2-mkconfig -o /boot/grub2/grub.cfg

3.修改网卡名称[root@controller ~]# cd /etc/sysconfig/network-scripts/[root@controller network-scripts]# vi ifcfg-eno16777736

修改为
NAME=eth0
DEVICE=eth0

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

同样另外一张网卡改为eth1

# reboot 

 

上一篇:使用 Swagger 自动生成 ASP.NET Core Web API 的文档、在线帮助测试文档(ASP.NET Core Web API 自动生成文档)


下一篇:NOIP2016提高组初赛(2)四、读程序写结果3、求最长回文子序列