• 编辑网卡信息

  • [root@Linux-node1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0

  • 修改grub
  • GRUB_CMDLINE_LINUX=”crashkernel=auto rhgb net.ifnames=0 biosdevname=0 quiet”

修改网卡名称

[root@Linux-node1 ~]# mv /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-eth0

  • 生成启动菜单   [root@Linux-node1~]# grub2-mkconfig -o /boot/grub2/grub.cfg

    Generating grub configuration file …
    Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-9526bb8fe167458ca6649c29bf9fdf41
    Found initrd image: /boot/initramfs-0-rescue-9526bb8fe167458ca6649c29bf9fdf41.img
    done
    [root@localhost ~]#

  • 重启,验证是否修改成功
  • 查看网卡信息

[root@Linux-node1 ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.1.10 netmask 255.255.255.0 broadcast 172.16.1.255
inet6 fe80::20c:29ff:fe9b:7709 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:9b:77:09 txqueuelen 1000 (Ethernet)
RX packets 20881 bytes 29588541 (28.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10984 bytes 836626 (817.0 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 1 (Local Loopback)
RX packets 110 bytes 9362 (9.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 110 bytes 9362 (9.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

打赏作者

Leave a Reply

Your email address will not be published.