I know this question was asked here and there but no answer works for me. After hours of googling I can't figure it out. I have Ubuntu 14 server and I need to make few virtual servers - I want something like VPS in DigitalOcean - Virtual machines with external IP.
So I have an Ubuntu server with couple IPs but only one physical network card.
The host system must be accessible only by the main address 198.201.29.211.
Of course virtual machines should behave like normal physical servers and be also able to connect to host server.
This is my /etc/networking/interfaces file:
# Loopback device:
auto lo
iface lo inet loopback
iface lo inet6 loopback
# device: eth0
auto eth0
iface eth0 inet static
address 198.201.29.211
netmask 255.255.255.192
gateway 198.201.29.193
# default route to access subnet
up route add -net 198.201.29.192 netmask 255.255.255.192 gw 198.201.29.193 eth0
auto eth0:0
iface eth0:0 inet static
address 198.201.29.247
netmask 255.255.255.192
auto eth0:1
iface eth0:0 inet static
address 198.201.29.248
netmask 255.255.255.192
auto eth0:2
iface eth0:0 inet static
address 198.201.29.249
netmask 255.255.255.192
Every IP (except the main one: 198.201.29.211 on eth0) should be exclusively attached to appropriate virtual machine (inside on eth0).