/usr/share/zentyal/stubs/dhcp/subnet.mas is in zentyal-dhcp 2.3.8+quantal1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | <%doc>
This template dumps the configuration for every shared network
including ranges and fixed IP adresses.
</%doc>
<%args>
%info
</%args>
% if (exists $info{'staticRoutes'} ) {
<& staticRoutes.mas, routes => $info{'staticRoutes'}, defaultGw => $info{'gateway'} &>
% }
subnet <% $info{'net'} %> netmask <% $info{'netmask'} %> {
<& .options, info => \%info &>
% my $ranges = $info{'ranges'};
% foreach my $range (@{$ranges}) {
pool {
<& .include, name => $range->{'name'} &>
<& .thin_client_options, options => $range->{'options'} &>
range <% $range->{'from'} %> <% $range->{'to'} %>;
}
% }
}
group {
<& .options, info => \%info, fixed => 1 &>
% foreach my $groupFixed (values %{$info{'fixed'}}) {
group {
<& .thin_client_options, options => $groupFixed->{options} &>
% foreach my $fixed (@{$groupFixed->{members}}) {
host <% $fixed->{'name'} %> {
hardware ethernet <% $fixed->{'mac'} %>;
fixed-address <% $fixed->{'ip'} %>;
<& .include, name => $fixed->{'name'} &>
}
% }
}
% }
}
<%doc>
Print out the route options
</%doc>
<%def .options>
<%args>
%info
$fixed => 0
</%args>
% # Common options for the shared network
% if (exists $info{'gateway'}) {
option routers <% $info{'gateway'} %>;
% }
% if(defined($info{'search'})) {
option domain-name "<% $info{'search'} %>";
% }
% if(exists $info{'nameserver1'} and length($info{'nameserver1'}) > 0) {
option domain-name-servers <% $info{'nameserver1'} %>\
% if(exists $info{'nameserver2'} and length($info{'nameserver2'}) > 0) {
, <% $info{'nameserver2'} %>;
% }else{
;
% }
% }
% if ( defined($info{'ntpServer'}) ) {
option ntp-servers <% $info{'ntpServer'} %>;
% }
% if ( defined($info{'winsServer'}) ) {
option netbios-name-servers <% $info{'winsServer'} %>;
option netbios-node-type 8;
% }
% if(defined($info{'defaultLeasedTime'})) {
default-lease-time <% $info{'defaultLeasedTime'} %>;
% }
% if(defined($info{'maxLeasedTime'})) {
max-lease-time <% $info{'maxLeasedTime'} %>;
% }
% if( defined($info{'dynamicDomain'}) ) {
option host-name = config-option server.ddns-hostname;
% if ( $fixed ) {
<%doc>
Check dhcp-eval and dhcp-options to know what this function does to
add A record to DNS server
</%doc>
ddns-hostname = pick-first-value ( host-decl-name,
option fqdn.hostname,
concat("static-", binary-to-ascii(10, 8, "-", leased-address)));
ddns-domainname "<% $info{'staticDomain'} %>.";
zone <% $info{'staticDomain'} %>. {
primary 127.0.0.1;
key <% $info{'staticDomain'} %>.;
}
% foreach my $revZone (@{$info{'reverseZones'}}) {
zone <% $revZone %> {
primary 127.0.0.1;
key <% $info{'dynamicDomain'} %>.;
}
% }
% } else {
<%doc>
This ignores the data sent by the DHCP client and always set
dhcp-leased-IP.domain name
</%doc>
ddns-hostname = pick-first-value( option fqdn.hostname,
option host-name,
concat("dhcp-", binary-to-ascii(10, 8, "-", leased-address)));
ddns-domainname "<% $info{'dynamicDomain'} %>.";
zone <% $info{'dynamicDomain'} %>. {
primary 127.0.0.1;
key <% $info{'dynamicDomain'} %>.;
}
% foreach my $revZone (@{$info{'reverseZones'}}) {
zone <% $revZone %> {
primary 127.0.0.1;
key <% $info{'dynamicDomain'} %>.;
}
% }
% }
% }
</%def>
<%doc>
If there is any file with the given name, then include it in the
configuration
name - String to include
</%doc>
<%def .include>
<%args>
$name
</%args>
<%init>
use EBox::DHCP;
my $dirName = EBox::DHCP->IncludeDir();
my $fileName = $dirName . $name;
</%init>
% if ( -r $fileName ) {
include "<% $fileName %>";
% }
</%def>
<%doc>
Print out the thin client options
</%doc>
<%def .thin_client_options>
<%args>
%options
</%args>
% if (values(%options) > 0) {
% if ($options{nextServerIsZentyal}) {
% if ($options{nextServer}) {
next-server <% $options{nextServer} %>;
option tftp-server-name "<% $options{nextServer} %>";
% }
option root-path "/opt/ltsp/<% ($options{fat}?'fat-':'') %><% $options{architecture} %>";
if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
filename "/ltsp/<% ($options{fat}?'fat-':'') %><% $options{architecture} %>/pxelinux.0";
} else {
filename "/ltsp/<% ($options{fat}?'fat-':'') %><% $options{architecture} %>/nbi.img";
}
% }
% else {
% if ($options{nextServer}) {
next-server <% $options{nextServer} %>;
option tftp-server-name "<% $options{nextServer} %>";
% }
% if ( $options{filename} ) {
filename "<% $options{filename} %>";
% }
% }
% }
</%def>
|