I'm assigning automatically a secondary private IPv4 address during launch of my instances. To configure Ubuntu to recognize this secondary IP I need to run
ip addr add 10.0.1.15/24 dev eth0
To access the primary private IP address I have found this command (described in the AWS Docs and in figaros question):
curl http://169.254.169.254/latest/meta-data/local-ipv4
But how can I get the secondary IP address to run the ip command automatically on startup? For Amazon Linux Systems there's the ec2-net-utils package wich can handle this automatically.