1*4882a593Smuzhiyun[Unit] 2*4882a593SmuzhiyunDescription=Network Connectivity 3*4882a593SmuzhiyunWants=network.target 4*4882a593SmuzhiyunBefore=network.target 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun[Service] 7*4882a593SmuzhiyunType=oneshot 8*4882a593SmuzhiyunRemainAfterExit=yes 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun# lo is brought up earlier, which will cause the upcoming "ifup -a" to fail 11*4882a593Smuzhiyun# with exit code 1, due to an "ip: RTNETLINK answers: File exists" error during 12*4882a593Smuzhiyun# its "ip addr add ..." command, subsequently causing this unit to fail even 13*4882a593Smuzhiyun# though it is a benign error. Flushing the lo address with the command below 14*4882a593Smuzhiyun# before ifup prevents this failure. 15*4882a593SmuzhiyunExecStart=/sbin/ip addr flush dev lo 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunExecStart=/sbin/ifup -a 18*4882a593SmuzhiyunExecStop=/sbin/ifdown -a 19*4882a593Smuzhiyun 20*4882a593Smuzhiyun[Install] 21*4882a593SmuzhiyunWantedBy=multi-user.target 22