问题原文
原帖链接 · 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*
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
