<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>The Wombelix Post - IPv6</title><link href="https://dominik.wombacher.cc/" rel="alternate"/><link href="/feeds/tag_ipv6.atom.xml" rel="self"/><id>https://dominik.wombacher.cc/</id><updated>2022-04-10T00:00:00+02:00</updated><entry><title>Provide outgoing IPv4 connectivity to Docker Container on a IPv6-only Host via clatd (464xlat)</title><link href="https://dominik.wombacher.cc/posts/provide_outgoing_ipv4_connectivity_for_docker_container_on_a_ipv6-only_host_via_clatd_464xlat.html" rel="alternate"/><published>2022-04-10T00:00:00+02:00</published><updated>2022-04-10T00:00:00+02:00</updated><author><name>Dominik Wombacher</name></author><id>tag:dominik.wombacher.cc,2022-04-10:/posts/provide_outgoing_ipv4_connectivity_for_docker_container_on_a_ipv6-only_host_via_clatd_464xlat.html</id><summary type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;My experiences are based on a recent &lt;a class="reference external" href="https://goharbor.io"&gt;Harbor&lt;/a&gt;
setup on &lt;a class="reference external" href="https://rockylinux.org"&gt;Rocky Linux&lt;/a&gt;, but should be easily
transferable to any other Application and Linux Distribution.&lt;/p&gt;
&lt;p&gt;The journey began after Harbor was  ... &lt;a class="read-more" href="/posts/provide_outgoing_ipv4_connectivity_for_docker_container_on_a_ipv6-only_host_via_clatd_464xlat.html"&gt; [read more]&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;My experiences are based on a recent &lt;a class="reference external" href="https://goharbor.io"&gt;Harbor&lt;/a&gt;
setup on &lt;a class="reference external" href="https://rockylinux.org"&gt;Rocky Linux&lt;/a&gt;, but should be easily
transferable to any other Application and Linux Distribution.&lt;/p&gt;
&lt;p&gt;The journey began after Harbor was up and running and the vulnerability Scanner Trivy,
used to Scan pushed Images, failed to get it's updates from a IPv4-only address.&lt;/p&gt;
&lt;p&gt;So the goal was to get outgoing IPv4 working, incoming traffic is handled by a HAProxy and not further described.&lt;/p&gt;
&lt;p&gt;Some background about the Infrastructure:
The Proxmox VE Server that host the VM has public IPv4 and IPv6 connectivity,
is running radvd to advertise a /64 prefix to a bridge interface,
Bind / Named to provide DNS64 and Tayga for NAT64.&lt;/p&gt;
&lt;p&gt;This Setup allows the VM to automatically configure IPv6 via SLAAC
and also talk to IPv4 targets, e.g. github.com, out of the box.
DNS Resolution is done by Bind with enabled DNS64 option on the Proxmox Host,
which also act as Gateway for the VM.&lt;/p&gt;
&lt;p&gt;If no AAAA Record is available for a site, Bind will return one where the IPv4 address is embedded in a IPv6 address.
In my setup I defined &lt;code&gt;64:ff9b::/96&lt;/code&gt; for that purpose, example result for github.com (IPv4: 140.82.121.4):&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
dig github.com aaaa +short
64:ff9b::8c52:7903

&lt;/pre&gt;
&lt;p&gt;Tayga, running on the Proxmox Host, will receive this IPv6 traffic from the VM and perform NAT64,
viola github.com is accessible from the IPv6-only VM. More about that setup in a earlier
&lt;a class="reference external" href="https://dominik.wombacher.cc/posts/proxmox_and_nat64_jool_seems_incompatible_with_pve_firewall_tayga_to_rescue.html"&gt;Post&lt;/a&gt;.&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
              ---------------------                  --------------------------
              |  Proxmox Host     |                  | Virtual Machine        |
              |                   |                  |                        |
              |  public IPv4 /32  |                  | IPv6 only, SLAAC       |
Internet ---- |  public IPv6 /64  | ---- bridge ---- | Resolver: Proxmox Host |
              |  radvd &amp;gt; vmbr0    |                  | Gateway: Proxmox Host  |
              |  Bind DNS64       |                  --------------------------
              |  Tayga NAT64      |
              ---------------------

Internet &amp;lt;&amp;gt;           eth0            &amp;lt;&amp;gt; vmbr0 &amp;lt;&amp;gt;            &amp;lt;&amp;gt; eth0

&lt;/pre&gt;
&lt;p&gt;If you put Docker into the mix, things getting complicated due to the fact that everything was build with IPv4 in mind.&lt;/p&gt;
&lt;p&gt;Even though there is some sort of IPv6 Support in the meantime, it's not really usable in my opinion.
You can achieve that Docker assigns a IPv6 from a given Prefix (recommend: /80) to each Container.
But that need to be configured in &lt;code&gt;/etc/docker/daemon.json&lt;/code&gt; for the default network
and separately via cli or docker-compose for every custom network.&lt;/p&gt;
&lt;p&gt;It's a random public reachable IP address and all ports will exposed, independent of the Container configuration.
Also managing DNS Records for those random generated, not predictable Container IPs, is nearly impossible
and SLAAC or at least DHCPv6 is not supported at all.&lt;/p&gt;
&lt;p&gt;Apropos DNS, Docker embedded DNS, which is enabled on Custom Networks and can't be disabled, only support IPv4.
So as soon you work with custom networks, which is quite common with Docker Compose, you have to set it globally via
&lt;code&gt;/etc/docker/daemon.json&lt;/code&gt;, which is only a good idea if all you container going to use IPv6 or alternatively
manually overwrite &lt;code&gt;/etc/resolv.conf&lt;/code&gt; inside the specific Container, e.g. by read-only mount a file,
to get name resolution working.&lt;/p&gt;
&lt;p&gt;Also you can't disable IPv4, so your Container will always get a (private) IPv4 in addition to the public IPv6 address.
That means on a IPv6 only Host, NAT64 as described above doesn't work and connecting to IPv4 only targets like github.com will fail.&lt;/p&gt;
&lt;p&gt;You can use &lt;a class="reference external" href="https://github.com/robbertkl/docker-ipv6nat"&gt;ipv6nat&lt;/a&gt; to get rid of some of the earlier mentioned limitations,
but this doesn't solve the IPv4 connectivity problem and still requires to setup IPv6 prefixes manually for every docket network.&lt;/p&gt;
&lt;p&gt;After investing quite some time in IPv6 and Docker I came to the conclusion to stay away from it,
at least until embedded DNS support IPv6 and disabling IPv4 is possible.&lt;/p&gt;
&lt;p&gt;I decided to run Docker just as ever, with NAT and private IP4 addresses assigned to each container.
To provide the necessary Translation from IPv4 &amp;gt; IPv6 I use &lt;a class="reference external" href="https://github.com/toreanderson/clatd"&gt;clatd&lt;/a&gt;,
which use Tayga under the hood and performs the heavy lifting for your.&lt;/p&gt;
&lt;pre class="code text literal-block"&gt;
              ---------------------                  --------------------------                  ------------------------
              |  Proxmox Host     |                  | Virtual Machine        |                  | Docker Container     |
              |                   |                  |                        |                  |                      |
              |  public IPv4 /32  |                  | IPv6 only, SLAAC       |                  | Private IPv4 address |
Internet ---- |  public IPv6 /64  | ---- bridge ---- | Resolver: Proxmox Host | ---- bridge ---- | Resolve: Public DNS  |
              |  radvd &amp;gt; vmbr0    |                  | Gateway: Proxmox Host  |                  | Gateway: VM          |
              |  Bind DNS64       |                  | clatd (464xlat)        |                  ------------------------
              |  Tayga NAT64      |                  --------------------------
              ---------------------

IPv4 Container
--------------
Internet &amp;lt;&amp;gt;           eth0            &amp;lt;&amp;gt; vmbr0 &amp;lt;&amp;gt;        &amp;lt;&amp;gt; eth0 &amp;lt;&amp;gt; clat &amp;lt;&amp;gt;       &amp;lt;&amp;gt; docker0 &amp;lt;&amp;gt;          &amp;lt;&amp;gt; eth0
                      IPv4               IPv6               IPv6    IPv4             IPv4                   IPv4

&lt;/pre&gt;
&lt;p&gt;A quick look on the setup, focused on the clatd related parts, assumption that docker is already up and running.
Probably the most important is to allow masquerade in the public firewalld zone, otherwise the packages will silently dropped.&lt;/p&gt;
&lt;pre class="code bash literal-block"&gt;
&lt;span class="pygments-c1"&gt;# Allow masquerade to avoid silent package drop
&lt;/span&gt;sudo&lt;span class="pygments-w"&gt; &lt;/span&gt;firewall-cmd&lt;span class="pygments-w"&gt; &lt;/span&gt;--zone&lt;span class="pygments-o"&gt;=&lt;/span&gt;public&lt;span class="pygments-w"&gt; &lt;/span&gt;--add-masquerade&lt;span class="pygments-w"&gt; &lt;/span&gt;--permanent&lt;span class="pygments-w"&gt;
&lt;/span&gt;sudo&lt;span class="pygments-w"&gt; &lt;/span&gt;firewall-cmd&lt;span class="pygments-w"&gt; &lt;/span&gt;--reload&lt;span class="pygments-w"&gt;

&lt;/span&gt;&lt;span class="pygments-c1"&gt;# Install EPEL Repositories, required for clatd and tayga
&lt;/span&gt;sudo&lt;span class="pygments-w"&gt; &lt;/span&gt;nf&lt;span class="pygments-w"&gt; &lt;/span&gt;config-manager&lt;span class="pygments-w"&gt; &lt;/span&gt;--set-enabled&lt;span class="pygments-w"&gt; &lt;/span&gt;powertools&lt;span class="pygments-w"&gt;
&lt;/span&gt;sudo&lt;span class="pygments-w"&gt; &lt;/span&gt;dnf&lt;span class="pygments-w"&gt; &lt;/span&gt;install&lt;span class="pygments-w"&gt; &lt;/span&gt;epel-release&lt;span class="pygments-w"&gt;

&lt;/span&gt;sudo&lt;span class="pygments-w"&gt; &lt;/span&gt;dnf&lt;span class="pygments-w"&gt; &lt;/span&gt;install&lt;span class="pygments-w"&gt; &lt;/span&gt;make&lt;span class="pygments-w"&gt; &lt;/span&gt;git&lt;span class="pygments-w"&gt; &lt;/span&gt;tar&lt;span class="pygments-w"&gt;

&lt;/span&gt;&lt;span class="pygments-c1"&gt;# Download and install clatd
&lt;/span&gt;&lt;span class="pygments-nb"&gt;cd&lt;/span&gt;&lt;span class="pygments-w"&gt; &lt;/span&gt;~&lt;span class="pygments-w"&gt;
&lt;/span&gt;git&lt;span class="pygments-w"&gt; &lt;/span&gt;clone&lt;span class="pygments-w"&gt; &lt;/span&gt;https://github.com/toreanderson/clatd&lt;span class="pygments-w"&gt;
&lt;/span&gt;sudo&lt;span class="pygments-w"&gt; &lt;/span&gt;make&lt;span class="pygments-w"&gt; &lt;/span&gt;-C&lt;span class="pygments-w"&gt; &lt;/span&gt;clatd&lt;span class="pygments-w"&gt; &lt;/span&gt;install&lt;span class="pygments-w"&gt; &lt;/span&gt;installdeps&lt;span class="pygments-w"&gt;

&lt;/span&gt;sudo&lt;span class="pygments-w"&gt; &lt;/span&gt;systemctl&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-nb"&gt;enable&lt;/span&gt;&lt;span class="pygments-w"&gt; &lt;/span&gt;--now&lt;span class="pygments-w"&gt; &lt;/span&gt;clatd&lt;span class="pygments-w"&gt;

&lt;/span&gt;&lt;span class="pygments-c1"&gt;# Configure global IPv4 DNS Server, used by all Container
# Privacy friendly Server by Freifunk München https://ffmuc.net/wiki/doku.php?id=knb:dohdot
&lt;/span&gt;/etc/docker/daemon.json&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-sb"&gt;```&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-o"&gt;{&lt;/span&gt;&lt;span class="pygments-w"&gt;
  &lt;/span&gt;&lt;span class="pygments-s2"&gt;&amp;quot;dns&amp;quot;&lt;/span&gt;&lt;span class="pygments-w"&gt; &lt;/span&gt;:&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-o"&gt;[&lt;/span&gt;&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-s2"&gt;&amp;quot;5.1.66.255&amp;quot;&lt;/span&gt;,&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-s2"&gt;&amp;quot;185.150.99.255&amp;quot;&lt;/span&gt;&lt;span class="pygments-w"&gt; &lt;/span&gt;&lt;span class="pygments-o"&gt;]&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-o"&gt;}&lt;/span&gt;&lt;span class="pygments-w"&gt;
&lt;/span&gt;&lt;span class="pygments-sb"&gt;```&lt;/span&gt;&lt;span class="pygments-w"&gt;

&lt;/span&gt;sudo&lt;span class="pygments-w"&gt; &lt;/span&gt;systemctl&lt;span class="pygments-w"&gt; &lt;/span&gt;restart&lt;span class="pygments-w"&gt; &lt;/span&gt;docker&lt;span class="pygments-w"&gt;
&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;Drawback: That way Container will _not_ be able to reach IPv6-only Systems, the target need to be reachable via IPv4.&lt;/p&gt;
&lt;p&gt;At least in my case that's acceptable, main goal is to ensure Trivy can download updates, if you need outgoing IPv6,
you have to go either with &lt;a class="reference external" href="https://github.com/robbertkl/docker-ipv6nat"&gt;ipv6nat&lt;/a&gt; or the docker build-in IPv6 feature.&lt;/p&gt;
&lt;p&gt;There seem to be no perfect one-size-fits-all Solution, so as often in IT, you have to pick the right tool for the job.&lt;/p&gt;
</content><category term="Linux"/><category term="Linux"/><category term="Docker"/><category term="Container"/><category term="IPv6"/><category term="NAT"/></entry><entry><title>Hurricane Electric IPv6 Certification - Sage level reached</title><link href="https://dominik.wombacher.cc/posts/hurricane_electric_ipv6_certification_sage_level_reached.html" rel="alternate"/><published>2022-01-15T00:00:00+01:00</published><updated>2022-01-15T00:00:00+01:00</updated><author><name>Dominik Wombacher</name></author><id>tag:dominik.wombacher.cc,2022-01-15:/posts/hurricane_electric_ipv6_certification_sage_level_reached.html</id><summary type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;IPv6 connectivity is quite important for me, fortunately IPv6 is a first class citizen for my ISP
(Deutsche Glasfaser) and was also available with my previous one (1&amp;amp;1).
So  ... &lt;a class="read-more" href="/posts/hurricane_electric_ipv6_certification_sage_level_reached.html"&gt; [read more]&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;!-- SPDX-FileCopyrightText: 2023 Dominik Wombacher &lt;dominik@wombacher.cc&gt; --&gt;
&lt;!--  --&gt;
&lt;!-- SPDX-License-Identifier: CC-BY-SA-4.0 --&gt;
&lt;p&gt;IPv6 connectivity is quite important for me, fortunately IPv6 is a first class citizen for my ISP
(Deutsche Glasfaser) and was also available with my previous one (1&amp;amp;1).
So I didn't have to use a Tunnel Broker at home yet to get IPv6 up and running but if I had to,
I would go with Hurricane Eletric and their (free) &lt;a class="reference external" href="https://www.tunnelbroker.net"&gt;Tunnelbroker&lt;/a&gt; Service.&lt;/p&gt;
&lt;p&gt;HE also offer a &lt;a class="reference external" href="https://ipv6.he.net/certification/"&gt;IPv6 Certification&lt;/a&gt;, to test your theoretical
as well as practical knowledge and verify that you are actually using IPv6 at home, your website, mail server and DNS.&lt;/p&gt;
&lt;p&gt;There are seven Certification Level:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;NewB: Read the primer, be able to answer some quick and easy questions.&lt;/li&gt;
&lt;li&gt;Explorer: Verify that you can access an IPv6 website (ours!)&lt;/li&gt;
&lt;li&gt;Enthusiast: Verify that you have an IPv6 capable web server that we can connect to and fetch information from. This should be entered as a FQDN and not an IPv6 address.&lt;/li&gt;
&lt;li&gt;Administrator: Verify that you have a working IPv6 capable MTA by sending you an email only over IPv6.&lt;/li&gt;
&lt;li&gt;Professional: Verify that your MTA has working reverse DNS (ex: dig mx $domain +short ; dig aaaa $mx +short ; dig -x $mxAAAA +short)&lt;/li&gt;
&lt;li&gt;Guru: Verify that the authoritative NS for your domain have AAAA records, and respond to queries for the domain (ex: step 1 is dig ns $domain ; dig aaaa $ns | step 2 is dig aaaa $domain &amp;#64;$nsAAAA)&lt;/li&gt;
&lt;li&gt;Sage: Check to see if your domain's authoritative NS have IPv6 glue with their listed TLD servers. Meaning the TLD server can directly answer for the host record (ex: dig +trace ns $domain to get the TLD server list then dig aaaa $ns &amp;#64;TLD for the glue).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Source: &lt;a class="reference external" href="https://forums.he.net/index.php?topic=304.0"&gt;https://forums.he.net/index.php?topic=304.0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;They provide a lot of additional &lt;a class="reference external" href="https://ipv6.he.net/presentations.php"&gt;learning material&lt;/a&gt;
and have a still quite active &lt;a class="reference external" href="https://forums.he.net/index.php?board=11.0"&gt;community&lt;/a&gt; as well.&lt;/p&gt;
&lt;p&gt;Sages also get a &lt;a class="reference external" href="https://forums.he.net/index.php?topic=922.0"&gt;Free IPv6 T-Shirt&lt;/a&gt; upon request,
last batch run was &lt;em&gt;Fri Dec 10 2021&lt;/em&gt;, so let's see when mine will arrive :)&lt;/p&gt;
&lt;p&gt;Hint: Getting Sage Rank is a mandatory requirement to request HE to remove SMTP and IRC Port Filtering
when using their IPv6 Tunnel, to avoid abuse those are blocked by default, see &lt;a class="reference external" href="https://ipv6.he.net/certification/faq.php"&gt;FAQ&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It Was fun to work through the different level, test my knowledge and validate my IPv6 Setup.
Due to the fact that all my Server already using IPv6, whenever possible IPv6-only, a few in Dual-Stack Mode,
I was able to reach the Sage Level quite fast, no re-configuration of my Services was required to pass all checks.&lt;/p&gt;
&lt;p&gt;Exception was enabling TLS v1.2 on my website, limit to v1.3 only was to strict for he.net
to reach my Server and validate my Domain. Also disabling greylisting for sender &lt;a class="reference external" href="mailto:ipv6&amp;#64;he.net"&gt;ipv6&amp;#64;he.net&lt;/a&gt;
was helpful to speed things up during verification of my mail setup.&lt;/p&gt;
&lt;img src="https://ipv6.he.net/certification/create_badge.php?pass_name=wombelix&amp;amp;badge=3" style="border: 0; width: 229px; height: 137px" alt="IPv6 Certification Badge for wombelix"&gt;&lt;/img&gt;&lt;div class="section" id="certificate"&gt;
&lt;h2&gt;Certificate&lt;/h2&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Download&lt;ul&gt;
&lt;li&gt;&lt;a class="reference external" href="/certificates/he.net_ipv6_certification_sage_level_dominik_wombacher.pdf"&gt;Certificate&lt;/a&gt; (PDF, 1.2M)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><category term="Certification"/><category term="IPv6"/><category term="Network"/><category term="Administration"/><category term="Certification"/></entry></feed>