linux
  • Introduction
  • Yum
    • 基础yum源的配置
    • 为yum源配置代理
    • Centos指定版本的yum源
    • 环境变量
    • 本地yum源
    • 制作yum源
      • 同步yum源
    • epel源
  • Iptables
    • 基本匹配条件
    • Match-Extensions
      • Addrtype
      • Set
      • TCP
    • Target-Extensions
      • DNAT
      • LOG
    • Iptables规则持久化
    • 连接追踪
  • LVS
    • Ipvsadm命令
  • 磁盘与分区
    • 创建分区
    • 格式化与挂载
    • fstab
    • LVM
      • LVM扩容
    • swap分区
    • tmpfs
  • 网络相关
    • 重命名网卡
    • resolv.conf
    • Tcpdump
    • dig与nslookup
  • Other
    • CPU与内存
    • 进程
      • 僵尸进程
    • SSH密钥登录
    • 用户管理
    • Crontab
  • Nofile
    • 原理
  • 常用软件安装篇
    • MYSQL
    • 系统与内核
      • 指定内核启动
    • NFS
    • Haproxy
    • Keepalived
    • Squid
    • Redsocks
    • Shadowsocks
    • 时钟同步
  • 内存
Powered by GitBook
On this page

Was this helpful?

  1. 网络相关

重命名网卡

Previous网络相关Nextresolv.conf

Last updated 5 years ago

Was this helpful?

假设一开始我们的网卡名叫eno16777736,我们想把它修改成eth0.

首先,编辑网卡的配置文件,将其中的NAME与DEVICE的字段值设为新的网卡名eth0

vim /etc/sysconfig/network-scripts/ifcfg-eno16777736

然后,重命名网卡的配置文件的名字

mv ifcfg-eno16777736 ifcfg-eth0

然后,关闭centos7默认生成网卡名的规则,即编辑文件etc/default/grub,在GRUB_CMDLINE_LINUX那一行中加入内容net.ifnames=0 biosdevname=0

然后,更改grub配置

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

最后,重启主机即可。

Reference

[1]

https://www.jianshu.com/p/3a61191f1a99