I've changed the name of my eth1
interface to eth0
. How to ask udev
now to re-read the config?
service udev restart
and
udevadm control --reload-rules
don't help. So is there any valid way except of rebooting? (yes, reboot helps with this issue)
yes, I know I should prepend the commands with
sudo
, but either one I posted above changes nothing inifconfig -a
output: I still seeeth1
, noteth0
.I just changed the
NAME
property of udev-rule line. Don't know any reason for this to be ineffective.
There is no any error in executing of both commands I've posted above, but they just don't change actual interface name in ifconfig -a
output. If I perform reboot - then interface name changes as expected.
For development purposes I write some script that clones virtual machines (VirtualBox-driven) and pre-sets them up in some way.
So I perform a command to clone VM, start it and as long as network interface MAC is changed - udev
adds the second rule to network persistent rules. Right after machine is booted for the first time there are 2 rules:
eth0
, which does not exist, as long as it existed in the original VM image MACeth1
, which exists, but all the configuration in all files refers toeth0
, so it is not that good for me
So I with sed
delete the line with eth0
(it is obsolete and useless in cloned image) and replace eth1
with eth0
. So currently I have valid persistent rule, but there is still eth1
in /dev
.
The issue: I don't want to reboot the machine (it will take another time, which is not good thing on building-VM-stage) and just want to have my /dev
rebuilt with some command so I have ready-to-use VM without any reboots.
eth1
toeth0
? Did you just rename the device file? If so, that's not an effective way to do it (and you should expect the change to be reverted by a successful restart of theudev
daemon). If you used some other method, please describe it in detail, and please also give the complete and exact text of any error messages you're seeing when you run the commands you've tried (for restarting theudev
daemon or reloading its rules). You can edit your question to provide this information.udev
dynamically generates your devices in/dev
. If you restart it, it will regenerate them according to its rules. Changes made directly to them are not, generally speaking, persistent. It looks like restartingudev
is working fine, but that you just haven't properly changed the device names.udev
only adds (not modifies) new rules if it cannot find the one for particular device. If there is a rule that matches - it just follows it without modifications.