Enabling IPv6 on Bitbucket Pipelines Runners

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

The builds initiated from a Dual-Stack (IPv6 + IPv4) self-hosted Runners can't connect to IPv6 hosts.

Please note that IPv6 is not officially supported by Bitbucket Cloud Pipelines as mentioned in the limitations of Bitbucket Pipelines documentation. Hence, this KB highlights a workaround for Bitbucket Cloud Pipelines runners.

Environment

Production

Diagnosis

1 2 3 + ping6 bitbucket.org PING bitbucket.org(2406:da00:ff00::22e9:9f55 (2406:da00:ff00::22e9:9f55)) 56 data bytes 64 bytes from 2406:da00:ff00::22e9:9f55 (2406:da00:ff00::22e9:9f55): icmp_seq=1 ttl=44 time=125 ms
1 2 3 + ping6 ipv6.google.com PING ipv6.l.google.com (2a00:1450:400d:80c::200e): 56 data bytes ping6: sending packet: Cannot assign requested address

Cause

Before you can use IPv6 in Docker containers, you need to enable IPv6 support in the Docker daemon.

Source: Enable IPv6 support - Docker Docs

Solution

1 2 3 4 { "ipv6": true, "fixed-cidr-v6": "fd00::/80" }
1 systemctl restart docker
1 ip6tables -t nat -A POSTROUTING -s fd00::/80 ! -o docker0 -j MASQUERADE
1 2 3 4 + ping6 ipv6.google.com PING ipv6.l.google.com (2a00:1450:4001:80f::200e): 56 data bytes 64 bytes from fra16s49-in-x0e.1e100.net: icmp_seq=0 ttl=115 time=4.129 ms 64 bytes from fra16s49-in-x0e.1e100.net: icmp_seq=1 ttl=115 time=4.340 ms
Updated on February 25, 2025

Still need help?

The Atlassian Community is here for you.