Monday, December 14, 2015

Network Interfaces Name change in Ubuntu 15.10 (Wily Werewolf)

http://www.ubuntugeek.com/network-interfaces-name-change-in-ubuntu-15-10-wily-werewolf.html

In Wily Werewolf, starting with systemd/udev will automatically assign predictable, stable network interface names for all local Ethernet, Wlan and Wwan interfaces.

The following different naming schemes for network interfaces are now supported by udev natively:
1) Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1)
2) Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1)
3) Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0)
4) Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da)
5) Classic, unpredictable kernel-native ethX naming (example: eth0) -- deprecated
Example
In my case i have installed ubuntu 15.10 server in virtualbox and my interface naming started with "enp0s3" and now when i try to add second interface i didn't know what is the interface name so i have to use the following command to find which inteface it assigned
ip link
Output
1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s3: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 08:00:27:5f:dd:a1 brd ff:ff:ff:ff:ff:ff
3: enp0s8: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 08:00:27:30:2d:00 brd ff:ff:ff:ff:ff:ff
From the above output the new network card interface name is "enp0s8"
Change the default network interface names
You can change the device name by defining the name manually with an udev-rule.These rules will be applied automatically at boot.
First you need to get the MAC address using "ip link" command.I have showed the output of ip link from the above i can see mAC address is "08:00:27:30:2d:00".You need to create 10-network.rules file
sudo vi /etc/udev/rules.d/10-network.rules
Add the following line
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="08:00:27:30:2d:00″,KERNEL=="enp0s8″, NAME="eth1″
From the above command you have to replace MAC:ADDRESS with your interface mac address and KERNEL=="" to what your kernel is naming the device when it boots.
Save and exit the file and reboot your ubuntu system.After reboot my interface name should be eth1.

No comments:

Post a Comment