Skip to content

Feature/ipv6 support#769

Open
notandy wants to merge 1 commit into
mainfrom
feature/ipv6-support
Open

Feature/ipv6 support#769
notandy wants to merge 1 commit into
mainfrom
feature/ipv6-support

Conversation

@notandy
Copy link
Copy Markdown
Collaborator

@notandy notandy commented May 12, 2026

Add full IPv6 support across the Archer stack:

  • API accepts both IPv4 and IPv6 for service ip_addresses and endpoint ip_address fields, validated via net.ParseIP() in the controller
  • Introduce InetAddress type for proper PostgreSQL INET scanning
  • HAProxy template uses bracketed IPv6 in HTTP Host headers (RFC 2732) and binds dual-stack (:::port v4v6) for IPv4+IPv6 listeners
  • F5 Proxy Protocol v2 iRule handles IPv6 (AF_INET6, 16-byte addresses)
  • NI agent correctly extracts INET text via host() in endpoint query
  • Add proxy protocol v2 support to NI agent with custom TLV for endpoint identification

Tested with IPv6 service, which echoes TLV/proxy protocol content and two endpoints to it (one ipv6, one ipv4)

$ curl -v http://[fd00:cafe::268]:8080 && curl -v http://10.180.0.77:8080
*   Trying fd00:cafe::268:8080...
* Connected to fd00:cafe::268 (fd00:cafe::268) port 8080 (#0)
> GET / HTTP/1.1
> Host: [fd00:cafe::268]:8080
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: text/plain
< Date: Thu, 14 May 2026 20:54:25 GMT
< Content-Length: 165
<
Version: 2
Command: 33
TransportProtocol: 33
SourceAddr: [fd00:cafe::a2]:41006
DestinationAddr: [fd00:cafe::268]:8080
TLV 0xEC: 91ae0ba1-bb16-42e9-9fb6-bec6e5e0df37
* Connection #0 to host fd00:cafe::268 left intact


*   Trying 10.180.0.77:8080...
* Connected to 10.180.0.77 (10.180.0.77) port 8080 (#0)
> GET / HTTP/1.1
> Host: 10.180.0.77:8080
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: text/plain
< Date: Thu, 14 May 2026 20:54:25 GMT
< Content-Length: 156
<
Version: 2
Command: 33
TransportProtocol: 17
SourceAddr: 10.180.0.45:60438
DestinationAddr: 10.180.0.77:8080
TLV 0xEC: eb47dcdf-552f-44a4-a4e4-e26e121ef50f
* Connection #0 to host 10.180.0.77 left intact

@notandy
Copy link
Copy Markdown
Collaborator Author

notandy commented May 12, 2026

@m-kratochvil I've tested most of it's functionality (ipv4->v6 mixed mode and ipv6 -> ipv6 with f5 and network injection), but I am not sure about the proxy protocol change, I haven't tested it so far. But maybe you already have something that's compatible with ipv6.

see file internal/agent/f5/as3/proxy_protocol_2.go in the diff.

@notandy notandy force-pushed the feature/ipv6-support branch 2 times, most recently from e03a7ce to d1efac3 Compare May 14, 2026 20:54
Add full IPv6 support across the Archer stack:

- API accepts both IPv4 and IPv6 for service ip_addresses and endpoint
  ip_address fields, validated via net.ParseIP() in the controller
- Introduce InetAddress type for proper PostgreSQL INET scanning
- HAProxy template uses bracketed IPv6 in HTTP Host headers (RFC 2732)
  and binds dual-stack (:::port v4v6) for IPv4+IPv6 listeners
- F5 Proxy Protocol v2 iRule handles IPv6 (AF_INET6, 16-byte addresses)
- NI agent correctly extracts INET text via host() in endpoint query
- Add proxy protocol v2 support to NI agent with custom TLV for
  endpoint identification
@notandy notandy force-pushed the feature/ipv6-support branch from d1efac3 to c66fa80 Compare May 14, 2026 20:55
@notandy notandy marked this pull request as ready for review May 14, 2026 20:58
@notandy notandy requested review from a team, m-kratochvil, notque and ronchi-oss as code owners May 14, 2026 20:58
@github-actions
Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/archer/client/service 0.00% (ø)
github.com/sapcc/archer/internal/agent/f5 0.00% (ø)
github.com/sapcc/archer/internal/agent/f5/as3 0.00% (ø)
github.com/sapcc/archer/internal/agent/ni 0.00% (ø)
github.com/sapcc/archer/internal/agent/ni/haproxy 0.00% (ø)
github.com/sapcc/archer/internal/agent/ni/models 0.00% (ø)
github.com/sapcc/archer/internal/agent/ni/proxy 0.00% (ø)
github.com/sapcc/archer/internal/client 0.00% (ø)
github.com/sapcc/archer/internal/controller 0.00% (ø)
github.com/sapcc/archer/models 0.00% (ø)
github.com/sapcc/archer/restapi 0.00% (ø)
github.com/sapcc/archer/restapi/operations/service 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/archer/client/service/post_service_responses.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/client/service/put_service_service_id_responses.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/internal/agent/f5/as3/as3.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/internal/agent/f5/as3/proxy_protocol_2.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/internal/agent/f5/as3/proxy_protocol_v2.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/internal/agent/f5/services.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/internal/agent/ni/agent.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/internal/agent/ni/haproxy/haproxy.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/internal/agent/ni/models/service_injection.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/internal/client/service.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/internal/controller/service.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/models/endpoint.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/models/inet_address.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/models/service.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/models/service_updatable.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/restapi/embedded_spec.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/restapi/operations/service/post_service_responses.go 0.00% (ø) 0 0 0
github.com/sapcc/archer/restapi/operations/service/put_service_service_id_responses.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/sapcc/archer/internal/agent/f5/as3/as3_test.go
  • github.com/sapcc/archer/internal/agent/ni/haproxy/haproxy_test.go
  • github.com/sapcc/archer/internal/agent/ni/proxy/manager_test.go
  • github.com/sapcc/archer/internal/controller/agent_test.go
  • github.com/sapcc/archer/internal/controller/service_test.go
  • github.com/sapcc/archer/internal/controller/suite_test.go
  • github.com/sapcc/archer/models/inet_address_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant