zoukankan      html  css  js  c++  java
  • linux网卡名称修改

    vim /etc/sysconfig/grub ,在倒数第二行添加如下代码

    net.ifnames=0 biosdevname=0
    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 rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet net.ifnames=0 biosdevname=0"
    GRUB_DISABLE_RECOVERY="true"

    执行命令 grub2-mkconfig -o /boot/grub2/grub.cfg

    grub2-mkconfig -o /boot/grub2/grub.cfg
    [root@centos2 /etc/sysconfig]grub2-mkconfig  -o /boot/grub2/grub.cfg
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-957.27.2.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-957.27.2.el7.x86_64.img
    Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-e1b070e76db146fbb48e981539ac34c6
    Found initrd image: /boot/initramfs-0-rescue-e1b070e76db146fbb48e981539ac34c6.img
    done

    重命名网卡名称

    mv ifcfg-ens33 ifcfg-eth0
    vim ifcfg-eth0 DEVICE改为eth0

    重启服务器查看网卡名称是否改变

  • 相关阅读:
    Serverless 动态博客开发趟“坑”记
    tsv与csv文件
    zypper
    source、sh、./三种执行方式对脚本变量的影响
    linux nm
    ldconfig
    cpio
    License简介
    rpm之spec文件
    使用rpmbuild制作rpm包
  • 原文地址:https://www.cnblogs.com/sswind/p/11806558.html
Copyright © 2011-2022 走看看