CentOS7修改默认的网卡 |
您所在的位置:网站首页 › centos7如何恢复出厂设置 › CentOS7修改默认的网卡 |
1.在安装操作系统的时候进行设置
点击 Tab,打开kernel启动选项
因 CentOS7 采用 grub2 引导,还需要对 grub2 进行修改,编辑 /etc/default/grub 配置文件,在 GRUB_CMDLINE_LINUX 这个参数后面加入 net.ifnames=0 biosdevname=0 [root@localhost network-scripts]# vi /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="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet net.ifnames=0 biosdevname=0" GRUB_DISABLE_RECOVERY="true"用 grub2-mkconfig 命令重新生成GRUB配置并更新内核 [root@localhost ~]# 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-4dd6b54f74c94bff9e92c61d669fc195 Found initrd image: /boot/initramfs-0-rescue-4dd6b54f74c94bff9e92c61d669fc195.img done重启系统 [root@localhost network-scripts]# reboot重启之后验证网卡名称: [root@localhost ~]# ifconfig eth0: flags=4163 mtu 1500 inet 192.168.130.135 netmask 255.255.255.0 broadcast 192.168.130.255 inet6 fe80::20c:29ff:fee2:7d9d prefixlen 64 scopeid 0x20 ether 00:0c:29:e2:7d:9d txqueuelen 1000 (Ethernet) RX packets 9599 bytes 12602466 (12.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2027 bytes 126428 (123.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 0 (Local Loopback) RX packets 6 bytes 560 (560.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 560 (560.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |