[systemd-devel] systemd-networkd multipath routing

Susant Sahani ssahani at gmail.com
Sat May 11 03:02:02 UTC 2019


Please open a RFE https://github.com/systemd/systemd.


Susant

On Tue, May 7, 2019 at 6:24 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.
>
> Can someone give me an hint on how to do it ?
>
> --
> Arnaud LEMAIRE
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



-- 
Susant


More information about the systemd-devel mailing list