我已经在ProxmoxVE 3(安装在Windows4.3.12的Virtualbox中的图像)中设置了一个CT,使用的模板是Debian-7-交键灯_13.0-1_amd64.tar.gz。在将这两个I添加到容器: 192.168.56.138和10.0.2.20之后,我启动容器。/etc/network/interfaces文件显示如下:
# This configuration file is auto-generated.
#
# WARNING: Do not edit this file, your changes will be lost.
# Please create/edit /etc/network/interfaces.head and
# /etc/network/interfaces.tail instead, their contents will be
# inserted at the beginning and at the end of this file, respectively.
#
# NOTE: it is NOT guaranteed that the contents of /etc/network/interfaces.tail
# will be at the very end of this file.
#
# Auto generated lo interface
auto lo
iface lo inet loopback
# Auto generated venet0 interface
auto venet0
iface venet0 inet manual
up ifconfig venet0 up
up ifconfig venet0 127.0.0.2
up route add default dev venet0
down route del default dev venet0
down ifconfig venet0 down
iface venet0 inet6 manual
up route -A inet6 add default dev venet0
down route -A inet6 del default dev venet0
auto venet0:0
iface venet0:0 inet static
address 192.168.56.138
netmask 255.255.255.255
auto venet0:1
iface venet0:1 inet static
address 10.0.2.20
netmask 255.255.255.255通过这种配置,可以通过192.168.56.138从主机访问它,但它不能访问Internet。
经过多次试验和错误之后,我想出了一种方法,使它能够访问互联网。我只需要删除最后四行:
auto venet0:1
iface venet0:1 inet static
address 10.0.2.20
netmask 255.255.255.255然后运行服务网络重新启动,仅此而已:因特网可供客人CT使用。
但是当我重新启动时,原始的/etc/network/interfaces文件回来了,更改消失了,互联网又无法访问了。
因此,我的问题是:如何使对接口文件所做的更改持久?
提前谢谢你,
发布于 2014-11-24 10:18:32
因此,我的问题是:如何使对接口文件所做的更改持久?
您的问题的答案在文件的标题中。
# WARNING: Do not edit this file, your changes will be lost.
# Please create/edit /etc/network/interfaces.head and
# /etc/network/interfaces.tail instead, their contents will be
# inserted at the beginning and at the end of this file, respectively.https://stackoverflow.com/questions/25625920
复制相似问题