Commit 2a1b6543 authored by Leigh Stoller's avatar Leigh Stoller

Add configuration of named forwarders driven from NAMED_FORWARDERS

variable in the defs file. Nice for elabinelab to avoid inner named
from having to do too much work.
parent 27802846
......@@ -1809,6 +1809,7 @@ 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%@NAMED_FORWARDERS@%$NAMED_FORWARDERS%g
s%@DHCPD_CONTROLNET_DECL@%$DHCPD_CONTROLNET_DECL%g
s%@SSLCERT_COUNTRY@%$SSLCERT_COUNTRY%g
s%@SSLCERT_STATE@%$SSLCERT_STATE%g
......
......@@ -84,6 +84,7 @@ AC_SUBST(PUBLIC_ROUTER)
AC_SUBST(PUBLIC_NETMASK)
AC_SUBST(DHCPD_DYNRANGE)
AC_SUBST(DHCPD_CONTROLNET_DECL)
AC_SUBST(NAMED_FORWARDERS)
AC_SUBST(SSLCERT_COUNTRY)
AC_SUBST(SSLCERT_STATE)
AC_SUBST(SSLCERT_LOCALITY)
......
......@@ -60,3 +60,4 @@ 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"
NAMED_FORWARDERS=""
......@@ -63,6 +63,7 @@ PUBLIC_NETWORK=changeme
PUBLIC_ROUTER=changeme
PUBLIC_NETMASK=changeme
DHCPD_DYNRANGE=changeme
NAMED_FORWARDERS=changeme
#
# Must localize to avoid conflict with outer emulab frisbeed.
#
......
......@@ -136,6 +136,12 @@ PUBLIC_NETMASK=255.255.255.0
#
DHCPD_DYNRANGE="155.98.36.200 155.98.36.249"
#
# If you have forwarders for your named, specify them here for named.conf
# generation in the named directory.
#
NAMED_FORWARDERS="1.1.1.1 1.1.2.1"
#
# You shouldn't have to change anything below this point
#
......
......@@ -52,3 +52,5 @@ 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"
NAMED_FORWARDERS="206.163.129.2 69.59.192.71 69.59.192.72"
......@@ -12,6 +12,7 @@ SUBDIR = named
ETCDIR = /etc
NAMEDB_DIR = $(ETCDIR)/namedb
OURDOMAIN = @OURDOMAIN@
FORWARDERS = @NAMED_FORWARDERS@
# This is silly. Needs to be done properly.
TESTBED_NETWORK = @TESTBED_NETWORK@
......
......@@ -15,10 +15,7 @@
#
options {
directory "/etc/namedb";
# Put forwarders here if you have them
#forwarders {
# 1.1.1.1;
#};
%forwarders%
};
view "internal" {
......
......@@ -35,6 +35,7 @@ my $PRIVATE_NETMASK = "@PRIVATE_NETMASK@";
my $PUBLIC_NETWORK = "@PUBLIC_NETWORK@";
my $PUBLIC_ROUTER = "@PUBLIC_ROUTER@";
my $PUBLIC_NETMASK = "@PUBLIC_NETMASK@";
my $NAMED_FORWARDERS = "@NAMED_FORWARDERS@";
# Testbed libraries.
use lib "@prefix@/lib";
......@@ -83,6 +84,18 @@ while (<IF>) {
elsif ($2 eq "internal_network_dotted_reverse") {
print $1 . "${c}.${b}.${a}" . "$3\n";
}
elsif ($2 eq "forwarders") {
if ($NAMED_FORWARDERS eq "") {
print "";
}
else {
print $1 . "forwarders {\n";
foreach my $forwarder (split(" ", $NAMED_FORWARDERS)) {
print $1 . $1 . "$forwarder;\n";
}
print $1 . "};\n";
}
}
else {
die("*** $0:\n".
" Unknown special tag in named template file!\n");
......
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