On Mon, May 28, 2018 at 11:50:05PM +0530, Akshat Kakkar wrote: > 1. How can this survive across reboots without having a custom script > on boot up? Like some ifcfg file,etc.
Every reasonable distribution should provide a way to use more than one address on an interface. But as there is no universal standard for config files and their format, there is no universal standard for listing multiple addresses either. You have to check the documentation of your distribution. > 2. is there a way to tell to make a given ip as primary, irrespective > of order? AFAIK there is no interface allowing to switch the primary address. It only changes when you delete primary address and have promote_secondaries enabled for the interface. Also, don't forget that this primary/secondary distinction is only done for addresses with the same range (which would create the same automatic route), i.e. e.g. 10.0.1.42/24 and 10.0.1.43/24 but not if it's e.g. 10.0.1.42/24 and 10.0.2.42/24. Michal Kubecek