Adding a 2nd IP - Linux


What is the recommended way to add a second IP into the Linux (Ubuntu) config ?

eth0:0 in /etc/network/interfaces ?

Any routing needed ?
What mask to use ?


To add manually, you can do it using ip like this:

ip a add dev eth0

Or using /etc/network/interfaces so it comes up at boot:

auto eth0:1
iface eth0:1 inet static

For our additional ip addresses, the netmask is as it’s just a single ip routed to your primary ip.