From b5f92f417dc3689f4a8d6e4fa298a9073379cd04 Mon Sep 17 00:00:00 2001 From: Martin Wiebe Date: Wed, 8 Jan 2025 09:10:30 +0000 Subject: [PATCH 1/3] Fix attach_eth_if function --- src/run_openwrt.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/run_openwrt.sh b/src/run_openwrt.sh index 3167514..88c097d 100755 --- a/src/run_openwrt.sh +++ b/src/run_openwrt.sh @@ -54,9 +54,14 @@ attach_eth_if () { read MAC Date: Wed, 8 Jan 2025 10:44:29 +0000 Subject: [PATCH 2/3] Using the right variable --- src/run_openwrt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/run_openwrt.sh b/src/run_openwrt.sh index 88c097d..09bc7ab 100755 --- a/src/run_openwrt.sh +++ b/src/run_openwrt.sh @@ -55,13 +55,13 @@ attach_eth_if () { QEMU_IF_MAC=${QEMU_MAC_OUI}${MAC:8} # Replaces the 8 first characters of the original MAC # Deacticate host interface - ip link set $HOST_IF down + ip link set $CONTAINER_IF down # Change MAC address of new interface ip link set $QEMU_IF address $QEMU_IF_MAC # Reactivate interfaces - ip link set $QEMU_IF up && ip link set $HOST_IF up + ip link set $QEMU_IF up && ip link set $CONTAINER_IF up } # Create veth pairs between host system and Docker container From 183ef15bcfeef808732d88cebc1d6b360344cb40 Mon Sep 17 00:00:00 2001 From: Martin Wiebe Date: Wed, 8 Jan 2025 10:52:23 +0000 Subject: [PATCH 3/3] Add comment for clarity --- src/run_openwrt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/run_openwrt.sh b/src/run_openwrt.sh index 09bc7ab..fa14d2c 100755 --- a/src/run_openwrt.sh +++ b/src/run_openwrt.sh @@ -55,6 +55,7 @@ attach_eth_if () { QEMU_IF_MAC=${QEMU_MAC_OUI}${MAC:8} # Replaces the 8 first characters of the original MAC # Deacticate host interface + # Ensure the interface is down to reliably change the MAC address without issues ip link set $CONTAINER_IF down # Change MAC address of new interface