proxmox-management/get_linklocal_for_vm

12 lines
227 B
Text
Raw Permalink Normal View History

2023-10-26 16:45:29 +02:00
#!/bin/sh
set -e
mac_to_ipv6_ll() {
IFS=':'; set $1; unset IFS
echo "fe80::$(printf %02x $((0x$1 ^ 2)))$2:${3}ff:fe$4:$5$6"
}
mac_to_ipv6_ll $(qm config $1 | grep -oE ..:..:..:..:..:.. | tr '[:upper:]' '[:lower:]')