Static and virtual IP address

To set static IP address on debian (or derivative distros) is straight forward. A workstation don’t necessarily need to use static addresses, but it’s unavoidable on a server.

The file that needs to be changed is located in /etc/network/ and is called interfaces
This is what the section on eth0 should look like:

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.14
    netmask 255.255.255.0
    gateway 192.168.1.1
    nameserver 192.168.1.2 192.168.1.3

And for setting a virtual address on the same interface add the following

# virtual IPs
auto eth0:1
iface eth0:1 inet static
    address 192.168.1.13
    netmask 255.255.255.0

Simple enough, right? 🙂