[systemd-devel] Networkd - how to augment an already configured interface

Susant Sahani ssahani at vmware.com
Thu Mar 12 18:24:48 UTC 2020


https://www.freedesktop.org/software/systemd/man/systemd.network.html#KeepConfiguration=


From: systemd-devel <systemd-devel-bounces at lists.freedesktop.org>
Date: Thursday, 12 March 2020 at 7:56 PM
To: Systemd <systemd-devel at lists.freedesktop.org>
Subject: [systemd-devel] Networkd - how to augment an already configured interface
Hi,

for a rather complex tunneling setup on a system that uses
systemd-networkd and OpenVPN, I am trying to use networkd to augment the
Interface that has been configured by OpenVPN.

In OpenVPN, a daemon is started with a service unit, which connects to a
remote side and creates a tunX interface and configures it according to
what the other side says. The other side can push basic configuration
like IP address and routes that go into the main routing table, but I
need a RoutingPolicyRule and addiitonal Routes pushed into the
configuration.

I tried writing the following tunX.network unit:

[Match]
Name=tun1

[Network]
Description=tun1 tunnel to old torres
DHCP=no
IPForward=yes
IPv6AcceptRA=no

[Route]
Destination=0::/0
Gateway=2a01:238:4071:3202::1
Table=202

[RoutingPolicyRule]
Priority=32100
From=2a01:238:4071:3280::/59
Table=202

[RoutingPolicyRule]
Priority=32101
From=2a01:238:4071:32b0::/62
Table=202

but it looks like networkd wants full control over the network interface
and flushes the IP addresses from the working interface, leaving it in a
non-functional state.

Is there any way to

(a) tell networkd to just add the configuration from the unit to the
    already interface without cleaning up first, or
(b) to have part of systemd just execute a single .network unit,
    probably as a sidekick unit that I can use to add configuration to my
    OpenVPN configuration?

Or am I better off by just taking things away from systemd-networkd
completely and use an "up" script from the OpenVPN configuration?

Hoping for your opinions and a good discussion,
cheers, Marc


--
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421
_______________________________________________
systemd-devel mailing list
systemd-devel at lists.freedesktop.org
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fsystemd-devel&data=02%7C01%7Cssahani%40vmware.com%7C3f5cc148c7b8455fd72b08d7c691549a%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C637196199807183281&sdata=xXQl2HlQoQyYFfd0m8OLwXMLrKTA2T3DULh1edTWDss%3D&reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200312/ebb2dbb3/attachment.htm>


More information about the systemd-devel mailing list