-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Milestone
Description
The IP range add/remove endpoints allow pairs of v4 or v6 addresses, and have done so since they were added in #1253 (June 2022).
Lines 351 to 361 in 235420e
| /// An IP Range is a contiguous range of IP addresses, usually within an IP | |
| /// Pool. | |
| /// | |
| /// The first address in the range is guaranteed to be no greater than the last | |
| /// address. | |
| #[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)] | |
| #[serde(untagged)] | |
| pub enum IpRange { | |
| V4(Ipv4Range), | |
| V6(Ipv6Range), | |
| } |
I only just found out that while the API lets you add and remove them, IPv6 address ranges will not actually work from a networking POV — it's possible we can allocate an IPv6 address to an instance, but the instance will not be reachable through it.
The simplest thing would be to change the endpoint to take an Ipv4Range instead of an IpRange. That is probably not as a simple as it sounds — there will be a lot of fiddly changes to the tests.
omicron/nexus/src/external_api/http_entrypoints.rs
Lines 1731 to 1741 in 235420e
| /// Add range to IP pool | |
| #[endpoint { | |
| method = POST, | |
| path = "/v1/system/ip-pools/{pool}/ranges/add", | |
| tags = ["system/networking"], | |
| }] | |
| async fn ip_pool_range_add( | |
| rqctx: RequestContext<Arc<ServerContext>>, | |
| path_params: Path<params::IpPoolPath>, | |
| range_params: TypedBody<shared::IpRange>, | |
| ) -> Result<HttpResponseCreated<IpPoolRange>, HttpError> { |
Metadata
Metadata
Assignees
Labels
No labels