找回密码
 立即注册
查看: 107|回复: 0

在 arm 版的 pve 中建了一个 alpine lxc 容器,发现每次重启容...

[复制链接]

1964

主题

0

回帖

1964

积分

金牌会员

积分
1964
发表于 2023-7-21 18:08:57 | 显示全部楼层 |阅读模式
在一台 arm vps ( 6c16g200G ) 上装了 pve ,因为只有单 ip ,网络按照文档中的基于 iptables 的网络地址转换配置进行配置
  1. # 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
  1. auto loiface lo inet loopbackauto eth0iface eth0 inet staticaddress 10.10.10.100/24gateway 10.10.10.1
复制代码

重启网络,连网正常,但。。一单容器重启,/etc/network/interfaces 文件被还原为
  1. auto loiface lo inet loopbackauto eth0iface eth0 inet dhcp
复制代码

试过把容器删除重新建一个,也一样。。

arm vps 安装的是 debian 11 ,pve 用的是佛西版 https://github.com/jiangcuo/Proxmox-Arm64
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|翻墙党

GMT+8, 2026-9-29 19:38 , Processed in 0.058997 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表