Really thank you for your work.the patch to avoid bad traffic with wrong mac to vm && firewall is not yet available in proxmox7. I just send the patch to proxmox devel mailing list friday
https://lists.proxmox.com/pipermail/pve-devel/2021-September/050090.html
https://lists.proxmox.com/pipermail/pve-devel/2021-September/050093.html
https://lists.proxmox.com/pipermail/pve-devel/2021-September/050095.html
https://lists.proxmox.com/pipermail/pve-devel/2021-September/050094.html
(If you have a proxmox7 server to test, I can provide you some test .deb packages)
The mac address prefix option at datacenter level, is prefix when you autogenerate mac address for the vms.
auto vmbr0
iface vmbr0 inet manual
bridge ports ...
...
bridge-disable-mac-learning 1
Nooo is one of the best companies in Europe. Cheap servers, flat 1gbps bandwidth. I will try a new setup soon with Routed networking instead of bridged.I'm tired of hetzner mac issues and thinking to switch provider.
But seriously, what the reason they implemented a mac address monitoring? How it's helping them? What issues solving?
I have a problem, i am looking for help. I pay to help.
Hetzner send me this:
We have detected that your server is using different MAC addresses from those allowed by your Robot account.
<snip>
Same experience here ...Nice, almost >2 years and on PVE 7.4-17 I got this warning from hetzner.
In the pve-firewall.log i see unallowed MACs to DEST=notmyIP (but neighbor)
Could it be that PVE means to forward this to the "notmyIP"?
I also have that implemented (and disabled multicast flood & unicast flood)."bridge-disable-mac-learning 1" still apply for bridged setup at hetzner
+ if you use proxmox firewall, dont use "reject", use "drop"
Define an IPSet and add each of your IP addresses making sure the "nomatch" check box is ticked for each item. Then you just add your DROP rule with destination set to your IPSet.Unfortunately I did NOT find an easy way to Invert the sense of Matching, so I went ahead and build a "not_assigned_public_ips" list consisting of the entire /26 Subnet MINUS my Own IPs and the Gateway ....
I originally tried that but I think it was not behaving correctly.Define an IPSet and add each of your IP addresses making sure the "nomatch" check box is ticked for each item. Then you just add your DROP rule with destination set to your IPSet.
So what's the problem with having a firewall rule that drops everything not addresses to one of your IP addresses?I also have that implemented (and disabled multicast flood & unicast flood).
I also tried to use "port isolation" for the member of a Bridge, that also does NOT solve this issue.
Neither does ebtables rules (because actually the traffic is addressed to my MAC but NOT my IP - weird stuff at Hetzner).
So if I don't have a firewall rule in place I am getting INPUT traffic which is destined to other Servers in my Subnet, NOT my Servers.
So from what I can see, the problem is NOT solved.
Besides the fact that the ipset with the nomatch didn't appear to work correctly (at least for me), what feels wrong is that we filter on the IPv4 Level, rather than MAC Address. Then again it's true that I cannot really filter by MAC Address since apparently I am marked as the destination MAC, even though the IP address is not mine ...So what's the problem with having a firewall rule that drops everything not addresses to one of your IP addresses?
And yeah, the whole my MAC other persons IP is something weird Hetzner does, but they aren't going to fix it, so we have to work around it.
So you agree that the problem is NOT fixed by:So what's the problem with having a firewall rule that drops everything not addresses to one of your IP addresses?
And yeah, the whole my MAC other persons IP is something weird Hetzner does, but they aren't going to fix it, so we have to work around it.
bridge-disable-mac-learning 1
bridge-unicast-flood off
bridge-multicast-flood off
bridge-vlan-aware yes
bridge-vids 2-4096
#!/bin/bash
mapfile -t list < <( find /sys -iname *unicast_flood* )
for item in "${list[@]}"
do
# Echo
if [[ -n "${verbose}" ]]
then
echo "Executing: echo 0 > ${item}"
fi
# Disable unicast flooding on all interfaces
echo 0 > $item
done
/etc/network/interfaces
to filter based on MAC Address but it's most likely dropping stuff destined to me by the Gateway, so NOT a good Solution (because anyway the Destination MAC Address is mine, even though the IP is NOT):auto vmbr0
iface vmbr0 inet static
...
pre-up ebtables -I OUTPUT -o eth0 --among-src ! MY_MAC_01,MY_MAC_02 --log-level info --log-prefix "MAC-FLOOD-OUTPUT" --log-ip -j DROP
pre-up ebtables -I FORWARD -o eth0 --among-src ! MY_MAC_01,MY_MAC_02 --log-level info --log-prefix "MAC-FLOOD-FORWARD-OUTBOUND" --log-ip -j DROP
pre-up ebtables -I FORWARD -i eth0 --among-dst ! MY_MAC_01,MY_MAC_02 --log-level info --log-prefix "MAC-FLOOD-FORWARD-INBOUND" --log-ip -j DROP
pre-up ebtables -I INPUT -i eth0 --among-dst ! MY_MAC_01,MY_MAC_02 --log-level info --log-prefix "MAC-FLOOD-INPUT" --log-ip -j DROP
ipfilter
setting on VM Level with ipfilter-net0
is NOT sufficient, because the Host does not have such a setting (which IMHO is what your Firewall Rule helps with) . On VM Level adding the IPs to is most likely sufficient (but I also added the Firewall Rule on VM Level as well to drop block_wrong_dest
there as well just in case), but the Host Part is NOT taken care of "by default".ipfilter-eth0
or ipfilter-vmbr0
, similarly to what is done to VMs,pve-firewall restart
either (am I letting some Packets go through while the Firewall is restarting/reloading the rules ?) ....As I said, unfortunately, with Hetzner at least, this does NOT seem to be sufficient .Here a summary to help people:
bridge-disable-mac-learning 1
This is disabling unicast flood && bridge learning on the bridge. (proxmox register manually vm mac on ports)
That mean that traffic incoming to the server is not forwarded to the vms if the destination mac is different than the vm mac. (It'll be dropped when entering the bridge)
If bridge-vlan-aware is enabled && bridge-disable-mac-learning 1 , the linux kernel should disable promisc mode on the bridge. (all vms interfaces need to be started with unicast flood disable, to that need at minimum a full restart of the server or a full restart of all vms after disabling bridge-disable-mac-learning)
This should block incoming packets with dst mac address unknown, the packet will be dropped at physical interface level, before going into the server.
Now, about the vm firewall rules REJECT vs DROP.
This is because of current iptables implementation, where we need an extra fwbrX bridge. The reject packet are send by proxmox itself, with a random mac of the fwbr bridge.
This should be finally fixed with the new nftables implementation, because we don't need the extra fwbr bridge.
I don't have hetzner server to test, but if somebody could test it, it could be great
BTW,if you are a hetzner customer, please ask them to fix their fucking networking layer2 filtering.
(basically, they don't filter/register mac on their physical switch, I think because they use cheap switch. So they use some kind of async deamon, looking traffic after bad packets are flooded, then block their switch ports)