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

Check kernel version

parent 3c4e5614
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -112,8 +112,10 @@ configureNAT () {
  iptables -t nat -A PREROUTING -i "${VM_NET_DEV}" -p tcp  -j DNAT --to $VM_NET_IP
  iptables -t nat -A PREROUTING -i "${VM_NET_DEV}" -p udp  -j DNAT --to $VM_NET_IP

  if (( KERNEL > 4 )); then
    # Hack for guest VMs complaining about "bad udp checksums in 5 packets"
    iptables -A POSTROUTING -t mangle -p udp --dport bootpc -j CHECKSUM --checksum-fill || true
  fi

  #Enable port forwarding flag
  [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]] && sysctl -w net.ipv4.ip_forward=1