From 41298df0630a9a21ed37af0942eb130c4f7e19a7 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Tue, 29 Oct 2024 17:01:46 +0100 Subject: [PATCH] Setup interface for ip6ip6 tunneling Running into systemd-networkd bugs, don't be fooled by "Local=::1" and "Remote=::1". This still results in the equivalent of setting them to 'any' or '::' because we are using the default interface name. --- .../etc/puppet/modules/cdn/manifests/cache.pp | 16 ++++++++++++++++ .../templates/cache/10-cdn-ip6tunl.netdev.erb | 16 ++++++++++++++++ .../templates/cache/10-cdn-ip6tunl.network.erb | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 global/overlay/etc/puppet/modules/cdn/templates/cache/10-cdn-ip6tunl.netdev.erb create mode 100644 global/overlay/etc/puppet/modules/cdn/templates/cache/10-cdn-ip6tunl.network.erb diff --git a/global/overlay/etc/puppet/modules/cdn/manifests/cache.pp b/global/overlay/etc/puppet/modules/cdn/manifests/cache.pp index 2be2f53..807156e 100644 --- a/global/overlay/etc/puppet/modules/cdn/manifests/cache.pp +++ b/global/overlay/etc/puppet/modules/cdn/manifests/cache.pp @@ -71,6 +71,22 @@ class cdn::cache( content => template('cdn/cache/10-cdn-ipip.network.erb'), } + file { '/etc/systemd/network/10-cdn-ip6tunl.netdev.erb': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + content => template('cdn/cache/10-cdn-ip6tunl.netdev.erb'), + } + + file { '/etc/systemd/network/10-cdn-ip6tunl.network.erb': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + content => template('cdn/cache/10-cdn-ip6tunl.network.erb'), + } + # Reload the network config if it has changed exec { 'networkctl reload': subscribe => [File['/etc/systemd/network/10-cdn-dummy.network'], File['/etc/systemd/network/10-cdn-ipip.network']], diff --git a/global/overlay/etc/puppet/modules/cdn/templates/cache/10-cdn-ip6tunl.netdev.erb b/global/overlay/etc/puppet/modules/cdn/templates/cache/10-cdn-ip6tunl.netdev.erb new file mode 100644 index 0000000..f43cfec --- /dev/null +++ b/global/overlay/etc/puppet/modules/cdn/templates/cache/10-cdn-ip6tunl.netdev.erb @@ -0,0 +1,16 @@ +[NetDev] +Name=ip6tnl0 +Kind=ip6tnl + +[Tunnel] +Independent=true +# Local and Remote should be 'any' or '::' but right now it does not work. +# However, by using the name "ip6tnl0" that matches the name of the interface +# automatically created when the kernel module is loaded it seems we can set +# anything "non-zero" here and the config will be accepted but still leaving +# "::" as both Local and Remote on the interface. This then results in the +# wanted configuration for now. One bug cancelling out another bug? +# https://github.com/systemd/systemd/issues/34930 +Local=::1 +Remote=::1 +Mode=ip6ip6 diff --git a/global/overlay/etc/puppet/modules/cdn/templates/cache/10-cdn-ip6tunl.network.erb b/global/overlay/etc/puppet/modules/cdn/templates/cache/10-cdn-ip6tunl.network.erb new file mode 100644 index 0000000..9ad19da --- /dev/null +++ b/global/overlay/etc/puppet/modules/cdn/templates/cache/10-cdn-ip6tunl.network.erb @@ -0,0 +1,2 @@ +[Match] +Name=ip6tnl0