1

I have set up a CT in ProxmoxVE 3 (image installed in Virtualbox for Windows 4.3.12) using the template debian-7-turnkey-lamp_13.0-1_amd64.tar.gz. After adding these two IPs to the container: 192.168.56.138 and 10.0.2.20, I start the container. The /etc/network/interfaces file shows this:

# 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

With this configuration it can be accessed from the host via 192.168.56.138, but it can't access Internet.

After many trials and errors, I figure out a way to enable it to access internet. I only need to delete the last four lines:

auto venet0:1
iface venet0:1 inet static
address 10.0.2.20
netmask 255.255.255.255

And run service networking restart, and that's it: internet is available for the guest CT.

But when I reboot, the original /etc/network/interfaces file comes back, the changes disappear and internet is unreachable again.

So my question is: how can I make persistent the changes made to the interfaces file?

Thank you very much in advance,

4

1 に答える 1

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.
于 2014-11-24T10:18:32.660 に答える