章工运维 章工运维
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)

章工运维

业精于勤,荒于嬉
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)
  • linux

    • rsync

      • rsync用法及参数详解
      • rsync服务实现推送,拉取
    • dns

    • sed、awk、grep、find四剑客

    • LVM管理
    • sudo权限规划
    • linux修改网卡为eth0的两种方法
      • Logrotate入门了解及生产实践
      • linux中用dd命令来测试硬盘读写速度
      • linux 阿里云盘挂载错误
      • CentOS7安装Android SDK
      • centos7安装更新git
      • linux启动顺序
      • centos7升级openssl
      • expect工具的安装和使用方法
      • linux下使用v2ray
      • centos7安装java环境的两种方式
      • linux-centos7系统设置时区及同步时间
      • rsyslog日志系统:rsyslog配置文件
      • rsyslog的安装、使用、详解
      • safe-rm防止删除重要的文件
      • linux如何获取打开文件和文件描述符数量
      • LVS集群-DR模式
      • linux服务器安装ffmpeg
      • linux服务器安装samba
      • 使用openssl创建自签发证书
      • linux服务器部署next.js服务
      • linux服务器ionice命令使用方式
      • linux服务器curl命令常用操作
    • windows

    • 中间件

    • 网络

    • 安全

    • 存储

    • 防火墙

    • 数据库

    • 系统

    • docker

    • other

    • 监控

    • 运维
    • linux
    章工运维
    2022-12-21
    目录

    linux修改网卡为eth0的两种方法

    # 在系统安装时

    1. 如下图,系统安装时,直接按下"tab"按键,进入编辑界面,添加如下信息:"net.ifnames=0 biosdevname=0",系统安装完成后默认为eth0。

    # 系统安装完成后

    1. 修改网卡配置文件DEVICE配置的值:

      vim /etc/sysconfig/network-scripts/ifcfg-ens33 ... DEVICE=eth0 ...

    2. 重新命名网卡文件

      mv /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-eth0

    3. 由于centos7采用grub2 引导,还需要对 grub2 进行修改,编辑 /etc/default/grub 配置文件,在"GRUB_CMDLINE_LINUX "这个参数后面加入 "net.ifnames=0 biosdevname=0"配置:

      vim /etc/default/grub ... GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet net.ifnames=0 biosdevname=0" ...

    4. 最后,用 grub2-mkconfig 命令重新生成GRUB配置并更新内核,重启系统即可:

      grub2-mkconfig -o /boot/grub2/grub.cfg reboot

    微信 支付宝
    上次更新: 2023/02/23, 18:13:16

    ← sudo权限规划 Logrotate入门了解及生产实践→

    最近更新
    01
    shell脚本模块集合
    05-13
    02
    生活小技巧(认知版)
    04-29
    03
    生活小技巧(防骗版)
    04-29
    更多文章>
    Theme by Vdoing | Copyright © 2019-2025 | 点击查看十年之约 | 鄂ICP备2024072800号
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式