Ubuntu 服务器:/etc/network/interfaces 中的 MODPROBE 选项导致网络连接失败......?

Ubuntu 服务器:/etc/network/interfaces 中的 MODPROBE 选项导致网络连接失败......?

由于某种原因(我还不能确定),昨天早上我们的网络服务器(运行 Ubuntu 8.04.2 LTS -- hardy)上的网络服务无法启动,并且我们的网站瘫痪了。

当我尝试重新启动它时,我注意到以下错误消息:

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

文件中的第 6 行/etc/network/interfaces涉及 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

我已经验证有一个/sbin名为的文件modprobe

就像我之前说的,这个设置直到昨天早上一直运行良好(尽管我的老板说该网站实际上在前一天晚上 11 点(美国东部时间)就瘫痪了)。

有人可以解释一下(A)为什么会出现这种情况,以及(B)我如何重新启用该ip_conntrack_ftp模块吗?

答案1

有人能解释一下(A)为什么这个坏了

我认为你不能直接执行 modprobe /etc/networking/interfaces。你可能需要使用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执行失败,您的界面将不会出现 - 即使其余配置都很好)。

以及(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.

答案2

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

答案3

尝试运行命令:

modprobe ip_conntrack_ftp

如果运行正常,则说明模块加载正常。然后,无需在每次重新启动接口时添加模块,只需将上述命令添加到 /etc/rc.local

那么模块将始终保持加载到系统中。(相反,它会在网络服务启动时尝试自行加载)

或者,为了测试,您可以在用“MODPROBE”注释的两行位置添加此命令“/sbin/modprobe ip_conntrack_ftp”,然后尝试是否有效。

相关内容