---
title: "Linux 修改网卡名称"
author: "wengn"
date: "2016-01-01T15:32:28Z"
tags: []
categories: ["操作系统"]
slug: "linux"
draft: false
lastmod: "2016-01-01T15:32:28Z"
id: 2268022
url: "https://wengn.iteye.com/blog/2268022"
---

1.shutdown 相应接口，将  
/etc/sysconfig/network-scripts/ifcfg-eth0中的  
DEVICE=eth0  
HWADDR=**00:1e:ec:0f:79:f6**  
修改或添加  
并将下面文件中修改成和上述一致  
/etc/udev/rules.d/70-persistent-net.rules  
*# PCI device 0x14e4:0x1713 (tg3)*  
*SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?\*", ATTR{address}=="**00:1e:ec:0f:79:f6**", ATTR{type}=="1", KERNEL=="eth\*", NAME="eth0"*  
*# PCI device 0x14e4:0x1713 (tg3)*  
*SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?\*", ATTR{address}=="**00:1e:ec:0f:79:f7**", ATTR{type}=="1", KERNEL=="eth\*", NAME="eth1"*

2\. service udev-post stop; service udev-post start  
3\. ifup eth0/eth1