0

sorry for my English....

I am with Linux Mint

I to try to change my interface name but without result...

The steps which I to does...

First search for my interface name and mac from it,

ip a

to come, interface name enp0s3, mac address 08:00:27:2e:7a:49.

Seconds set down the interface,

sudo ip link set dev enp0s3 down

Rename the device name, I'll change to eth0.

Call the 70-persistent-net.rules file,

sudo gedit /etc/udev/rules.d/70-persistent-net.rules

and write,

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:2e:7a:49", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

I call the interfaces file,

sudo gedit /etc/network/interfaces

and write,

auto eth0
iface eth0 inet static
address 192.168.178.48
netmask 255.255.255.0
gateway 192.168.178.1

Then, the computer new start...

On Terminal write,

ip a

but have similar interface name, enp0s3.

Can Please someone help me with this problem, Thanks!

dsaj34v
  • 3
  • 3
  • 4

1 Answers1

0

Try this methods:

You basically have two options:

  1. You disable the assignment of fixed names, so that the unpredictable kernel names are used again. For this, simply mask udev's rule file for the default policy:

$ ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules

  1. You create your own manual naming scheme, for example by naming your interfaces "internet0", "dmz0" or "lan0". For that create your own .link files in /etc/systemd/network/, then choose an explicit name or a better naming scheme for one, some, or all of your interfaces. See systemd.link(5) for more information.

You pass the net.ifnames=0 on the kernel command line

I tested systemd.link method. It is works! systemd.link

kenlukas
  • 2,886
  • 2
  • 14
  • 25
Oxyd
  • 126
  • 6
  • Very Thanks for your answer!, I do `sudo ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules`, and new start, but the interface name not change... – dsaj34v Mar 04 '20 at 12:51
  • systemd.link method works! See my updated answer. – Oxyd Mar 04 '20 at 13:08
  • I don't if to play one's part, but I to try it on VirtualBox... – dsaj34v Mar 04 '20 at 13:19
  • Very Thanks for your patience... I think my problem missing a step.., where should to write `[Match]` and `[link]` ? – dsaj34v Mar 04 '20 at 13:31
  • @dsaj34v I am test only this(systemd) method. I am not test udev rule link method. Of course reboot needed for take effect. – Oxyd Mar 04 '20 at 13:36
  • I found the problem!, on my file `sudo gedit /etc/udev/rules.d/70-persistent-net.rules`, I to write `KERNEL=="eth*"`, when does not it, as here to say https://askubuntu.com/questions/767786/changing-network-interfaces-name-ubuntu-16-04 – dsaj34v Mar 04 '20 at 13:42
  • Now to come to my new interface name!, `eth0`... I wish your a niceeeeee Day! – dsaj34v Mar 04 '20 at 13:45
  • @dsaj34v Nice! :-) – Oxyd Mar 04 '20 at 13:47