Rename instance interfaces based on VLAN

asked 2014-07-22 23:04:10 -0500

ssgelm gravatar image

I am looking to rename the ethernet interfaces in instances based on the VLAN of the network it is attached to. For example if by default I have 2 interfaces:

eth0 -> vlan 10

eth1 -> vlan 20

I would want to rename them to:

eth10 -> vlan 10

eth20 -> vlan 20

I know I can do this by passing in userdata and parsing it on boot from the config drive but is there any way to figure out what networks are attached to an instance without having to pass the information in? From what I can tell there is no way to figure it out but it would be unfortunate to have to rely on userdata being passed in. Any ideas?

edit retag flag offensive close merge delete