Did "--ip-already" go away? (Is "--shared-ip" fundamentally the same?)

If I try to use:

virtualmin modify-domain --domain [a-domain] --ip [an-ip]

It breaks if the IP is already on the box:

ip addr add 10.226.13.9/22 broadcast 10.226.13.9 dev ens18 failed : Error: ipv4: Address already assigned.

Humorously if the IP is not yet on the box, when I run the same command:

virtualmin modify-domain --domain [a-domain] --ip [an-ip]

It changes /etc/netplan/50-cloud-init.yaml from something like this:

network:
  version: 2
  ethernets:
    ens18:
      addresses:
      - "10.226.144.99/22"
      nameservers:
        addresses:
        - 10.226.13.1
        - 10.226.13.2
        search:
        - fsr.com
      routes:
      - to: "default"
        via: "10.226.1.1"

to this:

network:
version: 2

  ethernets:
        ens18:
            addresses: ['10.226.13.9/22']
            nameservers:
                addresses: [10.226.13.1, 10.226.13.2]
                search: [fsr.com]
            routes:
              - to: "default"
                via: "10.226.1.1"

Which of course works just fine with the new IP… until a reboot, because the original IP isn’t there anymore and so does not answer.

That would be a super fun feature to find out about after a middle of the night emergency reboot three months after I’d run any such command!

Some forum hits:

https://forum.virtualmin.com/t/assigning-ip-address-via-shell/37806/3
https://forum.virtualmin.com/t/shared-vs-private-ip/37898/4

Mention using “–ip-already” for this, but I get:

Unknown parameter --ip-already

Whether I use it either of these ways:

virtualmin modify-domain --domain [a-domain] --ip-already [some-IP] 
virtualmin modify-domain --domain [a-domain] --ip [some-IP] --ip-already

It seems like:

virtualmin modify-domain --domain [a-domain] --shared-ip [some-IP]

Does what I would expect that “–ip-already” used to do, but am I right about that? (It’s the “shared” thing in the name that throws me in this case because I am specifically trying to set a unique IP for a single virtual server in this case… so the opposite of a “shared”-IP.)

Does that “shared” infer some other configuration things that I might not notice right away?

Thanks.

SYSTEM INFORMATION
OS type and version Ubuntu 24.04.2
Virtualmin version 7.30.8

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.