Linux 修改网卡名称

2021/12/29 7:09:29

本文主要是介绍Linux 修改网卡名称,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

ifconfig ens36 down

ip link set ens36 name ens33 

ifconfig ens33 up

 

 

 

 

如果没有ifconfig命令(CentOS)

yum install -y net-tools

查看所有网卡信息

ifconfig

查看网卡enp97s0f1的信息

ifconfig enp97s0f1
enp97s0f1 Link encap:Ethernet HWaddr b4:05:5d:4f:cc:c9
UP BROADCAST MULTICAST MTU:1500 Metric:1

修改网卡MAC

sudo ifconfig enp97s0f1 down
sudo ifconfig enp97s0f1 hw ether xx:xx:xx:xx:xx:xx
sudo ifconfig enp97s0f1 up
ifconfig enp97s0f1
enp97s0f1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx

注意: 命令中的“hw”必须是小写,不能是大写“HW”

修改网卡名称

sudo ifconfig enp97s0f1 down
sudo ip link set enp97s0f1 name eth0
sudo ifconfig eth0 up
ifconfig

参考

修改Linux网卡名(非Udev且无需重启)
https://www.imooc.com/article/47661


linux网卡命名规则
https://blog.csdn.net/hzj_001/article/details/81587824


ubuntu16.04修改网卡名称enp2s0为eth0
https://blog.csdn.net/wenwenxiong/article/details/52937539

 

发布于 2021-02-19 22:23

这篇关于Linux 修改网卡名称的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程