Differences between revisions 10 and 11
Revision 10 as of 2007-12-15 14:58:52
Size: 3050
Editor: Kurgan
Comment:
Revision 11 as of 2008-05-29 09:03:15
Size: 2792
Editor: Kurgan
Comment:
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
# dns standard di opendns: imposto i dns e blocco il loro sistema di
# ridirezione pubblicitaria degli host inesistenti
bogus-nxdomain=208.67.219.40
bogus-nxdomain=208.67.219.41
bogus-nxdomain=208.69.32.130
server=208.67.222.222
server=208.67.220.220
Line 33: Line 26:
local=/teknia.locale/ local=/dominio.locale/
Line 52: Line 45:
# il dominio per gli host assegnati dal DHCP 
domain=teknia.locale
# il dominio per gli host assegnati dal DHCP
domain=dominio.locale
Line 59: Line 52:
# Opzioni DHCP  # Opzioni DHCP

DnsMasq

Questa e` una configurazione "media" commentata per Dnsmasq di Sarge, con funzione di dns proxy e di dhcp server.

Se si usa il ppp per connettersi, e` possibile indicare come resolv-file il file /etc/ppp/resolv.conf che contiene i DNS passati dal provider al momento della connessione.

Il file e` /etc/dnsmasq.conf

# Configuration file for dnsmasq.

# Never forward plain names (with a dot or domain part)
domain-needed
# Never forward addresses in the non-routed address spaces.
bogus-priv

# block win2k dns requests
filterwin2k

# resolv.conf alternativo (creare il file!)
resolv-file=/etc/resolv.conf.dnsmasq


# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
local=/dominio.locale/

# If you want dnsmasq to listen for requests only on specified interfaces
# (and the loopback) give the name of the interface (eg eth0) here.
# Repeat the line for more than one interface.
#interface=

# Aggiungi un dominio alle entry del file hosts che non hanno dominio (vedi "domain")
expand-hosts

# niente cache per i risultati negativi
no-negcache

# log
log-queries


# DHCP options

# il dominio per gli host assegnati dal DHCP
domain=dominio.locale
# range delle macchine servite
dhcp-range=192.168.3.10,192.168.3.100,240h
# il server e` autoritativo
dhcp-authoritative

# Opzioni DHCP
# 1- subnet mask
# 3- default gateway
# 6- dns server
# 28- broadcast address
# 44- wins server
# 46- netbios node type

dhcp-option=44,192.168.3.1


# host statici, uno per riga (mac,ip)
#dhcp-host=11:22:33:44:55:66,192.168.0.60

# If this line is uncommented, dnsmasq will read /etc/ethers and act
# on the ethernet-address/IP pairs found there just as if they had
# been given as --dhcp-host options. Useful if you keep
# MAC-address/host mappings there for other purposes.
#read-ethers

DHCP su piu` interfacce

Se si vuole servire il DHCP su piu` interfacce, e` possibile farlo, ed e` anche possibile dividere le configurazioni in modo che gli host su una interfaccia prendano impostazioni (dns, gateway, eccetera) diverse rispetto a quelli sull'altra interfaccia.

dhcp-range=osimo,172.16.0.100,172.16.0.200,255.255.255.0,240h
dhcp-range=kurgan,10.1.45.100,10.1.45.200,255.255.255.0,240h

dhcp-option=osimo,44,10.0.0.251,172.16.0.1
dhcp-option=kurgan,44,10.1.42.254

Patch per eseguire uno script in occasione degli eventi del DHCP

Le versioni piu` recenti di Dnsmasq supportano la possibilita` di lanciare script quando ci sono eventi (assegnazione e scadenza di lease) legati al DHCP. E` possibile senza difficolta` compilarsi su Debian Sarge i sorgenti della testing, che hanno questa funzione.

LinuxDebian/DnsMasq (last edited 2017-09-07 18:12:44 by Kurgan)