全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 624|回复: 0

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

[复制链接]
发表于 2023-7-21 17:59:56 | 显示全部楼层 |阅读模式
在一台 arm vps ( 6c16g200G ) 上装了 pve ,因为只有单 ip ,网络按照文档中的基于 iptables 的网络地址转换配置进行配置
  1. # The loopback network interface
  2. auto lo
  3. iface lo inet loopback

  4. # The primary network interface
  5. allow-hotplug enp1s0
  6. iface enp1s0 inet static
  7.         address xxx.xxx..xxx..xxx./24
  8.         gateway xxx..xxx..xxx..xxx.
  9.         # dns-* options are implemented by the resolvconf package, if installed
  10.         dns-nameservers 1.0.0.1 8.8.4.4
  11. iface enp1s0 inet6 dhcp


  12. auto vmbr0
  13. iface vmbr0 inet static
  14. address  10.10.10.1/24
  15. bridge-ports none
  16. bridge-stp off
  17. bridge-fd 0
  18. post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
  19. post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o enp1s0 -j MASQUERADE
  20. post-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 lo
  2. iface lo inet loopback

  3. auto eth0
  4. iface eth0 inet static
  5. address 10.10.10.100/24
  6. gateway 10.10.10.1
复制代码


重启网络,连网正常,但。。一单容器重启,/etc/network/interfaces 文件被还原为

  1. auto lo
  2. iface lo inet loopback

  3. auto eth0
  4. iface eth0 inet dhcp
复制代码


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

arm vps 安装的是 debian 11 ,pve 用的是佛西版 https://github.com/jiangcuo/Proxmox-Arm64
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-13 03:20 , Processed in 0.055681 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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