Commit 86d107e3 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

dnsmasq

parent a321726b
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -109,6 +109,11 @@ configureNAT () {
    fi
  fi

  NET_OPTS="-netdev tap,ifname=${VM_NET_TAP},script=no,downscript=no,id=hostnet0"

  { exec 40>>/dev/vhost-net; rc=$?; } 2>/dev/null || :
  (( rc == 0 )) && NET_OPTS="$NET_OPTS,vhost=on,vhostfd=40"

  # dnsmasq configuration:
  DNSMASQ_OPTS="$DNSMASQ_OPTS --dhcp-range=$VM_NET_IP,$VM_NET_IP --dhcp-host=$VM_NET_MAC,,$VM_NET_IP,$VM_NET_HOST,infinite --dhcp-option=option:netmask,255.255.255.0"

@@ -116,11 +121,6 @@ configureNAT () {
  echo "0 $VM_NET_MAC $VM_NET_IP $VM_NET_HOST 01:${VM_NET_MAC}" > /var/lib/misc/dnsmasq.leases
  chmod 644 /var/lib/misc/dnsmasq.leases

  NET_OPTS="-netdev tap,ifname=${VM_NET_TAP},script=no,downscript=no,id=hostnet0"

  { exec 40>>/dev/vhost-net; rc=$?; } 2>/dev/null || :
  (( rc == 0 )) && NET_OPTS="$NET_OPTS,vhost=on,vhostfd=40"

  # Build DNS options from container /etc/resolv.conf

  if [[ "${DEBUG}" == [Yy1]* ]]; then
@@ -196,8 +196,7 @@ fi
if [[ "${DHCP}" == [Yy1]* ]]; then

  if [[ "$GATEWAY" == "172."* ]]; then
    error "You cannot enable DHCP while the container is "
    error "in a bridge network, only on a macvlan network!" && exit 86
    error "You can only enable DHCP while the container is on a macvlan network!" && exit 86
  fi

  # Configuration for DHCP IP