TLDR; How do you apply changes to /etc/udev/rules.d/70-persistent-net.rules without restarting? (See this documentation about ethernet interface logical names.)
Long version:
I have a bootable USB flash drive running an image made by remastersys of 11.04. I want to be able to use this bootable USB drive to run a DHCP server from any computer. To do this, I have to assign a static IP address to eth0 in /etc/network/interfaces and reference eth0 in /etc/default/isc-dhcp-server.
However, the network card is assigned ethX based on MAC address, so this only works on the first computer where the USB flash drive is used -- each subsequent computer's NIC will be assigned to eth1, eth1, etc.
It seems that there are two strategies that could work to solve this problem:
- Dynamically rewrite
/etc/network/interfacesand/etc/default/isc-dhcp-serverbased on the firstethXthat comes up when you runifconfig-- this should be whatever NIC is actually in the computer. - Rewrite
/etc/udev/rules.d/70-persistent-net.rulesso that whatever MAC address is assigned to the NIC is namedeth0.
I know I can do #1 because changes to these files can be applied by restarting networking and isc-dhcp-server.
However, #2 seems cleaner to me as I believe the /etc/udev/rules.d/70-persistent-net.rules will build up a bunch of crud as this USB drive is used in different computers.
Any help would be appreciated.