Ubuntu服务器:networking在/ etc / network / interfaces中使用MODPROBE选项失败…?

由于某种原因(我还没有确定),昨天早上,我们的networking服务器(运行Ubuntu 8.04.2 LTS – hardy)的networking服务无法启动,我们的网站停止运行。

尝试重新启动时,我注意到下面的错误信息:

* Reconfiguring network interfaces... /etc/network/interfaces:6: option with empty value ifup: couldn't read interfaces file "/etc/network/interfaces" ...fail! 

/etc/network/interfaces文件中的第6行涉及到一个MODPROBE命令,我相信这个命令会加载到ip_conntrack_ftp模块中,以便我可以在我的FTP服务器(vsftpd)上使用PASV:(打破modprobe命令,注释如下)

 # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or # /usr/share/doc/ifupdown/examples for more information. # The loopback network interface auto lo iface lo inet loopback #MODPROBE=/sbin/modprobe #$MODPROBE ip_conntrack_ftp pre-up iptables-restore < /etc/iptables.up.rules # The primary network interface # Uncomment this and configure after the system has booted for the first time auto eth0 iface eth0 inet static address xxx.xxx.xxx.xxx netmask 255.255.255.0 gateway xxx.xxx.xxx.1 dns-nameservers xxx.xxx.xxx.4 xxx.xxx.xxx.5 

我已经validation了/sbin中有一个名为modprobe的文件。

就像我刚才所说的那样,这个设置一直在完美地工作,直到昨天上午(虽然我的老板说这个网站实际上是在美东时间晚上十一点的晚上)。

(A)为什么这个打破,(B)我怎么能重新启用ip_conntrack_ftp模块?

(A)为什么这个打破了

我不认为你可以从/etc/networking/interfaces执行modprobe。 您可能需要使用pre-up指令:

从界面(5)手册页:

  pre-up command Run command before bringing the interface up. If this command fails then ifup aborts, refraining from marking the interface as configured, prints an error message, and exits with status 0. This behavior may change in the future. 

不过,最好将模块的名称添加到/etc/modules以便在启动时加载。 (注意,如果命令pre-up命令执行失败,你的界面将不会出现 – 即使其他configuration完全正常)。

(B)如何重新启用ip_conntrack_ftp模块?

从模块(5)手册页:

  The /etc/modules file contains the names of kernel modules that are to be loaded at boot time, one per line. Arguments can be given in the same line as the module name. Lines beginning with a '#' are ignored. 

您可以通过将其名称添加到/ etc / modules来重新启用该模块。

尝试运行命令:

modprobe ip_conntrack_ftp

如果它工作正常,这意味着该模块正在正常加载。 那么每当接口重新启动时,不要添加模块,而应将上述命令添加到/etc/rc.local

那么模块会一直保持加载到系统中(而不是在networking服务启动时尝试加载)

另外,为了testing,你可以在两行注释“MODPROBE”的地方添加这个命令“/ sbin / modprobe ip_conntrack_ftp”,然后尝试它是否工作。