
Proxmox VE限制虚拟机使用的IP
Pixiv ID: 113182641 Author ID: 10889794
标准 IP 集 ipfilter-net*
原文
Standard IP set ipfilter-net*
These filters belong to a VM’s network interface and are mainly used to prevent IP spoofing. If such a set exists for an interface then any outgoing traffic with a source IP not matching its interface’s corresponding ipfilter set will be dropped.
For containers with configured IP addresses these sets, if they exist (or are activated via the general IP Filter option in the VM’s firewall’s options tab), implicitly contain the associated IP addresses.
For both virtual machines and containers they also implicitly contain the standard MAC-derived IPv6 link-local address in order to allow the neighbor discovery protocol to work.
翻译
标准 IP 集 ipfilter-net*
这些过滤器属于虚拟机的网络接口,主要用于防止 IP 欺骗。如果某个接口存在这样的集,则任何源 IP 与其接口对应的 ipfilter 集不匹配的传出流量都将被丢弃。
对于配置了 IP 地址的容器,这些集合(如果存在)(或通过 VM 防火墙的选项选项卡中的常规 IP 过滤器选项激活)隐式包含关联的 IP 地址。
对于虚拟机和容器,它们还隐式包含标准 MAC 派生的 IPv6 链路本地地址,以允许邻居发现协议正常工作。
开始限制IP
在PVE下创建以下文件
1 | /etc/pve/firewall/<VMID>.fw |
这里的意思是net0只能使用192.168.2.10这个IP,如果使用其他的IP数据将会被丢弃,从而达到限制虚拟机只能使用此IP的目的。
[!TIP]
这里可以有多个IP,一旦启用此规则该VM就无法使用除此之外的任何IP,如果你没有写IPv6地址则代表该VM无法使用IPv6地址。
在WebUI操作
等着吧 还没来得及写….
参考文献
- 标题: Proxmox VE限制虚拟机使用的IP
- 作者: Neko Sakura
- 创建于 : 2024-09-23 22:21:09
- 更新于 : 2025-05-04 08:43:16
- 链接: https://blog.nekocat.org/2024/09/23/proxmox-limit-ip/
- 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。