zoukankan      html  css  js  c++  java
  • centos7修改网卡名称为eth0

    一、在安装系统的时候配置:

    修改内核选项:net.ifnames=0 biosdevname=0

    如下图:

      

      

    二、已安装系统修改方法

    1、编辑网卡信息

    cd /etc/sysconfig/network-scripts/   #进入网卡目录
    mv ifcfg-en067761  ifcfg-eth0         #重命名网卡
    
    cat ifcfg-eth0
    
    TYPE=Ethernet
    BOOTPROTO=static
    DEFROUTE=yes
    PEERDNS=yes
    PEERROUTES=yes
    IPV4_FAILURE_FATAL=no
    NAME=eth0  #name修改为eth0
    ONBOOT=yes

    2、修改grub

    cat /etc/sysconfig/grub  #编辑内核信息
    
    GRUB_TIMEOUT=5
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="crashkernel=auto rhgb net.ifnames=0 biosdevname=0 quiet"       #修改项
    GRUB_DISABLE_RECOVERY="true"
    grub2-mkconfig -o /boot/grub2/grub.cfg   #生成启动菜单
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64
    Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
    Found linux image: /boot/vmlinuz-0-rescue-1100f7e6c97d4afaad2e396403ba7f61
    Found initrd image: /boot/initramfs-0-rescue-1100f7e6c97d4afaad2e396403ba7f61.img
    Done

    3、验证是否修改成功

    reboot    #重启系统生效
    
    yum install net-tools  #默认centos7不支持ifconfig 需要安装net-tools包
    
    #检查网卡信息
    ifconfig eth0
  • 相关阅读:
    MVC 学习(二)之Linq to Sql 简单Demo
    MVC 学习(一)Linq to Entities 简单Demo
    MVC学习(三)Code-First Demo
    pickle 模块
    json 模块
    sys 模块
    os 模块
    random(随机)模块
    time 模块
    python之函数基础
  • 原文地址:https://www.cnblogs.com/xiaopeng01/p/10402279.html
Copyright © 2011-2022 走看看