summaryrefslogtreecommitdiffstats
path: root/src/os-plugins/plugins/vmware/init-hooks/60-have-servconfig/vm-dhcpd.sh
blob: 1717a8db7b2701e14cf54c0cb0b60a6c1add7c1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
# Copyright (c) 2010..2013 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your feedback to feedback@openslx.org
#
# General information about OpenSLX can be found at http://openslx.org
#
# Init hook to create a bridge on the active network interface
# (should be kept identical in vmware, virtualbox and qemukvm plugins)
#############################################################################

. /etc/openslx.conf

CONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}
testmkd ${CONFDIR}

# read the DNS configuration and if available set WPAD configuration
. /etc/initramfs-setup
[ -z "${domain_name_servers}" ] && domain_name_servers="8.8.8.8"
[ -n "${wpad}" ] && wpad_config="option  wpad    ${wpad}"

# configuring dhcpd stub for virtual networks
cat > ${CONFDIR}/udhcpd.conf << EOF
# general udhcpd configuration file for virtual machines written by
# $0 during OpenSLX stage3 configuration

# start and end of the IP lease block
start 		CNETWORK.20
end		CNETWORK.100

# interface that udhcpd will use
interface	NWIF

# how long an offered address is reserved (leased) in seconds
offer_time	6000

# location of the leases file
lease_file	LEASEFILE

# location of the pid file
pidfile		PIDFILE

option	dns	${domain_name_servers}
option	subnet	255.255.255.0
option	router	CNETWORK.1
option	wins	CNETWORK.10
option	domain	virtual.site ${domain_name}
${wpad_config}

# additional options known to udhcpd
#subnet			#timezone
#router			#timesvr
#namesvr		#dns
#logsvr			#cookiesvr
#lprsvr			#bootsize
#domain			#swapsvr
#rootpath		#ipttl
#mtu			#broadcast
#wins			#lease
#ntpsrv			#tftp
#bootfile		#wpad
EOF