d-_-b Asked: 2012-10-05 21:36:40 +0800 CST2012-10-05 21:36:40 +0800 CST 2012-10-05 21:36:40 +0800 CST How do I rename a NIC: eth2 -> eth1 772 I've installed a new NIC. It shows up as eth2. I'd like it to be eth1. How I can do this? linux 2 Answers Voted Best Answer d-_-b 2012-10-05T21:40:34+08:002012-10-05T21:40:34+08:00 edit /etc/udev/rules.d/70-persistent-net.rules You may have something like: # PCI device 0x14e4:0x165a (tg3) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:19:07:90:e4", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x10ec:0x8139 (8139too) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0a:79:b8:72:7d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" # PCI device 0x10ec:0x8169 (r8169) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:24:a5:84:de:62", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2" Remove the line ending with NAME="eth1" and rename eth2 to eth1 as such: # PCI device 0x14e4:0x165a (tg3) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:19:07:90:e4", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x10ec:0x8169 (r8169) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:24:a5:84:de:62", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" reboot Varkas 2014-11-26T20:02:30+08:002014-11-26T20:02:30+08:00 The configuration for your interfaces on Red Hat distros, should be located in: /etc/sysconfig/network-scripts You will want to look for the appropriate script for your interface to modify.
edit
/etc/udev/rules.d/70-persistent-net.rules
You may have something like:
Remove the line ending with
NAME="eth1"
and renameeth2
toeth1
as such:reboot
The configuration for your interfaces on Red Hat distros, should be located in:
You will want to look for the appropriate script for your interface to modify.