# n.b. IPv6 is not currently supported in Compose File version 3: # https://docs.docker.com/compose/compose-file/compose-file-v3/#enable_ipv6 version: "2.4" # Unfortunately, Docker Compose files offer no means of defining variables, so things like the NAT64 # prefix and various IP addresses are hard-coded below. The individual Dockerfiles are # parameterized, so it should be sufficient to change values in this file only (if necessary). The # only exception is bind9-named.conf, which will also need to be updated. networks: testnet: driver: bridge enable_ipv6: true ipam: driver: default config: - subnet: 172.18.0.0/16 gateway: 172.18.0.1 - subnet: fd00:dead:beef::/48 gateway: fd00:dead:beef::1 # For an explanation of each service, consult the README. services: gateway: build: context: . dockerfile: gateway.dockerfile args: - MY_IP=172.18.0.10 - NAT64_IP=172.18.0.20 - NAT64_DYN_POOL=172.18.0.128/25 environment: - PCAP=${PCAP:-false} cap_add: - NET_ADMIN volumes: - ./pcaps:/pcaps networks: testnet: ipv4_address: 172.18.0.10 ipv6_address: fd00:dead:beef::10 nat64: build: context: . dockerfile: nat64.dockerfile args: - GATEWAY_IP=172.18.0.10 - DOCKER_GATEWAY_IP=172.18.0.1 - TAYGA_CONF_DYNAMIC_POOL=172.18.0.128/25 environment: - TAYGA_CONF_IPV4_ADDR=172.18.0.20 - TAYGA_CONF_PREFIX=2001:db8:64:ff9b::/96 - TAYGA_CONF_DYNAMIC_POOL=172.18.0.128/25 - PCAP=${PCAP:-false} sysctls: - net.ipv6.conf.all.disable_ipv6=0 - net.ipv6.conf.all.forwarding=1 cap_add: - NET_ADMIN devices: - /dev/net/tun volumes: - ./pcaps:/pcaps networks: testnet: ipv4_address: 172.18.0.20 ipv6_address: fd00:dead:beef::20 dns64: build: context: . dockerfile: dns64.dockerfile args: - NAT64_PREFIX=2001:db8:64:ff9b::/96 - NAT64_IPV6_ADDR=fd00:dead:beef::20 - MY_IPV4=172.18.0.30 environment: - PCAP=${PCAP:-false} sysctls: - net.ipv6.conf.all.disable_ipv6=0 - net.ipv6.conf.all.forwarding=1 cap_add: - NET_ADMIN volumes: - ./bind9-named.conf:/etc/bind/named.conf - ./pcaps:/pcaps # The dns64 container uses itself for DNS. dns: fd00:dead:beef::30 networks: testnet: ipv4_address: 172.18.0.30 ipv6_address: fd00:dead:beef::30 client: build: context: . dockerfile: client.dockerfile args: - NAT64_PREFIX=2001:db8:64:ff9b::/96 - NAT64_IPV6_ADDR=fd00:dead:beef::20 - MY_IPV4=172.18.0.40 - TEST_SERVER_HOST=test-server - TEST_SERVER_PORT=80 - TEST_SCRIPT=${CLIENT_SCRIPT:-do-test.sh} # Environment variables are defined for convenience. environment: - NAT64_PREFIX=2001:db8:64:ff9b::/96 - TEST_SERVER_IPV4=172.18.0.50 - PCAP=${PCAP:-false} cap_add: - NET_ADMIN extra_hosts: # Add a host mapping for the test server's NAT64'd IPv4 address. - "test-server:2001:db8:64:ff9b::ac12:32" volumes: - ./pcaps:/pcaps dns: fd00:dead:beef::30 networks: testnet: ipv4_address: 172.18.0.40 ipv6_address: fd00:dead:beef::40 test-server: build: context: . dockerfile: test-server.dockerfile args: - LISTEN_PORT=80 environment: - PCAP=${PCAP:-false} volumes: - ./pcaps:/pcaps networks: testnet: # Note: if this IPv4 address changes, the client container's host mapping should be updated # as well (see the extra_hosts section in the client container's section). ipv4_address: 172.18.0.50 ipv6_address: fd00:dead:beef::50