我在Ubuntu 16.04上为我的专用服务器买了一个新的IP地址,我一直在试图设置它,但是我只是一直遇到一个问题。 即使使用原始configuration,我也无法重新启动networking服务。 这是我通过systemctl status networking.service得到的;
systemd[1]: Starting Raise network interfaces... ifup[24985]: RTNETLINK answers: File exists ifup[24985]: Failed to bring up eth0. postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions networking.service: Main process exited, code=exited, status=1/FAILURE Failed to start Raise network interfaces. networking.service: Unit entered failed state. networking.service: Failed with result 'exit-code'.
这里是接口文件的内容(我已经审查了地址当然);
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address xxx.xx.xx.146 netmask 255.255.255.0 network xxx.xx.xx.0 broadcast xxx.xx.xx.255 gateway xxx.xx.xx.254 auto eth0:0 iface eth0:0 inet static address yy.yy.yyy.153 netmask 255.255.255.255 post-up /sbin/ifconfig eth0:0 yy.yy.yyy.153 netmask 255.255.255.255 broadcast yy.yy.yyy.153 pre-down /sbin/ifconfig eth0:0 down
原始文件(从.bak文件复制)和编辑的文件与新的IP都出现此错误。 networking服务根本无法运行的原因不明。 如果我直接尝试ifup eth0,则会出现“File exists”和“Failed to show eth0”行。 然而,尽pipeclosures,IP似乎在接口configuration中正确设置; 它们被正确地映射到相应的接口(eth0,eth0:0),并且相应的Apache / Postfix / Dovecot安装似乎也能正常工作。
然而,当通过networkctl看,这是我得到的结果;
WARNING: systemd-networkd is not running, output will be incomplete. IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback n/a unmanaged 2 bond0 ether n/a unmanaged 3 dummy0 ether n/a unmanaged 4 ifb0 ether n/a unmanaged 5 ifb1 ether n/a unmanaged 6 eth0 ether n/a unmanaged 7 eth1 ether n/a unmanaged 8 teql0 void n/a unmanaged 9 tunl0 tunnel n/a unmanaged 10 sit0 sit n/a unmanaged 11 ip6tnl0 tunnel6 n/a unmanaged
界面名称显然是eth0而不是别的。 我想知道是否某种types的DHCP服务干扰,或者如果另一个服务实际上pipe理接口。 我不认为NetworkManager被安装为在刷新eth0之后再次ping服务器的唯一方法是尝试启动networking,但是networking仍然在相同的错误上崩溃。 我害怕的是,这将导致服务器在硬重启时无法启动。
有没有人有关于这个问题的build议?
编辑1:这里的ifconfig -a,这里是eth0和eth0:0
eth0 Link encap:Ethernet HWaddr 0c:c4:7a:c3:4e:f2 inet addr:xxx.xx.xx.146 Bcast:xxx.xx.xx.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2283 errors:0 dropped:0 overruns:0 frame:0 TX packets:251 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:149408 (149.4 KB) TX bytes:41071 (41.0 KB) eth0:0 Link encap:Ethernet HWaddr 0c:c4:7a:c3:4e:f2 inet addr:yy.yy.yyy.153 Bcast:yy.yy.yyy.153 Mask:255.255.255.255 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 eth1 Link encap:Ethernet HWaddr 0c:c4:7a:c3:4e:f3 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
这里是在var / log / syslog中发生了什么,它可能是一个问题与后缀?
Jun 16 09:26:32 www postfix[3583]: * Reloading Postfix configuration... Jun 16 09:26:32 www postfix[3588]: Postfix is running with backwards-compatible default settings Jun 16 09:26:32 www postfix[3588]: See http://www.postfix.org/COMPATIBILITY_README.html for details Jun 16 09:26:32 www postfix[3588]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload" Jun 16 09:26:32 www postfix/master[1773]: reload -- version 3.1.0, configuration /etc/postfix Jun 16 09:26:32 www postfix[3583]: ...done. Jun 16 09:26:32 www systemd[1]: Reloaded LSB: Postfix Mail Transport Agent. Jun 16 09:26:32 www systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE Jun 16 09:26:32 www systemd[1]: Failed to start Raise network interfaces. Jun 16 09:26:32 www systemd[1]: networking.service: Unit entered failed state. Jun 16 09:26:32 www systemd[1]: networking.service: Failed with result 'exit-code'.