diff --git a/agent/agent_test.go b/agent/agent_test.go
index 470a5498af..f22fc88ff7 100644
--- a/agent/agent_test.go
+++ b/agent/agent_test.go
@@ -2676,6 +2676,20 @@ func TestAgent_AddProxy(t *testing.T) {
wantTCPCheck: "127.10.10.10:1234",
wantErr: false,
},
+ {
+ desc: "managed proxy with overridden but unspecified ipv6 bind address",
+ proxy: &structs.ConnectManagedProxy{
+ ExecMode: structs.ProxyExecModeDaemon,
+ Command: []string{"consul", "connect", "proxy"},
+ Config: map[string]interface{}{
+ "foo": "bar",
+ "bind_address": "[::]",
+ },
+ TargetServiceID: "web",
+ },
+ wantTCPCheck: "127.0.0.1:20000",
+ wantErr: false,
+ },
{
desc: "managed proxy with overridden check address",
proxy: &structs.ConnectManagedProxy{
diff --git a/website/source/docs/connect/configuration.html.md b/website/source/docs/connect/configuration.html.md
index 3a08348810..b7697a7508 100644
--- a/website/source/docs/connect/configuration.html.md
+++ b/website/source/docs/connect/configuration.html.md
@@ -62,6 +62,8 @@ described here, the rest of the service definition is shown for context and is
"config": {
"bind_address": "0.0.0.0",
"bind_port": 20000,
+ "tcp_check_address": "192.168.0.1",
+ "disable_tcp_check": false,
"local_service_address": "127.0.0.1:1234",
"local_connect_timeout_ms": 1000,
"handshake_timeout_ms": 10000,
@@ -84,6 +86,8 @@ described here, the rest of the service definition is shown for context and is
#### Configuration Key Reference
+All fields are optional with a sane default.
+
* `bind_address` -
The address the proxy will bind it's _public_ mTLS listener to. It
defaults to the same address the agent binds to.
@@ -94,6 +98,22 @@ described here, the rest of the service definition is shown for context and is
range](/docs/agent/options.html#proxy_min_port) if available. By default the
range is [20000, 20255] and the port is selected at random from that range.
+* `tcp_check_address` - The address the agent will
+ run a [TCP health check](/docs/agent/checks.html) against. By default this is
+ the same as the proxy's [bind address](#bind_address) except if the
+ bind_address is `0.0.0.0` or `[::]` in which case this defaults to `127.0.0.1`
+ and assumes agent can dial proxy over loopback. For more complex
+ configurations where agent and proxy communicate over a bridge for example,
+ this configuration can be used to specify a different _address_ (but not port)
+ for the agent to use for health checks if it can't talk to the proxy over
+ localhost or it's publicly advertised port. The check always uses the same
+ port that the proxy is bound to.
+
+* `disable_tcp_check` - If true, this disables a
+ TCP check being setup for the proxy. Default is false.
+
* `local_service_address` - The
`[address]:port` that the proxy should use to connect to the local application
instance. By default it assumes `127.0.0.1` as the address and takes the port