{"id":856,"date":"2015-11-14T23:09:11","date_gmt":"2015-11-14T22:09:11","guid":{"rendered":"http:\/\/www.hauweele.net\/~gawen\/blog\/?p=856"},"modified":"2015-11-15T12:17:38","modified_gmt":"2015-11-15T11:17:38","slug":"rename-interfaces-on-linux","status":"publish","type":"post","link":"https:\/\/hauweele.net\/~gawen\/blog\/?p=856","title":{"rendered":"Rename interfaces on Linux"},"content":{"rendered":"<p>I just reinstalled a Debian stable on a laptop but messed with the interfaces so that an external USB WiFi card appeared as <i>wlan0<\/i> while the main card appeared as <i>wlan1<\/i>. In case you wondered you can rename or reset interface names in <code>\/etc\/udev\/rules.d\/70-persistent-net.rules<\/code>. That&#8217;s on systemd though.<br \/>\nI wonder how we can change that on sysvinit? Nobody cares, probably, but I do.<\/p>\n<p>According to what I <a href=\"https:\/\/ivi.fnwi.uva.nl\/sne\/air\/\/wiki\/LogicalInterfaceNames\">read there<\/a>, it is not consistent. Interfaces are named in the order in which they appear during the boot process. However it is possible to use <i>ifrename<\/i> from the <a href=\"http:\/\/www.labs.hpe.com\/personal\/Jean_Tourrilhes\/Linux\/Tools.html\">wireless tools<\/a> package. Why this tool that should work for all type of interface is part of the wireless tools package is beyond my comprehension. But hey whatever, Linux, and it just works.<\/p>\n<p>If you are curious and want to know how ifrename actually does rename an interface, according to the code it uses a <code>SIOCSIFNAME<\/code> ioctl on a socket file descriptor. There it passes a <code>struct ifreq<\/code> in which you can provide a new name for the interface. Just man <i>netdevice(7)<\/i> for more info.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just reinstalled a Debian stable on a laptop but messed with the interfaces so that an external USB WiFi card appeared as wlan0 while the main card appeared as wlan1. In case you wondered you can rename or reset &hellip; <a href=\"https:\/\/hauweele.net\/~gawen\/blog\/?p=856\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[645,6,141,647,46,644,396,646,576],"class_list":["post-856","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-interface","tag-linux","tag-multiple","tag-name","tag-network","tag-rename","tag-systemd","tag-sysvinit","tag-wifi"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=856"}],"version-history":[{"count":0,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/856\/revisions"}],"wp:attachment":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}