Add an IP address to a server

From Organic Design
Jump to: navigation, search
Procedure.svg Add an IP address to a server
Organic Design procedure

If you're running on a VPS then the network interfaces will be automatically generated, but when running a dedicated server you are responsible for all configuration. Ensure that your provider gives you an additional means of connecting to your server such as a virtual KVM solution because any mistakes in the network configuration can result in complete loss of access to the machine. If such access is not available, back up all data first so that an OS reinstall can be done as a last resort.

Additional IP addresses may require a slightly different format for the /etc/network/interfaces file as in the following example from our server at eSecureData server. Any changes to the networking environment require a restart with /etc/init.d/networking restart.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The primary network interface
auto eth0 lo
iface eth0 inet static
	address 127.0.0.1
	netmask 255.255.255.255
	broadcast 0.0.0.0
iface lo inet loopback

# Primary IP address
auto eth0:0
iface eth0:0 inet static
	address 209.17.190.248
	netmask 255.255.254.0
	network 209.17.190.0
	broadcast 209.17.191.255
	gateway 209.17.190.1
	dns-nameservers 209.139.209.33
	dns-search localdomain

# Second IP address
auto eth0:1
iface eth0:1 inet static
	address 209.17.171.247
	netmask 255.255.254.0
	network 209.17.170.0
	broadcast 209.17.171.255
	gateway 209.17.170.1
	dns-nameservers 209.139.209.33
	dns-search localdomain