# Shared vs Private IP

**URL:** <https://forum.virtualmin.com/t/shared-vs-private-ip/37898>\
**Category:** Virtualmin\
**Created:** [November 15, 2010, 9:32pm UTC](https://forum.virtualmin.com/t/shared-vs-private-ip/37898 "2010-11-15T21:32:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zombiitv](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/z/6a8cbe/32.png) [@zombiitv](https://forum.virtualmin.com/u/zombiitv)\
**Post date:** [November 15, 2010, 9:32pm UTC](https://forum.virtualmin.com/t/shared-vs-private-ip/37898/1 "2010-11-15T21:32:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Locutus](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/l/90ced4/32.png) [@Locutus](https://forum.virtualmin.com/u/Locutus)\
**Post date:** [November 15, 2010, 10:00pm UTC](https://forum.virtualmin.com/t/shared-vs-private-ip/37898/2 "2010-11-15T22:00:26Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![zombiitv](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/z/6a8cbe/32.png) [@zombiitv](https://forum.virtualmin.com/u/zombiitv)\
**Post date:** [November 16, 2010, 12:19am UTC](https://forum.virtualmin.com/t/shared-vs-private-ip/37898/3 "2010-11-16T00:19:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Locutus](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/l/90ced4/32.png) [@Locutus](https://forum.virtualmin.com/u/Locutus)\
**Post date:** [November 16, 2010, 12:41am UTC](https://forum.virtualmin.com/t/shared-vs-private-ip/37898/4 "2010-11-16T00:41:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zombiitv](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/z/6a8cbe/32.png) [@zombiitv](https://forum.virtualmin.com/u/zombiitv)\
**Post date:** [November 16, 2010, 6:35pm UTC](https://forum.virtualmin.com/t/shared-vs-private-ip/37898/5 "2010-11-16T18:35:16Z")

</div>

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](http://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/](http://code.google.com/p/virtualmin-php-api/)

Hope this helps somebody in the future

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [April 30, 2020, 5:50am UTC](https://forum.virtualmin.com/t/shared-vs-private-ip/37898/6 "2020-04-30T05:50:25Z")

</div>

Closed on April 30, 2020, 5:50am UTC


