绑定到特定IP的服务不会在Ubuntu 17.10中启动

我很难让nginx和dovecot在Ubuntu 17.10下启动。 我得到的错误是例如

dovecot[721]: Error: bind(2a02:c207:xxxx:xxxx::x, 4190) failed: Cannot assign requested address dovecot[721]: Error: service(managesieve-login): listen(mail.domain.tld, 4190) failed: Cannot assign requested address nginx[726]: nginx: [emerg] bind() to [2a02:c207:xxxx:xxxx::x:x]:80 failed (99: Cannot assign requested address) 

IP在/etc/network/interfaces中定义,主机在/etc/hosts中定义,如果在服务器启动后手动启动服务,一切正常。

我甚至尝试使用systemctl edit dovecot并添加覆盖

 [Unit] After=network-online.target 

但没有改变。

任何想法我失踪? 奇怪的是,SSH守护进程也绑定到一个特定的IP,并开始启动没有问题。

问题在于IP是使用定义的

 up ip addr add xxx.xxx.xxx.xxx/24 dev $IFACE 

如果使用如下定义的多个iface eth0 inet static块来指定IP,则问题得以解决: https : //wiki.debian.org/NetworkConfiguration#Multiple_IP_addresses_on_one_Interface