Commit 8e4bddaa authored by Leigh Stoller's avatar Leigh Stoller

Initial cut at generating the dhcpd.conf.template file on the fly, from

parameters in the defs file. Pretty simplistic at the moment, but will work
for our current setup, and for elabinelab. Rob is gonna either laugh or
shoot me.
parent 6152201d
...@@ -860,6 +860,19 @@ fi ...@@ -860,6 +860,19 @@ fi
...@@ -920,6 +933,23 @@ TBLOGFACIL="local5" ...@@ -920,6 +933,23 @@ TBLOGFACIL="local5"
LINKTEST_NSPATH="/share/linktest-ns" LINKTEST_NSPATH="/share/linktest-ns"
BOSSEVENTPORT=2927 BOSSEVENTPORT=2927
UNIFIED_BOSS_AND_OPS=0 UNIFIED_BOSS_AND_OPS=0
#
# Network config stuff. Obviously, this needs to be localized, but there are
# too many defs files too worry about right now.
#
BOSSNODE_IP=155.98.32.70
OPSNODE_IP=155.98.33.74
CONTROL_ROUTER_IP=155.98.36.1
CONTROL_NETWORK=155.98.36.0
CONTROL_NETMASK=255.255.252.0
PRIVATE_NETWORK=155.98.32.0
PRIVATE_ROUTER=155.98.32.1
PRIVATE_NETMASK=255.255.255.0
PUBLIC_NETWORK=155.98.33.0
PUBLIC_ROUTER=155.98.33.1
PUBLIC_NETMASK=255.255.255.0
DHCPD_DYNRANGE="155.98.36.200 155.98.36.249"
DHCPD_CONTROLNET_DECL=""
# #
# Okay, I know this is improper usage of --with. Too bad. # Okay, I know this is improper usage of --with. Too bad.
...@@ -1023,6 +1053,15 @@ EOF ...@@ -1023,6 +1053,15 @@ EOF
#
# If the private network is different then the control network, we need
# an extra subnet decl for it in dhcpd.conf.template. This is enormously
# crude and simplistic, but works for the local case!
#
if test "$PRIVATE_NETWORK" != "CONTROL_NETWORK"; then
DHCPD_CONTROLNET_DECL="subnet 155.98.32.0 netmask 255.255.255.0 {}"
fi
# #
# The email addresses need to be be munged for perl scripts. But, # The email addresses need to be be munged for perl scripts. But,
# php needs them un-escaped # php needs them un-escaped
...@@ -1337,7 +1376,7 @@ fi ...@@ -1337,7 +1376,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh. # ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1338: checking for a BSD compatible install" >&5 echo "configure:1380: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -1512,6 +1551,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -1512,6 +1551,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
xmlrpc/imageid xmlrpc/osid xmlrpc/server xmlrpc/xmlrpcbag \ xmlrpc/imageid xmlrpc/osid xmlrpc/server xmlrpc/xmlrpcbag \
cdrom/GNUmakefile cdrom/tbbootconfig/GNUmakefile \ cdrom/GNUmakefile cdrom/tbbootconfig/GNUmakefile \
cdrom/groklilo/GNUmakefile \ cdrom/groklilo/GNUmakefile \
dhcpd/dhcpd.conf.template \
install/GNUmakefile install/ops-install install/boss-install \ install/GNUmakefile install/ops-install install/boss-install \
install/newnode_sshkeys/GNUmakefile " install/newnode_sshkeys/GNUmakefile "
...@@ -1716,6 +1756,19 @@ s%@TBLOGFACIL@%$TBLOGFACIL%g ...@@ -1716,6 +1756,19 @@ s%@TBLOGFACIL@%$TBLOGFACIL%g
s%@PLAB_ROOTBALL@%$PLAB_ROOTBALL%g s%@PLAB_ROOTBALL@%$PLAB_ROOTBALL%g
s%@PLAB_SLICEPREFIX@%$PLAB_SLICEPREFIX%g s%@PLAB_SLICEPREFIX@%$PLAB_SLICEPREFIX%g
s%@LINKTEST_NSPATH@%$LINKTEST_NSPATH%g s%@LINKTEST_NSPATH@%$LINKTEST_NSPATH%g
s%@BOSSNODE_IP@%$BOSSNODE_IP%g
s%@OPSNODE_IP@%$OPSNODE_IP%g
s%@CONTROL_ROUTER_IP@%$CONTROL_ROUTER_IP%g
s%@CONTROL_NETWORK@%$CONTROL_NETWORK%g
s%@CONTROL_NETMASK@%$CONTROL_NETMASK%g
s%@PRIVATE_NETWORK@%$PRIVATE_NETWORK%g
s%@PRIVATE_ROUTER@%$PRIVATE_ROUTER%g
s%@PRIVATE_NETMASK@%$PRIVATE_NETMASK%g
s%@PUBLIC_NETWORK@%$PUBLIC_NETWORK%g
s%@PUBLIC_ROUTER@%$PUBLIC_ROUTER%g
s%@PUBLIC_NETMASK@%$PUBLIC_NETMASK%g
s%@DHCPD_DYNRANGE@%$DHCPD_DYNRANGE%g
s%@DHCPD_CONTROLNET_DECL@%$DHCPD_CONTROLNET_DECL%g
s%@TBOPSEMAIL@%$TBOPSEMAIL%g s%@TBOPSEMAIL@%$TBOPSEMAIL%g
s%@TBOPSEMAIL_NOSLASH@%$TBOPSEMAIL_NOSLASH%g s%@TBOPSEMAIL_NOSLASH@%$TBOPSEMAIL_NOSLASH%g
s%@TBLOGSEMAIL@%$TBLOGSEMAIL%g s%@TBLOGSEMAIL@%$TBLOGSEMAIL%g
......
...@@ -65,6 +65,19 @@ AC_SUBST(TBLOGFACIL) ...@@ -65,6 +65,19 @@ AC_SUBST(TBLOGFACIL)
AC_SUBST(PLAB_ROOTBALL) AC_SUBST(PLAB_ROOTBALL)
AC_SUBST(PLAB_SLICEPREFIX) AC_SUBST(PLAB_SLICEPREFIX)
AC_SUBST(LINKTEST_NSPATH) AC_SUBST(LINKTEST_NSPATH)
AC_SUBST(BOSSNODE_IP)
AC_SUBST(OPSNODE_IP)
AC_SUBST(CONTROL_ROUTER_IP)
AC_SUBST(CONTROL_NETWORK)
AC_SUBST(CONTROL_NETMASK)
AC_SUBST(PRIVATE_NETWORK)
AC_SUBST(PRIVATE_ROUTER)
AC_SUBST(PRIVATE_NETMASK)
AC_SUBST(PUBLIC_NETWORK)
AC_SUBST(PUBLIC_ROUTER)
AC_SUBST(PUBLIC_NETMASK)
AC_SUBST(DHCPD_DYNRANGE)
AC_SUBST(DHCPD_CONTROLNET_DECL)
# #
# Offer both versions of the email addresses that have the @ escaped # Offer both versions of the email addresses that have the @ escaped
...@@ -112,6 +125,23 @@ TBLOGFACIL="local5" ...@@ -112,6 +125,23 @@ TBLOGFACIL="local5"
LINKTEST_NSPATH="/share/linktest-ns" LINKTEST_NSPATH="/share/linktest-ns"
BOSSEVENTPORT=2927 BOSSEVENTPORT=2927
UNIFIED_BOSS_AND_OPS=0 UNIFIED_BOSS_AND_OPS=0
#
# Network config stuff. Obviously, this needs to be localized, but there are
# too many defs files too worry about right now.
#
BOSSNODE_IP=155.98.32.70
OPSNODE_IP=155.98.33.74
CONTROL_ROUTER_IP=155.98.36.1
CONTROL_NETWORK=155.98.36.0
CONTROL_NETMASK=255.255.252.0
PRIVATE_NETWORK=155.98.32.0
PRIVATE_ROUTER=155.98.32.1
PRIVATE_NETMASK=255.255.255.0
PUBLIC_NETWORK=155.98.33.0
PUBLIC_ROUTER=155.98.33.1
PUBLIC_NETMASK=255.255.255.0
DHCPD_DYNRANGE="155.98.36.200 155.98.36.249"
DHCPD_CONTROLNET_DECL=""
# #
# Okay, I know this is improper usage of --with. Too bad. # Okay, I know this is improper usage of --with. Too bad.
...@@ -168,6 +198,15 @@ LOG_TESTBED=`echo "LOG_$TBLOGFACIL" | tr a-z A-Z` ...@@ -168,6 +198,15 @@ LOG_TESTBED=`echo "LOG_$TBLOGFACIL" | tr a-z A-Z`
AC_DEFINE_UNQUOTED(LOG_TESTBED, $LOG_TESTBED) AC_DEFINE_UNQUOTED(LOG_TESTBED, $LOG_TESTBED)
AC_SUBST(LOG_TESTBED) AC_SUBST(LOG_TESTBED)
#
# If the private network is different then the control network, we need
# an extra subnet decl for it in dhcpd.conf.template. This is enormously
# crude and simplistic, but works for the local case!
#
if test "$PRIVATE_NETWORK" != "CONTROL_NETWORK"; then
DHCPD_CONTROLNET_DECL="subnet 155.98.32.0 netmask 255.255.255.0 {}"
fi
# #
# The email addresses need to be be munged for perl scripts. But, # The email addresses need to be be munged for perl scripts. But,
# php needs them un-escaped # php needs them un-escaped
...@@ -551,6 +590,7 @@ outfiles="$outfiles Makeconf GNUmakefile \ ...@@ -551,6 +590,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
xmlrpc/imageid xmlrpc/osid xmlrpc/server xmlrpc/xmlrpcbag \ xmlrpc/imageid xmlrpc/osid xmlrpc/server xmlrpc/xmlrpcbag \
cdrom/GNUmakefile cdrom/tbbootconfig/GNUmakefile \ cdrom/GNUmakefile cdrom/tbbootconfig/GNUmakefile \
cdrom/groklilo/GNUmakefile \ cdrom/groklilo/GNUmakefile \
dhcpd/dhcpd.conf.template \
install/GNUmakefile install/ops-install install/boss-install \ install/GNUmakefile install/ops-install install/boss-install \
install/newnode_sshkeys/GNUmakefile " install/newnode_sshkeys/GNUmakefile "
......
...@@ -34,3 +34,18 @@ TBMAINSITE=1 ...@@ -34,3 +34,18 @@ TBMAINSITE=1
THISHOMEBASE=Emulab.Net THISHOMEBASE=Emulab.Net
PLABSUPPORT=1 PLABSUPPORT=1
PLAB_ROOTBALL="plabroot-10.tar.bz2" PLAB_ROOTBALL="plabroot-10.tar.bz2"
#
# Network config stuff. Used to generate initial named and dhcpd config files.
#
BOSSNODE_IP=155.98.32.70
OPSNODE_IP=155.98.33.74
CONTROL_ROUTER_IP=155.98.36.1
CONTROL_NETWORK=155.98.36.0
CONTROL_NETMASK=255.255.252.0
PRIVATE_NETWORK=155.98.32.0
PRIVATE_ROUTER=155.98.32.1
PRIVATE_NETMASK=255.255.255.0
PUBLIC_NETWORK=155.98.33.0
PUBLIC_ROUTER=155.98.33.1
PUBLIC_NETMASK=255.255.255.0
DHCPD_DYNRANGE="155.98.36.200 155.98.36.249"
...@@ -8,18 +8,15 @@ ...@@ -8,18 +8,15 @@
# servers' IP addresses, the router's IP, and see the comment about nodetypes # servers' IP addresses, the router's IP, and see the comment about nodetypes
# below. # below.
# #
server-identifier 155.101.128.70; server-identifier @BOSSNODE_IP@;
server-name "155.101.128.70"; server-name "@BOSSNODE_IP@";
next-server 155.101.128.70;
option domain-name-servers 155.101.128.70;
option domain-name "emulab.net";
# Config these too?
option root-path "/tftpboot"; option root-path "/tftpboot";
filename "/tftpboot/pxeboot.emu";
default-lease-time 36000; # 10 hours default-lease-time 36000; # 10 hours
max-lease-time 36000; # 10 hours max-lease-time 36000; # 10 hours
ddns-update-style none; # req'd vers 3 directive ddns-update-style none; # req'd vers 3 directive
# Define the PXE option space # Define the PXE option space
...@@ -58,27 +55,27 @@ class "PXE" { ...@@ -58,27 +55,27 @@ class "PXE" {
option PXE.discovery-control 8; option PXE.discovery-control 8;
} }
subnet 155.101.128.0 netmask 255.255.255.0 { @DHCPD_CONTROLNET_DECL@
}
shared-network emulab { shared-network emulab {
subnet 155.101.132.0 netmask 255.255.252.0 { subnet @CONTROL_NETWORK@ netmask @CONTROL_NETMASK@ {
option subnet-mask @CONTROL_NETMASK@;
option subnet-mask 255.255.252.0;
option routers 155.101.132.1;
filename "/tftpboot/pxeboot.emu";
# Example of a dynamic range. If you uncomment the following line # Example of a dynamic range. If you uncomment the following line
# (after changing the IP addresses to suitable ones, of course) # (after changing the IP addresses to suitable ones, of course)
# unknown nodes will get assigned a random IP in it # unknown nodes will get assigned a random IP in it
range 155.101.132.200 155.101.132.249; range @DHCPD_DYNRANGE@;
# testbed PCs # testbed PCs
group { group {
next-server @BOSSNODE_IP@;
option routers @CONTROL_ROUTER_IP@;
option domain-name-servers @BOSSNODE_IP@;
option domain-name "@OURDOMAIN@";
# #
# For every PC nodetype, include a line like the the one below. # For every PC nodetype, include a line like the one below.
# These lines will be replaced with auto-generated entries for # These lines will be replaced with auto-generated entries for
# nodes of that type. You can also use the class field from the # nodes of that type. You can also use the class field from the
# node_types table # node_types table
...@@ -88,11 +85,18 @@ subnet 155.101.132.0 netmask 255.255.252.0 { ...@@ -88,11 +85,18 @@ subnet 155.101.132.0 netmask 255.255.252.0 {
# stargates # stargates
group { group {
next-server @BOSSNODE_IP@;
option routers @CONTROL_ROUTER_IP@;
option domain-name-servers @BOSSNODE_IP@;
option domain-name "@OURDOMAIN@";
%%nodetype=sg %%nodetype=sg
} }
} }
subnet 172.16.0.0 netmask 255.240.0.0 {
}
#
# Private network; for virtual (jailed) nodes.
#
subnet 172.16.0.0 netmask 255.240.0.0 {
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment