1 修改网卡名称
1
2
|
cd
/etc/sysconfig/network-scripts/
mv
ifcfg-ens33 ifcfg-eth0
|
2 修改网卡配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
[root@localhost ~]
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=
"Ethernet"
BOOTPROTO=
"none"
DEFROUTE=
"yes"
IPV4_FAILURE_FATAL=
"yes"
IPV6INIT=
"yes"
IPV6_AUTOCONF=
"yes"
IPV6_DEFROUTE=
"yes"
IPV6_FAILURE_FATAL=
"no"
IPV6_ADDR_GEN_MODE=
"stable-privacy"
NAME=
"eth0"
UUID=
"92a1e90a-7cf2-46aa-bdcb-81bc5b96fbc3"
DEVICE=
"eth0"
ONBOOT=
"yes"
IPADDR=
"10.10.172.235"
PREFIX=
"24"
GATEWAY=
"10.10.172.1"
DNS1=
"192.168.172.208"
DNS2=
"192.168.172.209"
IPV6_PEERDNS=
"yes"
IPV6_PEERROUTES=
"yes"
IPV6_PRIVACY=
"no"
|
3 修改grub
1
2
3
4
5
6
7
8
9
10
11
|
加入以下内容
net.ifnames=0 biosdevname=0
配置文件内容如下所示:
[root@localhost ~]
# cat /etc/sysconfig/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=
"rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY=
"true"
|
4 生成启动菜单
1
|
grub2-mkconfig -o
/boot/grub2/grub
.cfg
|
5 重启系统
1
|
reboot
|
本文转自 dengaosky 51CTO博客,原文链接:http://blog.51cto.com/dengaosky/2073052,如需转载请自行联系原作者