<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Udev</id>
	<title>Udev - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Udev"/>
	<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Udev&amp;action=history"/>
	<updated>2026-04-25T04:57:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Udev&amp;diff=195&amp;oldid=prev</id>
		<title>Ardika Sulistija: Created page with &quot;Read more: https://dev.to/enbis/how-udev-rules-can-help-us-to-recognize-a-usb-to-serial-device-over-dev-tty-interface-pbk  Udev is the mechanism used to create and name /dev device nodes corresponding to the devices that are present in the system. Udev uses matching information provided by sysfs with rules provided by the user to dynamically add the required device nodes.  Udev rule files are kept in the /etc/udev/rules.d/ directory.  I.e:  $ cat /etc/udev/rules.d/70-per...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Udev&amp;diff=195&amp;oldid=prev"/>
		<updated>2024-09-11T14:34:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Read more: https://dev.to/enbis/how-udev-rules-can-help-us-to-recognize-a-usb-to-serial-device-over-dev-tty-interface-pbk  Udev is the mechanism used to create and name /dev device nodes corresponding to the devices that are present in the system. Udev uses matching information provided by sysfs with rules provided by the user to dynamically add the required device nodes.  Udev rule files are kept in the /etc/udev/rules.d/ directory.  I.e:  $ cat /etc/udev/rules.d/70-per...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Read more: https://dev.to/enbis/how-udev-rules-can-help-us-to-recognize-a-usb-to-serial-device-over-dev-tty-interface-pbk&lt;br /&gt;
&lt;br /&gt;
Udev is the mechanism used to create and name /dev device nodes corresponding to the devices that are present in the system. Udev uses matching information provided by sysfs with rules provided by the user to dynamically add the required device nodes.&lt;br /&gt;
&lt;br /&gt;
Udev rule files are kept in the /etc/udev/rules.d/ directory.&lt;br /&gt;
&lt;br /&gt;
I.e:&lt;br /&gt;
 $ cat /etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
 SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;, ATTR{address}==&amp;quot;12:af:cc:bc:6e:e9&amp;quot;, NAME=&amp;quot;eth0&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 $ ifconfig -a&lt;br /&gt;
 eth0: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 9001&lt;br /&gt;
        inet 172.31.69.228  netmask 255.255.240.0  broadcast 172.31.79.255&lt;br /&gt;
        inet6 fe80::1495:34ff:fe57:6f13  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
        ether 16:95:34:57:6f:13  txqueuelen 1000  (Ethernet)&lt;br /&gt;
        RX packets 43073  bytes 61456011 (58.6 MiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 7407  bytes 453917 (443.2 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
 &lt;br /&gt;
 $ ls -al /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
 -rw-r--r--. 1 root root 174 Jun  3 15:52 /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
 &lt;br /&gt;
 $ cat /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
 # Created by cloud-init on instance boot automatically, do not edit.&lt;br /&gt;
 #&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
 HWADDR=12:14:7e:90:ad:77&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 STARTMODE=auto&lt;br /&gt;
 TYPE=Ethernet&lt;br /&gt;
 USERCTL=no&lt;br /&gt;
&lt;br /&gt;
To manually change it to &amp;quot;ens5&amp;quot; you can do so by following the steps below:&lt;br /&gt;
 $ sudo vi /etc/udev/rules.d/70-persistent-net.rules &lt;br /&gt;
 &lt;br /&gt;
 # change NAME=&amp;quot;eth0&amp;quot; to NAME=&amp;quot;ens5&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 $ sudo cat /etc/udev/rules.d/70-persistent-net.rules&lt;br /&gt;
 SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;, ATTR{address}==&amp;quot;12:14:7e:90:ad:77&amp;quot;, NAME=&amp;quot;ens5&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # Then create the ifcfg-ens5 file:&lt;br /&gt;
 $ sudo cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-ens5&lt;br /&gt;
 &lt;br /&gt;
 $ sudo vi /etc/sysconfig/network-scripts/ifcfg-ens5&lt;br /&gt;
 &lt;br /&gt;
 # contents should be:&lt;br /&gt;
 BOOTPROTO=dhcp&lt;br /&gt;
 DEVICE=ens5              &amp;lt;---------- change device=ens5&lt;br /&gt;
 HWADDR=12:14:7e:90:ad:77&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
 STARTMODE=auto&lt;br /&gt;
 TYPE=Ethernet&lt;br /&gt;
 USERCTL=no&lt;br /&gt;
 &lt;br /&gt;
 $ sudo reboot&lt;br /&gt;
 &lt;br /&gt;
 $ ifconfig -a&lt;br /&gt;
 ens5: flags=4163&amp;lt;UP,BROADCAST,RUNNING,MULTICAST&amp;gt;  mtu 9001&lt;br /&gt;
        inet 172.31.84.21  netmask 255.255.240.0  broadcast 172.31.95.255&lt;br /&gt;
        inet6 fe80::1014:7eff:fe90:ad77  prefixlen 64  scopeid 0x20&amp;lt;link&amp;gt;&lt;br /&gt;
        ether 12:14:7e:90:ad:77  txqueuelen 1000  (Ethernet)&lt;br /&gt;
        RX packets 95  bytes 12184 (11.8 KiB)&lt;br /&gt;
        RX errors 0  dropped 0  overruns 0  frame 0&lt;br /&gt;
        TX packets 89  bytes 10593 (10.3 KiB)&lt;br /&gt;
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can disable predictable network interface names by adding the &amp;lt;b&amp;gt;net.ifnames=0&amp;lt;/b&amp;gt; option to the &amp;lt;b&amp;gt;GRUB_CMDLINE_LINUX&amp;lt;/b&amp;gt; line in &amp;lt;b&amp;gt;/etc/default/grub&amp;lt;/b&amp;gt;  file on your source machine. I have tested this in my lab and after making the required changes (adding net.ifnames=0) on my source machine, the target machine(instance type M5) got launched with one network interface file only i.e. ifcfg-eth0.&lt;br /&gt;
&lt;br /&gt;
Below are the steps to disable predictable network interface.&lt;br /&gt;
&lt;br /&gt;
Note: Before making any changes on your source, I would recommend you take backup of /etc/default/grub file (maybe in your home directory).&lt;br /&gt;
&lt;br /&gt;
1. Login to your source machine and disable predictable network interface names by adding the net.ifnames=0 option to the GRUB_CMDLINE_LINUX line in /etc/default/grub file, by using below command &lt;br /&gt;
 $ sudo sed -i &amp;#039;/^GRUB\_CMDLINE\_LINUX/s/\&amp;quot;$/\ net\.ifnames\=0\&amp;quot;/&amp;#039; /etc/default/grub&lt;br /&gt;
&lt;br /&gt;
2. Rebuild the Grub configuration:&lt;br /&gt;
 $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Removing Mac address in udev====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you create an AMI from an existing instance, and then launch a new instance from said AMI, udev will have an existing rule for eth0. When a new instance is launched, it launches with an ENI that has a different MAC address. Because of this, the new network interface will not match against the existing udev rule. Hence your Instance status checks were failing.&lt;br /&gt;
&lt;br /&gt;
For future references you can comment out the HWADDR line from etc/network-scripts/icfg-eth0 and also comment out the below line from /etc/udev/rules.d/70-persistent-net.rules before taking an AMI which would not hardcode the HWADDR for the instances you launch using the AMI. You can read more about the udev 70-persistent-net rules here[1][2].&lt;br /&gt;
&lt;br /&gt;
 *** /etc/udev/rules.d/70-persistent-net.rules ***&lt;br /&gt;
 SUBSYSTEM==&amp;quot;net&amp;quot;, ACTION==&amp;quot;add&amp;quot;, DRIVERS==&amp;quot;?*&amp;quot;, ATTR{address}==“&amp;lt;HW-ADDR&amp;gt;“, NAME=&amp;quot;eth0&amp;quot;    // Needs to be commented&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
</feed>