Shared vs Private IP

I have been adding virtual servers via a command line script and as I went to add a second virtual server to an IP address that was already assigned - I started to get some errors. I have since figured out that I needed to add the IP’s to the “shared” list and used the switch --shared-ip vice --ip in order to add multiple servers to the same IP address.

Is there any way to switch a private IP address to a shared one in Virtualmin? The only way I can figure out how to do this is to delete all of the servers that I have created, put my list of IP addresses in the shared IP list and then re-create everything. Was hoping there would be an easier way.

Also is there a command line function that would allow me to add IP addresses to this shared list via script?


Shared addresses can be added with the shell command

virtualmin create-shared-address

Changing the IP address of an existing vserver can be done with

virtualmin modify-domain --domain domain.tld --shared-ip address

or if you wish to set it to the default shared IP, with

virtualmin modify-domain --domain domain.tld --default-ip

No guarantee for those commands though. I haven’t tested them, just grabbed them from the documentation/help list. :slight_smile:

It looks like the create-shared-address command will do what I want it to, but I’m getting this error when I run it:

Undefined subroutine &virtual_server::list_resellers called at /usr/libexec/webmin/virtual-server/ line 64

I’m running Centos 5.5 - installed via script and have Virtualmin version 3.81.gpl GPL


Hmm, resellers is a Pro feature. It would seem that the GPL version of the script does not take that into account there. :slight_smile: I suppose the coders will need to take a look at this.

I solved this by removing the reference to list_resellers on line 64 and then deleted all of my virtual servers and ran the create-shared-address script before I ran the create-domain with a shared-ip flag…

I had the eth0’s assigned (my sys admins did this when they set up my server), if yours are not set, you will not need the --ip-already flag.

virtualmin create-shared-address --ip
virtualmin create-domain --domain -ip-already

I’m doing this in php via the virtualmin class posted here (which I have thoroughly hacked)

Hope this helps somebody in the future