我在我的电脑上破坏了本地主机。例如python -m SimpleHTTPServer,curl http://localhost:8000不工作。
我的 /etc/network/interfaces 的内容是空的。有谁知道这个的默认内容应该是什么?
使用网络管理器时,文件的默认内容/etc/network/interfaces通常是:
auto lo
iface lo inet loopback
Run Code Online (Sandbox Code Playgroud)
注意:这是来自我的 Ubuntu 14.04 系统,但 Debian 应该与此相同。
如果您搜索以找出哪个包/etc/network/interfaces是其中的一部分,您会发现它不是。
$ dpkg -S /etc/network/interfaces
dpkg-query: no path found matching pattern /etc/network/interfaces
Run Code Online (Sandbox Code Playgroud)
相反,它是由ifupdown包的 postinstall 脚本生成的,特别是这个脚本:/var/lib/dpkg/info/ifupdown.postinst.
注意:您知道这是一个安装后脚本,ifupdown基于它的名称和它在目录下的位置,/var/lib/dpkg/info.
# Generic stuff done on all configurations
if [ "$1" = "configure" ] ; then
# We don't need loopback interface definition anymore as
# ifupdown handles loopback interface on its own from now
if [ ! -f /etc/network/interfaces ] ; then
if [ -z "$2" ]; then
echo "Creating /etc/network/interfaces."
echo "# interfaces(5) file used by ifup(8) and ifdown(8)" > /etc/network/interfaces
echo "# Include files from /etc/network/interfaces.d:" >> /etc/network/interfaces
echo "source-directory /etc/network/interfaces.d" >> /etc/network/interfaces
else
report_warn "/etc/network/interfaces does not exist"
fi
fi
fi
Run Code Online (Sandbox Code Playgroud)