# systemd starting my openvpn client

## Cr0t

I created a systemd vpn service. The service starts on bootup, but it fails to setup the default route "SIOCADDRT: Network is unreachable". "After" what service should my service start?

```
[Unit]

Description=VPN

Wants=network-online.target

After=network-online.target

[Service]

Type=simple

to always restart on exit:

Restart=always

RestartSec=5

User=root

ExecStart=/bin/bash /root/openvpn_vpn_random.sh

[Install]

WantedBy=multi-user.target
```

----------

## Banana

Hello Cr0t.

Make sure your network is ready

----------

## Cr0t

```
ExecStartPre=sleep 5
```

That did the trick.

----------

## Hu

What if someday the network takes 7 seconds to be ready?

----------

