[systemd-devel] systemd-networkd multipath routing

Arnaud Lemaire alemaire at norad.fr
Tue May 7 18:15:33 UTC 2019


Thx I will try that, but it looks a little bit hackish.
No way to set the multipath routing with systemd-networkd?
If no, is it expected ? a feature request ? a bug ?


On Tue, May 7, 2019 at 3:23 PM Mantas Mikul─Śnas <grawity at gmail.com> wrote:

> On Tue, May 7, 2019 at 3:54 PM Arnaud Lemaire <alemaire at norad.fr> wrote:
>
>> Hi there,
>>
>> I'm trying to set up network multipath routing with systemd, but I cannot
>> find a way to do it cleanly.
>>
>> The part that I cannot set up is :
>> ```
>> $ ip route
>> default
>>         nexthop via 192.168.11.1 dev inet.11 weight 5
>>         nexthop via 192.168.22.2 dev inet.22 weight 10
>> ...
>> ```
>>
>> I'm getting around it with this unit:
>> $ cat /etc/systemd/system/multipath-routing.service
>> [Unit]
>> Description=Setup default gateway multipath routing
>> After=network-online.target
>> Wants=network-online.target
>>
>> [Service]
>> Type=oneshot
>> RemainAfterExit=yes
>> ExecStart=-/usr/bin/ip route del default
>> ExecStart=/usr/bin/ip route add default nexthop via 192.168.11.1 dev
>> inet.11 weight 5 nexthop via 192.168.22.2 dev inet.22 weight 10
>>
>> [Install]
>> WantedBy=network-online.target
>> ```
>>
>> And it's working, but as soon as I unplug the network cable and plug it
>> back, the routes are gone
>> and the unit is not triggered
>>
>> I tried with a WantedBy on the `sys-subsystem-net-devices-eno1.device`
>> but it's not working since it seems to act on the device and not on the
>> link.
>>
>>
> Install networkd-dispatcher or a similar tool to react to systemd-networkd
> events. (You could also use ifplugd to react directly to link events,
> although that might run before networkd has finished its own
> configuration.)
>
> --
> Mantas Mikul─Śnas
>


-- 
*Arnaud LEMAIRE*
alemaire at norad.fr - +33(0)6 71 21 82 07
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190507/f575998f/attachment-0001.html>


More information about the systemd-devel mailing list