默认网卡名称是 eno16777736
1、修改配置文件 ifcfg-eno16777736
?
1
2 |
[root@localhost ~] # cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts] # vim ifcfg-eno16777736 |
将 NAME 和 DEVICE 修改为 eth0
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 |
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE= yes
IPV4_FAILURE_FATAL=no
IPV6INIT= yes
IPV6_AUTOCONF= yes
IPV6_DEFROUTE= yes
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=0fea6de7-54d9-4a8d-bddc-3061678e8a0e
DEVICE=eth0
ONBOOT= yes
PEERDNS= yes
PEERROUTES= yes
IPV6_PEERDNS= yes
IPV6_PEERROUTES= yes |
重命名该文件
?
1 |
mv ifcfg-eno16777736 ifcfg-eth0 |
2、禁用该可预测命名规则
在 grup 文件里面的 GRUB_CMDLINE_LINUX 变量添加 net.ifnames=0 biosdevname=0
?
1
2
3
4
5
6
7
8 |
[root@localhost network-scripts] # vim /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 net.ifnames=0 biosdevname=0 rhgb quiet"
GRUB_DISABLE_RECOVERY= "true" |
运行命令重新生成GRUB配置并更新内核参数
?
1
2
3
4
5
6
7 |
[root@localhost network-scripts] # grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3 .10.0-327.el7.x86_64
Found initrd image: /boot/initramfs-3 .10.0-327.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-692c580a413f41d8b51ddc4724500560
Found initrd image: /boot/initramfs-0-rescue-692c580a413f41d8b51ddc4724500560 .img
done |
3、重启系统
?
1 |
[root@localhost network-scripts] # reboot now |
查看网卡信息
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 |
[root@localhost network-scripts] # ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.81.128 netmask 255.255.255.0 broadcast 192.168.81.255
inet6 fe80::20c:29ff:fe5b:1a46 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:5b:1a:46 txqueuelen 1000 (Ethernet)
RX packets 474 bytes 41909 (40.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 266 bytes 45987 (44.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 6 bytes 564 (564.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6 bytes 564 (564.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 00:00:00:00:00:00 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持快网idc。
原文链接:http://www.cnblogs.com/lxmhhy/p/6428884.html
相关文章
猜你喜欢
- 个人服务器网站搭建:如何选择适合自己的建站程序或框架? 2025-06-10
- 64M VPS建站:能否支持高流量网站运行? 2025-06-10
- 64M VPS建站:怎样选择合适的域名和SSL证书? 2025-06-10
- 64M VPS建站:怎样优化以提高网站加载速度? 2025-06-10
- 64M VPS建站:是否适合初学者操作和管理? 2025-06-10
TA的动态
- 2025-07-10 怎样使用阿里云的安全工具进行服务器漏洞扫描和修复?
- 2025-07-10 怎样使用命令行工具优化Linux云服务器的Ping性能?
- 2025-07-10 怎样使用Xshell连接华为云服务器,实现高效远程管理?
- 2025-07-10 怎样利用云服务器D盘搭建稳定、高效的网站托管环境?
- 2025-07-10 怎样使用阿里云的安全组功能来增强服务器防火墙的安全性?
快网idc优惠网
QQ交流群
您的支持,是我们最大的动力!
热门文章
-
2025-05-25 48
-
2025-05-29 80
-
2025-05-25 59
-
2025-05-25 29
-
2025-05-29 54
热门评论