[root@localhost~]# ifconfig ens8:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.0.112 netmask 255.255.255.0 broadcast 192.168.0.255 inet6 fe80::eda5:e2c1:5b96:46b5 prefixlen 64 scopeid 0x20<link> ether 52:54:00:c4:8d:84 txqueuelen 1000 (Ethernet) RX packets 72 bytes 12810 (12.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 10 bytes 1308 (1.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 编辑/etc/sysconfig/grub文件内容,下边是编辑前的文件内容: vim/etc/default/grub 增加“net.ifnames=0 biosdevname=0”,编辑后的文件内容: GRUB_CMDLINE_LINUX="crashkernel==cl/root net.ifnames=0 biosdevnamee=0 =cl/swapconsole=ttyS0,115200" 执行:grub2-mkconfig -o/boot/grub2/grub.cfg [root@localhost~]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grubconfiguration file ... Found linuxp_w_picpath: /boot/vmlinuz-3.10.0-514.el7.x86_64 Found initrdp_w_picpath: /boot/initramfs-3.10.0-514.el7.x86_64.img Found linuxp_w_picpath: /boot/vmlinuz-0-rescue-2220a6d1a36a4fbb8523e078b3dfe795 Found initrdp_w_picpath: /boot/initramfs-0-rescue-2220a6d1a36a4fbb8523e078b3dfe795.img [ 7136.636287]xor: automatically using best checksumming function: [7136.648028] avx : 38496.000 MB/sec [ 7136.670721]raid6: sse2x1 gen() 12937 MB/s [ 7136.687762]raid6: sse2x2 gen() 16453 MB/s [ 7136.704811]raid6: sse2x4 gen() 13433 MB/s [ 7136.721846]raid6: avx2x1 gen() 21781 MB/s [ 7136.738915]raid6: avx2x2 gen() 32109 MB/s [ 7136.755964]raid6: avx2x4 gen() 34687 MB/s [ 7136.756797]raid6: using algorithm avx2x4 gen() (34687 MB/s) [ 7136.757976]raid6: using avx2x2 recovery algorithm [ 7136.796156]Btrfs loaded [ 7136.805566]fuse init (API version 7.22) done 重新对 文件进行命名: /etc/sysconfig/network-scripts/ifcfg-* 重启电脑网卡也会自动变 [root@localhost~]# ifconfig eth0:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.0.112 netmask 255.255.255.0 broadcast 192.168.0.255 inet6 fe80::1e89:5915:c6b6:2eb1 prefixlen 64 scopeid 0x20<link> ether 52:54:00:c4:8d:84 txqueuelen 1000 (Ethernet) RX packets 29 bytes 4669 (4.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 35 bytes 3334 (3.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth1:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.0.172 netmask 255.255.255.0 broadcast 192.168.0.255 inet6 fe80::5054:ff:fe9d:7a94 prefixlen 64 scopeid 0x20<link> ether 52:54:00:9d:7a:94 txqueuelen 1000 (Ethernet) RX packets 59 bytes 12755 (12.4 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 9 bytes 1246 (1.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo:flags=73<UP,LOOPBACK,RUNNING> mtu65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 8 bytes 680 (680.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 8 bytes 680 (680.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ifconfig eth0 192.168.0.171 netmask 255.255.255.0 && route add default gw 192.168.0.1 配置临时IP
centos7网卡重命名eth0
原创
©著作权归作者所有:来自51CTO博客作者喵来个鱼的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
centos7 如何设置为eth0网卡
centos7 如何设置网卡为eth0
网卡 操作系统 命名 -
centos7修改网卡名为eth0
centos7修改网卡名为eth0
centos7修改网卡名为eth0 -
centos7 改网卡名eth0
centos7 网卡重命名eth0
centos7 网卡 eth0 -
Centos7更改网卡名称eth0
centos第一块网卡的默认名称位eth0,如果是克隆或者其它原因导致网卡默认配置不是eth0,需要手动修改。下面是修改的步骤和方法 centos7.2_x64 用i
linux centos 重启 配置文件 html -
Centos7网卡配置和重命名案例
Centos7网卡配置和重命名案例
Centos7网卡配置和重命名案例
















