HomeRaspberry PiRaspbian Stretch network interface name changes

Raspbian Stretch network interface name changes

Changes are for the best, but also troublesome!

Finally, I got some free time to update Raspbian Jessie to Raspbian Stretch on my Raspberry Pi. Following initial advice, I started from scratch, therefore, everything had to be set as well. I mentioned the Raspbian Stretch network interface name changes in my post, but frankly speaking, I assumed that by default, Raspbian would keep the old names for the sake of the scripts. I was wrong.

Raspbian Stretch network interface name changes

If you check your network interfaces on a new installation of Raspbian Stretch

ifconfig

instead of the familiar  eth0, eth1… & wlan0, wlan1… you will find a new (and bizarre at first) name. It will be something like this: enxb827es19aa14 (I modified mine for security reasons).

The Raspbian Stretch network interface name is generated from your MAC address for that interface and it’s no longer easy to guess without knowing the MAC.

Ethernet MAC AA:BB:CC:DD:EE:FF:GG  ---> enxAA:BB:CC:DD:EE:FF:GG

While this was done to please the enterprise Linux users and their behemoth alike setups, it’s game breaking for many of us – Raspberry Pi users. Each time a piece of code would refer to the interface by eth0/wlan0 – it fails miserably on the new Raspbian Stretch.

Solution

The best solution to this is to disable the Raspbian Stretch network interface name changes at the boot level. You can do this by removing the SD card and adding this line to the cmdline.txt file:

net.ifnames=0

This will disable the new way of naming things and restore the old settings. You don’t have to reinstall the Stretch again. The changes will apply after the next reboot.
You can also do this via configuration menu:

 sudo raspi-congif

In the network interfaces, you will find the option to toggle the names. Names should be set to the correct names by default. If you want to enable the new naming scheme – use the option provided.

If your scripts are not working after the new update consider either changing the cmdline.txt, or look up your new interface name and update the relevant files by replacing each instance of the wlan/eth with a new name. I wrote this, as it is easier to reference the changes in my older tutorials than writing instructions for each previously created page.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

M5Paper

Programable, ESP32 based awesome dev platform with 4.7 e-ink display by M5Stack

More HATs

client-image
client-image

Argon One M.2

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO and M.2 SSD support

More cases on

client-image
client-image

Best Raspberry Pi Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

Slow Internet Warning

0
From time to time my Internet grinds to a stop. Since Raspberry Pi 4 comes with a 1Gbps Ethernet, I decided to take advantage of it and create a reporting system in NodeRED that will monitor and report when the ISP is not keeping the contractual agreements. Works with Alexa, Google Home, Android and Windows 10.

How fast Raspberry Pi NAS is?

0
Let's see how fast Raspberry Pi NAS really is?

Argon18: Argon ONE SSD modification

0
Argon One case just got better - now you can boot it from USB without ruining the design thanks to Argon 18: Argon One SSD modification

HOW TO...

How to boot Raspberry Pi 5 from NVMe M.2 SSD

0
This is how you can boot your Raspberry PI 5 from NVMe in 10 min! Check out these easy instructions

It took me 2 months to boot CM4 from NVMe

0
Complete beginners guide to Compute Module 4 boot from NVMe.

Raspberry Pi Zero 2 W vs other Zero boards

0
It's time to test the Raspberry Pi Zero 2 W against other Raspberry Pi boards from Zero series: power, WiFi, temperature and core performance

C/C++ and MicroPython SDK for Raspberry Pi Pico on Windows

0
A guide to SDK toolchain for Raspberry Pi Pico and C/C++ , Micropython on Windows.

A comprehensive guide to Grafana & InfluxDB

0
How to use Grafana and InfluxDB on Raspberry Pi for IoT sensors in home automation