# Unable to connect ipv6 host to dual stacked pmm host

**URL:** <https://forums.percona.com/t/unable-to-connect-ipv6-host-to-dual-stacked-pmm-host/30632>\
**Category:** Percona Monitoring and Management (PMM)\
**Created:** [May 28, 2024, 8:56am UTC](https://forums.percona.com/t/unable-to-connect-ipv6-host-to-dual-stacked-pmm-host/30632 "2024-05-28T08:56:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristophWurst](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@ChristophWurst](https://forums.percona.com/u/ChristophWurst)\
**Post date:** [May 28, 2024, 8:56am UTC](https://forums.percona.com/t/unable-to-connect-ipv6-host-to-dual-stacked-pmm-host/30632/1 "2024-05-28T08:56:09Z")

</div>

## Description:

vmagent tries to connect via ipv4 even if the own host does not support it.

## Steps to Reproduce:

We have two hosts

1. MariaDB node running pmm-agent. This host only supports ipv6.
2. PMM node. This host supports ipv4 and ipv6.

We are not able to see node/mysql metrics in PMM or VictoriaMetrics. Running pmm-agent in debug mode with debug logs shows

```auto
May 21 13:56:11 db1 pmm-agent[1265516]: time="2024-05-21T13:56:11.343+02:00" level=info msg="2024-05-21T11:56:11.342Z\twarn\tVictoriaMetrics/app/vmagent/remotewrite/client.go:385\tcouldn't send a block with size 31797 bytes to \"1:secret-url\": Post \"https://pmm-host:443/victoriametrics/api/v1/write\": dial tcp4 1.2.3.4:443: connect: network is unreachable; re-sending the block in 60.000 seconds" agentID=/agent_id/a-b-c-d-e-f component=agent-process type=vm_agent

```

1.2.3.4 is the redacted IPv4 address of the pmm host.

## Version:

pmm-agent 2.41.2

## Logs:

```auto
May 21 13:56:11 db1 pmm-agent[1265516]: time="2024-05-21T13:56:11.343+02:00" level=info msg="2024-05-21T11:56:11.342Z\twarn\tVictoriaMetrics/app/vmagent/remotewrite/client.go:385\tcouldn't send a block with size 31797 bytes to \"1:secret-url\": Post \"https://pmm-host:443/victoriametrics/api/v1/write\": dial tcp4 1.2.3.4:443: connect: network is unreachable; re-sending the block in 60.000 seconds" agentID=/agent_id/e2d2bc6d-4ca5-cb4d-85d6-be46323eee04 component=agent-process type=vm_agent

```

## Expected Result:

vmagent can connect to the pmm host via ipv6.

## Actual Result:

vmagent tries ipv4 and fails.

## Additional Information:

What we have tried already

1. Adding an /etc/hosts file on the db host with only the ipv6 address. This should avoid a DNS lookup which returns the IPv4 address too.
2. Setting VMAGENT\_enableTCP6=true for the pmm-agent but it does not seem to forward it to vmagent despite [PMM-9374 external victoria metrics (#1916) · percona/pmm@ffc66f0 · GitHub](https://github.com/percona/pmm/commit/ffc66f09b0af07e8f41ef52b9e1b4618453438a1).

---

<div class="post-metadata">

**Author:** ![ChristophWurst](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@ChristophWurst](https://forums.percona.com/u/ChristophWurst)\
**Post date:** [June 4, 2024, 10:45am UTC](https://forums.percona.com/t/unable-to-connect-ipv6-host-to-dual-stacked-pmm-host/30632/2 "2024-06-04T10:45:30Z")

</div>

> [@ChristophWurst](#):
>
> Setting VMAGENT\_enableTCP6=true for the pmm-agent but it does not seem to forward it to vmagent despite [PMM-9374 external victoria metrics (#1916)](https://github.com/percona/pmm/commit/ffc66f09b0af07e8f41ef52b9e1b4618453438a1)

Reported at [VMAGENT\_ env vars not forwarded to vmagent (to enable TCP6) · Issue #3013 · percona/pmm · GitHub](https://github.com/percona/pmm/issues/3013).

---

<div class="post-metadata">

**Author:** ![ChristophWurst](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@ChristophWurst](https://forums.percona.com/u/ChristophWurst)\
**Post date:** [June 5, 2024, 6:16pm UTC](https://forums.percona.com/t/unable-to-connect-ipv6-host-to-dual-stacked-pmm-host/30632/3 "2024-06-05T18:16:57Z")

</div>

The environment variable has to be set on the PMM server, not the client. The server will distribute the configuration to all clients.
