Blog

Linux Rename Eth0 Network Interfaces

The best way to rename Ethernet devices is through udev. It is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles /dev directory and all user space actions when adding/removing devices, including firmware load.

The order of the network interfaces may be unpredictable under certain configurations. Between reboots it usually stays the same, but often after an upgrade to a new kernel or the addition or replacement of a network card (NIC) the order of all network interfaces changes. For example, what used to be rl0 now becomes wlan0 or what used to be eth0 now becoems eth2 or visa versa.

Step #1: Find out the MAC address of the Ethernet device

Type the following command:
# ifconfig -a | grep -i --color hwaddr
Sample outputs:

eth0      Link encap:Ethernet  HWaddr b8:ac:6f:65:31:e5  
pan0      Link encap:Ethernet  HWaddr 4a:71:40:ed:5d:99  
vmnet1    Link encap:Ethernet  HWaddr 00:50:56:c0:00:01  
vmnet8    Link encap:Ethernet  HWaddr 00:50:56:c0:00:08  
wlan0     Link encap:Ethernet  HWaddr 00:21:6a:ca:9b:10 

Note down the MAC address.

Step #2: Rename eth0 as wan0

To rename eth0 as wan0, edit a file called 70-persistent-net.rules in /etc/udev/rules.d/directory, enter:
# vi /etc/udev/rules.d/70-persistent-net.rules
The names of the Ethernet devices are listed in this file as follows:

# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b8:ac:6f:65:31:e5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Locate and identify the line with the NIC from step 1 (look for the MAC address). It may look like above. In this example, the interface eth0 will be renamed to wan0 (change NAME="eth0" to NAME="wan0"):

# PCI device 0x14e4:0x1680 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b8:ac:6f:65:31:e5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="wan0"

Save and close the file. Reboot the system to test changes:
# reboot
Verify new settings:
# ifconfig -a
# ifconfig wan0
# ifconfig -a | less
# ip addr show

ASUS P8H61-M LX mainboard

P8H61-M LX

REV 3.0 – New H61 B3 Revision
The most cost-effective Intel® H61

choice with super-friendly UEFI BIOS

  • UEFI BIOS (EZ Mode) – Flexible & Easy BIOS Interface
  • AI Suite II – One-stop Access to Innovative ASUS Features
  • EPU – Energy Efficiency All Around
  • Anti Surge – Full-time Power Guardian-Make System Free From Risk
  • CPU
    Intel® Socket 1155 for 2nd Generation Core™ i7/Core™ i5/Core™ i3 Processors
    Supports Intel® 32 nm CPU
    Supports Intel® Turbo Boost Technology 2.0
    * The Intel® Turbo Boost Technology 2.0 support depends on the CPU types.
    * Refer to www.asus.com for CPU support list
  • Chipset
    Intel® H61(B3)
  • Memory
    2 x DIMM, Max. 16GB, DDR3 1333/1066 Hz Non-ECC, Un-buffered Memory
    Dual Channel Memory Architecture
    Supports Intel® Extreme Memory Profile (XMP)
    * The maximum 16GB memory capacity can be supported with 8GB or above DIMMs.
  • ASUS will update the memory QVL once the DIMMs are available in the market.
    * Refer to www.asus.com or user manual for the Memory QVL (Qualified Vendors Lists).
    * Due to OS limitation, when installing total memory of 4GB capacity or more,
    Windows® 32-bit operation system may only recognize less than 3GB.
    Install a 64-bit Windows® OS when you want to install 4GB or more memory
    on the motherboard.
  • Graphic
    Integrated Graphics Processor
    VGA output support : RGB port
    – Supports RGB with max. resolution 2048 x 1536 @ 75 Hz
    Supports DirectX 10.1
  • Expansion Slots
    1 x PCIe 2.0 x16
    3 x PCIe 2.0 x1
  • Storage
    Intel® H61(B3) chipset : 
    4 x SATA 3Gb/s port(s), blue
  • LAN
    Realtek® 8111E , 1 x Gigabit LAN Controller(s)
  • Audio
    Realtek® ALC 887 8-Channel High Definition Audio CODEC *1
  • USB Ports
    Intel® H61(B3) chipset :
    10 x USB 2.0 port(s) (4 at back panel, black, 6 at mid-board)
  • ROG Exclusive Features
    Overclocking Protection :
    – ASUS C.P.R.(CPU Parameter Recall)
  • Special Features
    ASUS EPU :
    – EPU
    ASUS Exclusive Features :
    – AI Suite II
    – Ai Charger
    – Anti-Surge
    – Low EMI Solution
    – ESD Guards
    – ASUS UEFI BIOS EZ Mode featuring friendly graphics user interface
    ASUS Quiet Thermal Solution :
    – Stylish Fanless Design Heat-sink solution
    – ASUS Fan Xpert
    ASUS EZ DIY :
    – ASUS CrashFree BIOS 3
    – ASUS EZ Flash 2
    – ASUS MyLogo 2
  • Back I/O Ports
    1 x PS/2 keyboard (purple)
    1 x PS/2 mouse (green)
    1 x D-Sub
    1 x LAN (RJ45) port(s)
    4 x USB 2.0
    1 x COM port(s)
    1 x Parallel port(s)
    3 x Audio jack(s)
  • Internal I/O Ports
    3 x USB 2.0 connector(s) support(s) additional 6 USB 2.0 port(s)
    4 x SATA 3Gb/s connector(s)
    1 x CPU Fan connector(s)
    1 x Chassis Fan connector(s)
    1 x S/PDIF out header(s)
    1 x 24-pin EATX Power connector(s)
    1 x 4-pin ATX 12V Power connector(s)
    1 x Front panel audio connector(s) (AAFP)
    1 x Internal speaker connector(s)
    1 x System panel(s)
  • Accessories
    User’s manual
    I/O Shield
    2 x SATA 3Gb/s cable(s)
  • BIOS
    32 Mb Flash ROM, UEFI BIOS, PnP, DMI v2.0, WfM2.0, SMBIOS v2.6,
    ACPI v2.0a, Multi-language BIOS
  • Support Disc
    Drivers
    ASUS Utilities
    ASUS Update
    Anti-virus software (OEM version)
  • Form Factor
    uATX Form Factor
    9.6 inch x 7.6 inch ( 24.4 cm x 19.3 cm )
  • Note
    *1: Use a chassis with HD audio module in the front panel to support
     an 8-channel audio output.