linux修改网卡名

来源:互联网 发布:历史非农数据 编辑:程序博客网 时间:2024/05/17 01:46

用vi打开/etc/udev/rules.d/70-persistent-net.rules ,

该文件的内容为:

# This file maintains persistent names for network interfaces.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-persistent-net-generator.rules
# file; however you are also free to add your own entries.

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:36:18:30:d7", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
~                                

最后一项即网卡名称,用别的名称取代,比如eth1,重启,即可生效


原创粉丝点击