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

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

  • 相关阅读:
    Longest Common Substring
    未完成 Anagrams
    strStr
    vim的学习笔记
    Compare Strings
    Two Strings Are Anagrams
    KMP算法
    [ 力扣活动0314 ] 300. 最长上升子序列
    [ 力扣活动0317 ] 1160. 拼写单词
    [ 力扣活动0313 ] 169. 多数元素
  • 原文地址:https://www.cnblogs.com/sswind/p/11806558.html
Copyright © 2011-2022 走看看