-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Description
Feature Description
No Configuration Parameters: A review of Consul's service definition schema and configuration options shows no parameters for customizing the virtual IP range.
Hardcoded Implementation in Source Code: The virtual IP range is hardcoded in Consul's source code at:
File: agent/consul/state/catalog.go
(lines 43-45)
var (
// startingVirtualIP is the start of the virtual IP range we assign to services.
// The effective CIDR range is startingVirtualIP to (startingVirtualIP + virtualIPMaxOffset).
startingVirtualIP = net.IP{240, 0, 0, 0}
virtualIPMaxOffset = net.IP{15, 255, 255, 254}
)
This shows that:
- Starting IP:
240.0.0.0
(hardcoded asnet.IP{240, 0, 0, 0}
) - Maximum offset:
15.255.255.254
(defining the upper bound) - Effective range:
240.0.0.0
to255.255.255.254
(the entire240.0.0.0/4
block)
File: agent/consul/state/catalog.go
(functions using these constants)
assignServiceVirtualIP()
- Assigns virtual IPs to servicesaddIPOffset()
- Performs IP arithmetic within the rangeServiceVirtualIP.IPWithOffset()
- Calculates final IP addresses
Use Case(s)
This ip range can be in use by other services which can cause possible ip duplication and network instabilities.
Metadata
Metadata
Assignees
Labels
No labels