Commit e2cd4b9c authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Remove gateway

parent 4f6ccbd4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ set -Eeuo pipefail
configureDHCP() {

  VM_NET_VLAN="${VM_NET_TAP}_vlan"
  GATEWAY=$(ip r | grep default | awk '{print $3}')
  NETWORK=$(ip -o route | grep "${VM_NET_DEV}" | grep -v default | awk '{print $1}')
  IP=$(ip address show dev "${VM_NET_DEV}" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)

@@ -39,8 +38,8 @@ configureDHCP() {

  ip address add "${IP}" dev "${VM_NET_VLAN}"
  ip link set dev "${VM_NET_VLAN}" up

  ip route flush dev "${VM_NET_VLAN}"
  
  ip route del "${NETWORK}" dev "${VM_NET_DEV}"
  ip route add "${NETWORK}" dev "${VM_NET_VLAN}" metric 0