大网数据广告活动
服务器运维问答

How to prevent stealing of (others) IP addresses on KVM/Proxmox based virtualisation hosts?

· 52CE 我爱测

Let's assume the following configuration: a router that announces IP subnets and a few Proxmox-based KVM hosts. Each Proxmox-based virtualisation host runs multiple virtual servers managed by customers and each virtual server get…

问题原文

原帖链接 · miho · CC BY-SA 4.0

Let's assume the following configuration: a router that announces IP subnets and a few Proxmox-based KVM hosts. Each Proxmox-based virtualisation host runs multiple virtual servers managed by customers and each virtual server gets one or multiple IPs assigned.

How can I prevent that (miss-configured or evil) virtual server are announcing IPs which don't belong to their server?

The best idea I could come up with is to use iptables-firewall rules to block any traffic except incoming one with the correct destination address and outgoing one with the correct source address. That should work (but would also block any broadcast traffic I guess, thought that would be acceptable for that scenario). However, is there any better way to do that (without alterations at the routers)? What is the common practice for this problem?

已采纳解答

原帖链接 · miho · CC BY-SA 4.0

After figuring out that iptables aren't the right fit for that, partly thanks to Christophers above answer for that info, I did some reading into ebtables, just to figure out that Proxmox has already built-in support for preventing IP spoofing.

All that's necessary is to add the following rule to each virtual machines firewall settings in Proxmox (see /etc/pve/firewall/<VMID>.fw files) and works with IPv4 and IPv6:

[IPSET ipfilter-net0]
1.2.3.4
2f1:2:3:4::1

That was already hidden in the official docs anyhow: see section IP Sets > Standard IP set ipfilter-net*

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-08-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。