So, I'm trying to make systemd service on Debian Jessie.I need it to start after network-online.target is reached.The problem is network-online.target fires in the same time as network.target and in that time my interfaces are not configured yet, just started DHCP query.It looks like issue specific to Debian because it uses legacy network configuration.How to bypass this problem or how to make network-online.target working? 
Debian systemd network-online.target not working?
debian;systemd;systemd networkd
Since you're using /etc/network/interfaces, you'll need a systemd service to monitor the status of each interface. Check to see if you have /lib/systemd/system/ifup-wait-all-auto.service (installed by the ifupdown package in Ubuntu 15.04). If not, then create /etc/systemd/system/ifup-wait-all-auto.service, and paste in the following:[Unit]Description=Wait for all auto /etc/network/interfaces to be up for network-online.targetDocumentation=man:interfaces(5) man:ifup(8)DefaultDependencies=noAfter=local-fs.targetBefore=network-online.target[Service]Type=oneshotRemainAfterExit=yesTimeoutStartSec=2minExecStart=/bin/sh -ec '\  for i in $(ifquery --list --exclude lo --allow auto); do INTERFACES=$INTERFACES$i ; done; \  [ -n $INTERFACES ] || exit 0; \  while ! ifquery --state $INTERFACES >/dev/null; do sleep 1; done; \  for i in $INTERFACES; do while [ -e /run/network/ifup-$i.pid ]; do sleep 0.2; done; done'[Install]WantedBy=network-online.targetThis is the service file as present on an Ubuntu 15.04 system, but with the [Install] section added in to make things a little easier. I'm hoping that the behavior of ifup in Ubuntu 15.04 is the same as the behavior of ifup in Debian Jessie. If not, some modification will be necessary (particularly with the last line).Then, run sudo systemctl enable ifup-wait-all-auto.service. After rebooting your computer, you should see that the network-online.target is reached after the interfaces are brought up (at least).