Skip to content

Transparent proxy ip range is not configurable #22595

@dzarpelon

Description

@dzarpelon

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 as net.IP{240, 0, 0, 0})
  • Maximum offset: 15.255.255.254 (defining the upper bound)
  • Effective range: 240.0.0.0 to 255.255.255.254 (the entire 240.0.0.0/4 block)

File: agent/consul/state/catalog.go (functions using these constants)

  • assignServiceVirtualIP() - Assigns virtual IPs to services
  • addIPOffset() - Performs IP arithmetic within the range
  • ServiceVirtualIP.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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions