Debian ifname with systemd

systemd is bad and is good

yea, we have no many option to live with that and configure the machine who we like, but I have several problem to deal with the new Interface Name, they call it PredictableInterfaceName

I don’t see nothing predictable from a name like ‘eno1’ or ‘ens3f0’

So they change from ‘eth0’ or ‘wlan0’ for security reason, some attacker can plug something and use eth0 to sniff and also other kind of attack.

Then I did some research and I discover systemd.link to solve this strange names with systemd and then I found a solution which works and I like to use in Debian to have a usable interface name.

1. Go in /etc/systemd/network

2. Create a new file called 10-lan0.link
and put some code inside like this:

[Match]
MACAddress=64:66:b3:04:9d:00
[Link]
Description=lan 
MACAddressPolicy=persistent 
Name=lan0

(*) note: you need to change the mac address

 

3. add as many file you like for every ifname you want to change

4. update the file /etc/network/interfaces using the new ifname

5. restart your system

 

enjoy