我使用模板debian-7-turnkey-lamp_13.0-1_amd64.tar.gz在ProxmoxVE 3(安装在Virtualbox for Windows 4.3.12中的图像)中设置了CT。将这两个IP添加到容器后: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
文件会恢复,更改会消失,互联网无法再次访问。
所以我的问题是:我如何能够持久改变对interfaces文件所做的更改?
非常感谢您提前,
答案 0 :(得分:1)
所以我的问题是:我如何能够持久改变对interfaces文件所做的更改?
您的问题的答案位于文件的标题中。
# 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.