Anyone tried to rename the network interface in a running container?
I have tried udev rules and systemd-networkd without any luck. This serverfault hints that it is possible with docker, but I am unsure if all the volume mounts are present in a running balena docker container.
I am running privileged and network_mode=host.
Use case is a device containing 4 NIC which needs to be named explicitly instead of getting the default NIC names
This involves modifying the config.json of the device, which currently is not accessible from application containers, but you may add the necessary udev rules manually from a host OS terminal and reboot the device for those to take place.
Since the udev rule is entered in the json config, the quotes need to be escaped (shown in the docs). One approach is to target the interfaces by their persistent MAC address:
Would it then be possible to manually add the “os” entry to the config.json and then perform balena os configure and hereby get the “os” entry into a flash image?
By doing this I do not need to modify all devices as the os entry is present from when the device was flashed.
Yes, this should be the best approach. You may use a tool like jq to insert the necessary entries in the config.json you would like to inject.
Now the tricky part would be the udev rule. MAC address will not be suitable, so you may play around with udevadm and see how you can target individual interfaces by a slot number or something similar.