From 50f7fdde52cc46ac2960703f12d2658cb618905a Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 7 May 2023 13:51:08 +0200 Subject: [PATCH] macvlan --- run/network.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/run/network.sh b/run/network.sh index ba9c9d3..153045e 100644 --- a/run/network.sh +++ b/run/network.sh @@ -28,11 +28,7 @@ configureDHCP() { [[ "${DEBUG}" == [Yy1]* ]] && set -x { ip link add link "${VM_NET_DEV}" "${VM_NET_VLAN}" type macvlan mode bridge ; rc=$?; } || : - if (( rc != 0 )); then - - echo "INFO: Could not create macvlan, skipping..." - - else + if (( rc == 0 )); then ip address add "${IP}" dev "${VM_NET_VLAN}" ip link set dev "${VM_NET_VLAN}" up @@ -43,6 +39,10 @@ configureDHCP() { ip route add "${NETWORK}" dev "${VM_NET_VLAN}" metric 0 ip route add default via "${GATEWAY}" + else + + echo "INFO: Could not create ${VM_NET_VLAN} on ${VM_NET_DEV}, skipping..." + fi { ip link add link "${VM_NET_DEV}" name "${VM_NET_TAP}" address "${VM_NET_MAC}" type macvtap mode bridge ; rc=$?; } || : @@ -214,8 +214,6 @@ if [[ "${DEBUG}" == [Yy1]* ]]; then IP=$(ip address show dev "${VM_NET_DEV}" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/) echo "INFO: Container IP is ${IP} with gateway ${GATEWAY}" && echo - #ifconfig - #ip route && echo fi