Saturday, May 26, 2012

Change Network Interface Name

Changing network interface name is sometimes handy to do. I personally like to have my interfaces sorted out and have Ethernet as eth0, eth1 etc and wireless interfaces staring with wlan0. This makes running commands easier without having to think how my primary wireless interface was called on my machine. Defaults are eth0 and wlan0 for wired and wireless network interfaces and I like to keep them this way.

To determine your network interface names run
iwconfig

To change a network interface name you need to edit it in
/etc/udev/rules.d/70-persistent-net.rules~

so open it with gedit for example
sudo gedit /etc/udev/rules.d/70-persistent-net.rules~

The file is very short, easy to read and modify. You need to change the NAME tags to rename the interface. So for example if you currently have an eth1 interface that is actually your default wireless interface then you can look for NAME="eth1" and change it to NAME="wlan0".

Unfortunately changes take effect only after reboot in this case. 

No comments:

Post a Comment