Shared vs Private IP

5 posts / 0 new
Last post
#1 Mon, 11/15/2010 - 15:32
zombiitv

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?

Thanks

Mon, 11/15/2010 - 16:00
Locutus

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. :)

Mon, 11/15/2010 - 18:19
zombiitv

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/create-shared-address.pl line 64

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

Thanks

Mon, 11/15/2010 - 18:41
Locutus

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

Tue, 11/16/2010 - 12:35
zombiitv

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 xxx.xxx.xxx.xxx virtualmin create-domain --domain example.com --shared-ip=xxx.xxx.xxx.xxx -ip-already

I'm doing this in php via the virtualmin class posted here (which I have thoroughly hacked) http://code.google.com/p/virtualmin-php-api/

Hope this helps somebody in the future

Topic locked