The script in "routes.sh" simply apply some routes to a host but this will not work if the IP hasn't been received from the DHCP server. This "ExecStartPre" logic delays the start until the gateway responds. You can also change the IP to a DNS name then it will delay the script until DNS settings are in place. [Unit] After=systemd-networkd-wait-online.service [Service] ExecStartPre=/bin/sh -c 'until ping -c1 172.16.0.1; do sleep 1; done;' ExecStart=/usr/local/bin/routes.sh [Install] Wants=systemd-networkd-wait-online.service