Tutorials:Rename your linux network card into a custom name

From Knowledge base
Jump to: navigation, search

If you want to give a name to your network card on Linux, you can!

The default is ethX (eth0, eth1, ...).

$ vim /etc/udev/rules.d/70-persistent-net.rules

Then add :

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:de:b1:0c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="private"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:00:06:13", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="public"

Replace the ATTR{address} with the "mac" address of your card (use ifconfig for this purpose).

Then reboot.

Now you can do "ifconfig private" instead of "ifconfig eth0".

Share your opinion