Unverified Commit c380257f authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Detect host mode networking (#848)

parent 570dcd80
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ RUN set -eu && \
        nginx \
        swtpm \
        procps \
        ethtool \
        iptables \
        iproute2 \
        apt-utils \
+7 −0
Original line number Diff line number Diff line
@@ -401,6 +401,13 @@ getInfo() {
    error "$ADD_ERR -e \"VM_NET_DEV=NAME\" to specify another interface name." && exit 26
  fi

  NIC=$(ethtool -i "$VM_NET_DEV" | grep -m 1 -i 'driver:' | awk '{print $(2)}')

  if [[ "${NIC,,}" != "veth" ]]; then
    [[ "$DEBUG" == [Yy1]* ]] && info "Detected NIC: $NIC"
    error "This container does not support host mode networking!" && exit 29
  fi

  BASE_IP="${VM_NET_IP%.*}."

  if [ "${VM_NET_IP/$BASE_IP/}" -lt "3" ]; then