TUN-10383: Set edge-ip-version to auto
Check / check (1.22.x, macos-latest) (push) Has been cancelled
Check / check (1.22.x, ubuntu-latest) (push) Has been cancelled
Check / check (1.22.x, windows-latest) (push) Has been cancelled
Semgrep config / semgrep/ci (push) Has been cancelled

To allow pre-checks to test both IPv6 and IPv4, we must change the default value of edge-ip-version's from 4 to auto. This will allows the tunnel (and pre-check) to probe both IPv4 and IPv6 addresses by default, respecting the system's DNS preference. Instead of always preferring IPv4, cloudflared will now use whichever address family the system resolver returns first.
This commit is contained in:
Miguel da Costa Martins Marcelino
2026-04-14 16:11:59 +00:00
parent 5287a9e24b
commit b0b898c235
3 changed files with 18 additions and 5 deletions
+4
View File
@@ -1,3 +1,7 @@
## 2026.4.0
### Breaking Change
- The default value of `--edge-ip-version` has changed from `4` to `auto`. This means cloudflared will now use whichever address family (IPv4 or IPv6) the system resolver returns first, instead of always preferring IPv4. Users who require IPv4-only connections should explicitly set `--edge-ip-version 4`.
## 2026.2.0 ## 2026.2.0
### Breaking Change ### Breaking Change
- Removes the `proxy-dns` feature from cloudflared. This feature allowed running a local DNS over HTTPS (DoH) proxy. - Removes the `proxy-dns` feature from cloudflared. This feature allowed running a local DNS over HTTPS (DoH) proxy.
+1 -1
View File
@@ -631,7 +631,7 @@ func tunnelFlags(shouldHide bool) []cli.Flag {
Name: cfdflags.EdgeIpVersion, Name: cfdflags.EdgeIpVersion,
Usage: "Cloudflare Edge IP address version to connect with. {4, 6, auto}", Usage: "Cloudflare Edge IP address version to connect with. {4, 6, auto}",
EnvVars: []string{"TUNNEL_EDGE_IP_VERSION"}, EnvVars: []string{"TUNNEL_EDGE_IP_VERSION"},
Value: "4", Value: "auto",
Hidden: false, Hidden: false,
}), }),
altsrc.NewStringFlag(&cli.StringFlag{ altsrc.NewStringFlag(&cli.StringFlag{
+13 -4
View File
@@ -20,12 +20,21 @@ class TestEdgeDiscovery:
@pytest.mark.parametrize("protocol", protocols()) @pytest.mark.parametrize("protocol", protocols())
def test_default_only(self, tmp_path, component_tests_config, protocol): def test_default_only(self, tmp_path, component_tests_config, protocol):
""" """
This test runs a tunnel to connect via IPv4-only edge addresses (default is unset "--edge-ip-version 4") This test runs a tunnel with the default edge-ip-version (auto), which will use
whichever address family the system resolver returns first.
""" """
if self.has_ipv6_only(): if self.has_ipv6_only():
pytest.skip("Host has IPv6 only support and current default is IPv4 only") self.expect_address_connections(
self.expect_address_connections( tmp_path, component_tests_config, protocol, None, self.expect_ipv6_address)
tmp_path, component_tests_config, protocol, None, self.expect_ipv4_address) elif self.has_ipv4_only():
self.expect_address_connections(
tmp_path, component_tests_config, protocol, None, self.expect_ipv4_address)
elif self.has_dual_stack(address_family_preference=socket.AddressFamily.AF_INET6):
self.expect_address_connections(
tmp_path, component_tests_config, protocol, None, self.expect_ipv6_address)
else:
self.expect_address_connections(
tmp_path, component_tests_config, protocol, None, self.expect_ipv4_address)
@pytest.mark.parametrize("protocol", protocols()) @pytest.mark.parametrize("protocol", protocols())
def test_ipv4_only(self, tmp_path, component_tests_config, protocol): def test_ipv4_only(self, tmp_path, component_tests_config, protocol):