I'm configuring a small server installation that I've installed on an external hard drive and which I'd like to be able to move between (real and virtual) machines from time to time.
When I first tried to move the installation to a different computer, the network device didn't configure itself automatically. I figured out this was because the network interface name was different on that device, so the entries in
/etc/network/interfaces didn't apply to it.
Is there a nice way of telling an Ubuntu server that it should simply automatically configure all connected network devices on boot?
My current workaround is to use the kernel boot parameter
net.ifnames=0to disable predictable network interface names so that the first network interface appears as the old-fashioned
eth0on both machines and to just change the entries in
/etc/network/interfacesto refer to
I also considered using NetworkManager, which I understand can be set up to do this unconditional autoconfiguration, and has a text-based management interface that's suitable for a server. My only problem with this approach is that its dependencies pull in much of the X11 and GNOME libraries (291 MB of them on my system), which feels like overkill.
Writing a little script to run on boot that will take the devices found in
/sys/class/netand spit out a file into
/etc/network/interfaces.dto configure them. If that's a good option, where and when would it be appropriate to run that?
Something awesome I haven't thought of? *fingers crossed*