|
|
|
在一台 arm vps ( 6c16g200G ) 上装了 pve ,因为只有单 ip ,网络按照文档中的基于 iptables 的网络地址转换配置进行配置- # The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceallow-hotplug enp1s0iface enp1s0 inet static address xxx.xxx..xxx..xxx./24 gateway xxx..xxx..xxx..xxx. # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 1.0.0.1 8.8.4.4 iface enp1s0 inet6 dhcpauto vmbr0iface vmbr0 inet staticaddress 10.10.10.1/24bridge-ports nonebridge-stp offbridge-fd 0post-up echo 1 > /proc/sys/net/ipv4/ip_forwardpost-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o enp1s0 -j MASQUERADEpost-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o enp1s0 -j MASQUERADE
复制代码
然后在 pve webui 中新建一个 alpine 非特权容器,网络设置中也手动设置了 ip 和网关
进入容器后,发现容器没网络,进一步排查发现 /etc/network/interfaces 中的配置为 iface vmbr0 inet dhcp,于是手动修改了 /etc/network/interfaces
- auto loiface lo inet loopbackauto eth0iface eth0 inet staticaddress 10.10.10.100/24gateway 10.10.10.1
复制代码
重启网络,连网正常,但。。一单容器重启,/etc/network/interfaces 文件被还原为
- auto loiface lo inet loopbackauto eth0iface eth0 inet dhcp
复制代码
试过把容器删除重新建一个,也一样。。
arm vps 安装的是 debian 11 ,pve 用的是佛西版 https://github.com/jiangcuo/Proxmox-Arm64 |
|