Fix attach_eth_if function

This commit is contained in:
Martin Wiebe
2025-01-08 09:10:30 +00:00
parent ae700d5e52
commit b5f92f417d
+8 -3
View File
@@ -54,9 +54,14 @@ attach_eth_if () {
read MAC </sys/class/net/$CONTAINER_IF/address
QEMU_IF_MAC=${QEMU_MAC_OUI}${MAC:8} # Replaces the 8 first characters of the original MAC
# Active new interface
ip link set $QEMU_IF address $QEMU_IF_MAC up
#ip link set $QEMU_IF up
# Deacticate host interface
ip link set $HOST_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
}
# Create veth pairs between host system and Docker container