I got 3 VMS and i fixed after many hours all with this Script, because Proxmox Claim MAC's fom Network.
I simply set the Main-Mac to all tap-Instances
With Crontab i execute this script every Minute and its logging changes
If anyone change something in Network of VMS, it creates a new tap-Instance and my script set this back to the correct MAC
Hope, this help everyone
@proxmox-Team
Best will be, if is possible to define static-MAC's for the tap-Instances
I simply set the Main-Mac to all tap-Instances
With Crontab i execute this script every Minute and its logging changes
If anyone change something in Network of VMS, it creates a new tap-Instance and my script set this back to the correct MAC
Hope, this help everyone
Code:
#/home/mac-fixer.sh
#!/bin/bash
tap100=$(ip addr show tap100i0 | grep "link/ether" | awk '{print $2}' | cut -d/ -f1)
if [ $tap100 != "MY:AW:SO:ME:AD:RR" ]
then
echo "tap100 is NOT MY:AW:SO:ME:AD:RR CHANGING NOW"
echo [$(date +"%d.%m.%Y-%H:%M:%S")][tap100] Set Mac to MY:AW:SO:ME:AD:RR >> mac-fix.log
ip link set dev tap100i0 down
ip link set dev tap100i0 address MY:AW:SO:ME:AD:RR
ip link set dev tap100i0 up
else
echo "tap100 is MY:AW:SO:ME:AD:RR"
fi
tap200=$(ip addr show tap200i0 | grep "link/ether" | awk '{print $2}' | cut -d/ -f1);
if [ $tap200 != "MY:AW:SO:ME:AD:RR" ]
then
echo "tap200 is NOT MY:AW:SO:ME:AD:RR CHANGING NOW"
echo [$(date +"%d.%m.%Y-%H:%M:%S")][tap200] Set Mac to MY:AW:SO:ME:AD:RR >> mac-fix.log
ip link set dev tap200i0 down
ip link set dev tap200i0 address MY:AW:SO:ME:AD:RR
ip link set dev tap200i0 up
else
echo "tap200 is MY:AW:SO:ME:AD:RR"
fi
tap500=$(ip addr show tap500i0 | grep "link/ether" | awk '{print $2}' | cut -d/ -f1);
if [ $tap500 != "MY:AW:SO:ME:AD:RR" ]
then
echo "tap500 is NOT MY:AW:SO:ME:AD:RR CHANGING NOW"
echo [$(date +"%d.%m.%Y-%H:%M:%S")][tap500] Set Mac to MY:AW:SO:ME:AD:RR >> mac-fix.log
ip link set dev tap500i0 down
ip link set dev tap500i0 address MY:AW:SO:ME:AD:RR
ip link set dev tap500i0 up
else
echo "tap500 is MY:AW:SO:ME:AD:RR"
fi
@proxmox-Team
Best will be, if is possible to define static-MAC's for the tap-Instances
Last edited: