Skip to content

run doesn't support static IP address assignment #260

Description

@tofugarden

Description

The helper supports constraining the DHCP address range on a network using the --start-address, --end-address, and --subnet-mask options. Docs say addresses outside the range are available for static assignment, but run doesn't support assigning a static IP address to a guest - it's DHCP only.

Right now to assign a stable address to a guest, users need DHCP lease reservations in /etc/bootpd.plist. This is an administrative operation that can break other virtual networks (and it's ugly!!).

Proposed solution

Add a --guest-ip-address option to run that sets a static address in the guest's cloud-config.

./run test \
    --start-address 192.168.55.1 \
    --end-address 192.168.55.127 \
    --subnet-mask 255.255.255.0 \
    --guest-ip-address 192.168.55.128

It should in theory be acceptable to only specify the guest IP address (if #258 makes it in, we won't always have DHCP enabled), but for now I think it makes the most sense to require all four options if --guest-ip-address is set so we can validate that nothing silly is being requested.

Potential issues

We don't have a great way to detect address collisions without doing some ARP stuff, which might be a bit complex (but doable). Since this is mostly a development tool, I think this is okay, it's the user's responsibility to ensure the assignment is unique.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions