[dhcp, dns] On utilise config.dns.recurfiv pour les nameservers
This commit is contained in:
parent
5e76ac1ad0
commit
4723d92a76
2 changed files with 39 additions and 17 deletions
180
Python/etc/dhcp3/dhcpd.conf
Normal file
180
Python/etc/dhcp3/dhcpd.conf
Normal file
|
@ -0,0 +1,180 @@
|
|||
# -*- mode: python; encoding: utf-8 -*-
|
||||
|
||||
info["owner"] = "root"
|
||||
info["group"] = "root"
|
||||
info["perms"] = 0600
|
||||
|
||||
comment_start = "#"
|
||||
|
||||
header("Configuration dhcp de %s" % admhostname)
|
||||
|
||||
include("ip")
|
||||
import config.dns
|
||||
|
||||
print """
|
||||
#
|
||||
# Sample configuration file for ISC dhcpd for Debian
|
||||
#
|
||||
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
|
||||
#
|
||||
|
||||
# The ddns-updates-style parameter controls whether or not the server will
|
||||
# attempt to do a DNS update when a lease is confirmed. We default to the
|
||||
# behavior of the version 2 packages ('none', since DHCP v2 didn't
|
||||
# have support for DDNS.)
|
||||
ddns-update-style none;
|
||||
|
||||
|
||||
include "/etc/dhcp3/omapi.conf";
|
||||
|
||||
|
||||
# option definitions common to all supported networks...
|
||||
option option-252 code 252 = text ;
|
||||
option domain-search code 119 = text ;
|
||||
option option-119 code 119 = text ;
|
||||
# La pluspart de nos réseaux sont taggués, on utilise donc une mtu de 1500-4 octets
|
||||
option interface-mtu 1496;
|
||||
|
||||
# If this DHCP server is the official DHCP server for the local
|
||||
# network, the authoritative directive should be uncommented.
|
||||
#authoritative;
|
||||
|
||||
# Use this to send dhcp log messages to a different log file (you also
|
||||
# have to hack syslog.conf to complete the redirection).
|
||||
log-facility local7;
|
||||
|
||||
|
||||
include "/etc/dhcp3/dhcp-failover.conf";"""
|
||||
|
||||
if has("vlan-radin"):
|
||||
print """
|
||||
# VLan gratuit
|
||||
subnet 10.42.0.0 netmask 255.255.0.0 {
|
||||
interface eth3;
|
||||
option domain-name-servers %s;
|
||||
option routers 10.42.0.10;
|
||||
authoritative;
|
||||
default-lease-time 86400;
|
||||
deny unknown-clients;
|
||||
option root-path "/";
|
||||
next-server 138.231.136.98;
|
||||
filename "pxelinux.0";
|
||||
pool {
|
||||
range 10.42.1.1 10.42.255.200;
|
||||
failover peer "dhcp-failover";
|
||||
}
|
||||
}""" % ', '.join(config.dns.recursiv['gratuit'])
|
||||
|
||||
if has("vlan-accueil"):
|
||||
print """
|
||||
# VLan accueil
|
||||
subnet 10.51.0.0 netmask 255.255.0.0 {
|
||||
interface eth4;
|
||||
default-lease-time 600;
|
||||
max-lease-time 7200;
|
||||
# On met sable en router pour pouvoir accéder à l'intranet et au wiki
|
||||
option routers 10.51.0.10;
|
||||
# On n'a besoin que du dns ici (pour le portail captif)
|
||||
option domain-name-servers %s;
|
||||
authoritative;
|
||||
option root-path "/";
|
||||
next-server 138.231.136.98;
|
||||
filename "pxelinux.0";
|
||||
option time-servers 10.51.0.10;
|
||||
option ntp-servers 10.51.0.10;
|
||||
pool {
|
||||
failover peer "dhcp-failover";
|
||||
range 10.51.1.1 10.51.255.200;
|
||||
}
|
||||
}""" % ', '.join(config.dns.recursiv['accueil'])
|
||||
|
||||
if has("vlan-isolement"):
|
||||
print """
|
||||
# VLan isolement
|
||||
subnet 10.52.0.0 netmask 255.255.0.0 {
|
||||
interface eth5;
|
||||
default-lease-time 600;
|
||||
max-lease-time 7200;
|
||||
option domain-name-servers %s;
|
||||
option routers 10.52.0.10;
|
||||
authoritative;
|
||||
option root-path "/";
|
||||
next-server 138.231.136.98;
|
||||
filename "pxelinux.0";
|
||||
pool {
|
||||
failover peer "dhcp-failover";
|
||||
range 10.52.1.1 10.52.255.200;
|
||||
}
|
||||
}
|
||||
""" % ', '.join(config.dns.recursiv['isolement'])
|
||||
|
||||
if not has("non-vlan-adherent"):
|
||||
print """
|
||||
# Vlan des adhérents
|
||||
subnet 138.231.136.0 netmask 255.255.248.0 {
|
||||
interface eth0;
|
||||
default-lease-time 86400;
|
||||
option subnet-mask 255.255.248.0;
|
||||
option broadcast-address 138.231.143.255;
|
||||
authoritative;
|
||||
option routers 138.231.136.4;
|
||||
option domain-name-servers %s;
|
||||
option domain-name "crans.org";
|
||||
option domain-search "crans.org";
|
||||
option root-path "/";
|
||||
next-server 138.231.136.98;
|
||||
filename "pxelinux.0";
|
||||
option time-servers 138.231.136.9;
|
||||
option ntp-servers 138.231.136.9;
|
||||
option smtp-server 138.231.136.39;
|
||||
option ip-forwarding off;
|
||||
deny unknown-clients;
|
||||
|
||||
include "/etc/dhcp3/generated/adherents.liste";
|
||||
}
|
||||
""" % ', '.join(config.dns.recursiv['fil'])
|
||||
|
||||
if has("vlan-wifi"):
|
||||
print """
|
||||
# Vlan des wifi
|
||||
subnet 138.231.144.0 netmask 255.255.248.0 {
|
||||
interface eth2;
|
||||
default-lease-time 86400;
|
||||
option subnet-mask 255.255.248.0;
|
||||
option broadcast-address 138.231.148.255;
|
||||
authoritative;
|
||||
option routers 138.231.148.4;
|
||||
option domain-name-servers %s;
|
||||
option domain-name "crans.org";
|
||||
option option-119 "crans.org";
|
||||
option domain-search "crans.org";
|
||||
option time-servers 138.231.136.9;
|
||||
option ntp-servers 138.231.136.9;
|
||||
option smtp-server 138.231.136.3;
|
||||
option ip-forwarding off;
|
||||
deny unknown-clients;
|
||||
|
||||
include "/etc/dhcp3/generated/wifi.liste";
|
||||
}""" % ', '.join(config.dns.recursiv['wifi'])
|
||||
|
||||
if has("vlan-ens"):
|
||||
print """
|
||||
#Vlan appartement
|
||||
subnet 10.2.9.0 netmask 255.255.255.0 {
|
||||
interface eth6;
|
||||
default-lease-time 86400;
|
||||
option subnet-mask 255.255.255.0;
|
||||
option broadcast-address 10.2.9.255;
|
||||
authoritative;
|
||||
option routers 10.2.9.4;
|
||||
option domain-name-servers %s;
|
||||
option ip-forwarding off;
|
||||
option root-path "/";
|
||||
next-server 138.231.136.98;
|
||||
filename "pxelinux.0";
|
||||
deny unknown-clients;
|
||||
|
||||
include "/etc/dhcp3/generated/appartements.liste";
|
||||
}
|
||||
""" % ', '.join(config.dns.recursiv['personnel-ens'])
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue