{"id":5821,"date":"2018-10-10T21:15:14","date_gmt":"2018-10-10T19:15:14","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=5821"},"modified":"2018-10-12T07:50:20","modified_gmt":"2018-10-12T05:50:20","slug":"linux-disable-assignment-of-new-names-for-network-interfaces","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/linux-disable-assignment-of-new-names-for-network-interfaces\/","title":{"rendered":"Linux: Disable assignment of new styled names for network interfaces"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_5821 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_5821')){$('.twoclick_social_bookmarks_post_5821').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Linux%3A%20Disable%20assignment%20of%20new%20styled%20names%20for%20network%20interfaces\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Anewer%20Linux%20distribution%20do%20assign%20network%20names%20like%20enp0s13%20or%20eno1%20instead%20of%20the%20old%20style%20ethx%20names.%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/linux-disable-assignment-of-new-names-for-network-interfaces\\\/\",\"post_id\":5821,\"post_title_referrer_track\":\"Linux%3A+Disable+assignment+of+new+styled+names+for+network+interfaces\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>newer Linux distribution do assign network names like enp0s13 or eno1 instead of the old style ethx names.<br \/>\n<!--more--><\/p>\n<p>This feature is called Predictable Network Interface Names and should name each interface in an reproducible way. The previous method had some problems if more then one NIC Adapters are connected. Sometimes, after a reboot, the name ethx has switched between the interfaces.<\/p>\n<p>Predictable Network Interface Names are introduced with systemd v197.<\/p>\n<p>To switch to the old method you have to append 2 kernel parameters. <\/p>\n<p>For debian\/ubuntu systems edit <strong>\/etc\/default\/grub<\/strong>. Locate the line<br \/>\n<code><br \/>\nGRUB_CMDLINE_LINUX=\"\"<br \/>\n<\/code><br \/>\nand append <strong>net.ifnames=0 biosdevname=0<\/strong><br \/>\n<code><br \/>\nGRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"<br \/>\n<\/code><br \/>\nthen update the \/boot\/grub\/grub.cfg by<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev:~# update-grub\r\n<\/pre>\n<p>On a Raspberry Pi edit <strong>\/boot\/cmdline.txt<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev:~# nano \/boot\/cmdline.txt\r\n<\/pre>\n<p>and append <strong>net.ifnames=0 biosdevname=0<\/strong>. For example<br \/>\n<code><br \/>\ndwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=\/dev\/mmcblk0p2 apparmor=1 security=apparmor rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait net.ifnames=0 biosdevname=0<br \/>\n<\/code><br \/>\nThen reboot your device <\/p>\n<p><strong>Note:Be aware you have to reconfigure your network settings after changing the network name convention!! <\/strong>. For example add an additional entry for eth0 in \/etc\/network\/interfaces otherwise you will get no IP Address from DHCP after a reboot.<br \/>\n<code><br \/>\n# The loopback network interface<br \/>\nauto lo<br \/>\niface lo inet loopback<\/p>\n<p># The primary network interface<br \/>\nallow-hotplug enp0s3<br \/>\niface enp0s3 inet dhcp<\/p>\n<p># Fallback unpredictable<br \/>\nallow-hotplug eth0<br \/>\niface eth0 inet dhcp<br \/>\n<\/code><\/p>\n<p>Another generally way is to directly editing <strong>\/boot\/grub\/grub.cfg<\/strong>. But be aware. Syntax errors may prevent your device from booting!!<br \/>\nSet permissions for edit and open \/boot\/grub\/grub.cfg<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev:~# ls -l \/boot\/grub\/grub.cfg\r\n-r--r--r-- 1 root root 5855 Okt  9 08:23 \/boot\/grub\/grub.cfg\r\nroot@debdev:~# chmod u+w \/boot\/grub\/grub.cfg\r\nroot@debdev:~# vi u+w \/boot\/grub\/grub.cfg\r\n<\/pre>\n<p>Then locate your boot entry(ies) beginning with <strong>linux<\/strong> and append the parameters<br \/>\n<code><br \/>\nlinux   \/boot\/vmlinuz-4.9.0-7-686 root=\/dev\/sda1 ro  quiet net.ifnames=0 biosdevname=0<br \/>\n<\/code><br \/>\nand set permissions back.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nroot@debdev:~# vi u-w \/boot\/grub\/grub.cfg\r\n<\/pre>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, newer Linux distribution do assign network names like enp0s13 or eno1 instead of the old style ethx names.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[62,224,544,213,144,1251,818],"class_list":["post-5821","post","type-post","status-publish","format-standard","hentry","category-linux","tag-disable","tag-linux-2","tag-names","tag-network","tag-new","tag-predictable-network-interface-names","tag-systemd"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=5821"}],"version-history":[{"count":12,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5821\/revisions"}],"predecessor-version":[{"id":5854,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5821\/revisions\/5854"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=5821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=5821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=5821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}