Open kingsd041 opened 6 years ago
70-persistent-net.rules
depends on /lib/udev/write_net_rules
, It is a traditional way and no longer popular now.
ID_NET_NAME_PATH is commonly used to name NIC devices, like: enpxxx, ensxxxx.
But RancherOS uses rancher.network.interfaces.eth*.dhcp=trye
to enable the network by default.
In order to be compatible with more scenes, we removed ID_NET_NAME_PATH naming rules.
https://github.com/rancher/os/blob/master/images/01-base/Dockerfile#L2
FROM rancher/os-rootfs
RUN ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules #here
Refer to:
RancherOS Version: (ros os version) 1.4.1 Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.) VirtualBox
Use docker-machine to launch a rancheros, wait for OS to start successfully and check the mac address. We can see that the mac address of eth0 is
08:00:27:f8:5d:1c
eth1 is08:00:27:d4:dd:81
Then add a third NIC in the virtualbox and restart the OS. At this point, the mac address of eth1 becomes
08:00:27:db:cc:14
, and the mac address of eth2 becomes08:00:27:d4:dd:81
I tried to solve this problem by modifying /etc/udev/rules.d/70-persistent-net.rules. But unfortunately, there is no 70-persistent-net.rules file under /etc/udev/rules.d/.