I am trying to use the --ip option in a create-domain shell call. Here’s what the docs say on the subject
“To create a virtual server with a private IP address, you can use the --ip option to specify it explicitly. If your Virtualmin is configured to automatically allocate IP addresses, use the --allocate-ip option instead, to have a free address chosen from the allocation ranges. If you want to use a virtual IP that is already active on the system, you must add the --ip-already command-line option.”
I read that to mean that if I use --ip (any ip address) then virtualmin should create a virtual server on that ip address. When I use this command I get the following error:
“The virtual interface IP address is already in use”
I can add the ip address in the “Addresses and Networking - Shared IP Addresses” and then use the option --shared-ip and it works fine - that’s not what I’m trying to do.
I want to assign an ip address from script without having to log into Virtualmin and type it in the shared box.
When you specify the “–ip” option, VMin will not only create the server with that IP assigned, but will also try to create a new virtual eth device, like “eth0:0” in your system (depending on the setting “Base number for virtual interfaces” in System Settings -> Virtualmin Configuration -> Advanced options), and assign that the given IP.
If you already have that IP assigned to a virtual eth, you also need to specify “–ip-already” so VMin will not try to create it.
Well, actually, that information already is in the documentation, although maybe not as extensive as I put it. It reads: “If you want to use a virtual IP that is already active on the system, you must add the --ip-already command-line option.”
“Active” here means what I described: the IP is already assigned to a virtual eth.