diff --git a/src/network.sh b/src/network.sh index 3a9d297..a5842e4 100644 --- a/src/network.sh +++ b/src/network.sh @@ -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