fix: Preserve gateway MAC address (#898)
Some checks are pending
Build / Check (push) Waiting to run
Build / Build (push) Blocked by required conditions

This commit is contained in:
Kroese 2025-02-24 03:48:42 +01:00 committed by GitHub
parent 1c9b793c75
commit 2adf0b292b
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