Converting shared IPs into private/dedicated ones

1 post / 0 new
#1 Sat, 01/21/2017 - 00:15
sober_october
sober_october's picture

Converting shared IPs into private/dedicated ones

Hello!

I probably should provide a little background info about my setup and what I'm ultimately trying to achieve. I have a Debian 8 VPS with 2 static IP addresses on a same NIC:

root@VM-4720-21616-01:~# ip a show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:15:5d:bb:ab:ee brd ff:ff:ff:ff:ff:ff
    inet 185.26.114.59/22 brd 185.26.115.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 185.26.115.254/22 brd 185.26.115.255 scope global secondary eth0:0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:febb:abee/64 scope link
       valid_lft forever preferred_lft forever

This VPS is supposed to host only 2 websites. Both should have their own IPs in case I might consider installing SSL certs on them at some point.

After installing Virtualmin via the install.sh script this is how it detected my network config: http://imgur.com/a/v3qH9

The default NIC for virtual addresses is eth0. For some reason eth0:0 could not be selected for vhosts until it was explicitly added via this command:

root@VM:~# virtualmin create-shared-address --ip 185.26.115.254
Created shared IP address 185.26.115.254

root@VM-4720-21616-01:~# virtualmin list-shared-addresses
Address              Type                 Reseller name                
-------------------- -------------------- ------------------------------
185.26.114.59        System default                                    
185.26.115.254       Shared address  

Now I can choose between the two addresses when I want to create another vhost: http://imgur.com/a/yE34m

However, even when there were no vhosts created, I could not assign a virtual server to "Virtual with IP" option as it would give me an error: Failed to change IP address : The virtual interface IP address is already in use

If I go to Server configuration --> Change IP address for a particular domain in the Use dedicated address there'll be no drop-down to select an address: http://imgur.com/a/p44YX And if type the IP that the site currently is on manually, it'll throw: Failed to change IP address : The virtual interface IP address is already in use

So my main question is how can I convert my shared IPs into dedicated ones? I didn't find any CLI methods that could perform this operation:

root@VM:~# virtualmin --help | grep -i address
create-shared-address     Adds an IP address for use by multiple virtual servers
delete-shared-address     Removes an IP address that can be used by virtual
list-shared-addresses     Lists shared IP addresses for virtual servers

Coming from Plesk I remember that it had an option to explicitly set your IPs either as as "exclusive" or "shared" ones. How can this be done in Virtualmin? Is there something I miss?

Thanks in advance!