fix: Preserve gateway MAC address

This commit is contained in:
Kroese 2025-02-24 03:45:26 +01:00 committed by GitHub
parent 1c9b793c75
commit 9dd25e23c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -213,6 +213,11 @@ configureNAT() {
error "$tuntap" && return 1
fi
GATEWAY_MAC=$(echo "$VM_NET_MAC" | rev)
if ! ip link set dev "$VM_NET_TAP" address "$GATEWAY_MAC"; then
warn "Failed to set gateway MAC address.."
fi
while ! ip link set "$VM_NET_TAP" up promisc on; do
info "Waiting for TAP to become available..."
sleep 2
@ -389,8 +394,8 @@ if [[ "$IP" == "172.17."* ]]; then
warn "your container IP starts with 172.17.* which will cause conflicts when you install the Container Manager package inside DSM!"
fi
if [[ -d "/sys/class/net/$VM_NET_TAP" ]]; then
info "Lingering interface will be removed..."
if [[ -d "/sys/class/net/$VM_NET_TAP" ]]; then
info "Lingering interface will be removed..."
ip link delete "$VM_NET_TAP" || true
fi