• Welcome to Hurricane Electric's IPv6 Tunnel Broker Forums.

Systemd-networkd tunnel setup

Started by TriMoonTR, May 09, 2023, 12:08:44 AM

Previous topic - Next topic

TriMoonTR

Is there anyone who knows how to setup the tunnel using systemd-networkd config files?
If so please post code snippets of the relevant config files we need.
Thanks...

PS: The below code seemed to have created the tunnel, but it is done temporary in a terminal, so i want to make it permanent using systemd-networkd config files:

sudo -i
modprobe ipv6
ip tunnel add he-ipv6 mode sit remote xxx.xxx.xxx.xxx local yyy.yyy.yyy.yyy ttl 255
ip link set he-ipv6 up
ip addr add zzz:zzz:zzz:zzz::2/64 dev he-ipv6
ip route add ::/0 dev he-ipv6
ip -f inet6 addr

Optionally followed by:
sudo ip tunnel 6rd dev he-ipv6 6rd-prefix zzz:zzz:zzz:zzz::/64 6rd-relay_prefix yyy.yyy.yyy.yyy/32
Well that's all for now, 3M 🖖

hmmsjan

Hope this helps you. Fedora 38 Linux system.

cat 05-enp2s0.network
[Match]
Name=enp2s0

[Network]
DHCP=yes
Tunnel=he-tunnel

-----------------

cat 50-he.netdev
[Match]

[NetDev]
Name=he-tunnel
Kind=sit


[Tunnel]
Local=dhcp4
Remote=216.66.xx.xx

------------------
cat 50-he.network
[Match]
Name=he-tunnel

[Network]
Address=2001:470:xxxx:xxxx:2/64
Gateway=2001:470:xxxx:xxxx:1



TriMoonTR

#2
Quote from: hmmsjan on May 14, 2023, 12:31:48 AM[Tunnel]
Local=dhcp4
Ooh didn't know that was possible, im currently testing with a static LAN-IP (Assigned from my ISP modem for my PC) which seems to work...
But i'll definitely will try the dhcp4 idea also 👍

The reason why i hadn't posted my solution was because im still testing it, but it boils down to what you have with the 50-xxxx files.
(I didn't use a Tunnel definition as in your 05-xxxx though)


Just FYI and reference for other readers:
(Ubuntu/Debian)

# /etc/systemd/network/20-he-ipv6.netdev
[NetDev]
Name=he-ipv6
Kind=sit
MTUBytes=1480

[Tunnel]
Independent=yes
DiscoverPathMTU=yes
Local=192.168.0.xxx
Remote=216.66.xxx.xxx

# /etc/systemd/network/20-he-ipv6.network
[Match]
Name=he-ipv6

[Network]
LinkLocalAddressing=ipv6
Address=2001:470:xxxx:xxxx::2/64
ConfigureWithoutCarrier=yes

[Route]
Destination=::/0
Gateway=2001:470:xxxx:xxxx::1

The above will also create an sit0 device (sit0@NONE link via networkctl status -a) somehow, which doesn't get used as far as i could tell. (eg. harmless)
Well that's all for now, 3M 🖖