netconfgen  -- automated DNS and DHCP config file generator. 

netconfgen is continuation and rename of addrconf  project, which is:

Copyright (c) 2005-2010 Gregor Maier <gregor@majordomus.org>
All right reserved. See LICENSE file for details.

http://www.net.t-labs.tu-berlin.de/~gregor/projects/


This tool can be used to generate DNS and DHCP configuration
file stancas from one central configuration file. It supports
IPv4 and IPv6 and reverse zones. 

FEATURES / LIMITATIONS
 - Multiple Subnets resp. DHCP configuration files are supported
 - Multiple IPv4 networks are supported. netconfgen will generate one
   reverse DNS-Zone for each /24 network.
 - One IPv6 reverse DNS-zone per config file is supported. Preferably
   with a /48 prefix.
 - netconfgen does not create complete config files. For the DHCP config 
   files it created only the "host asdf {...  }" stancas and for the
   DNS zonefiles it generates only the A, AAAA, and PTR records. These
   generated files can be included in the DNS and DHCP config files.


HOW IT WORKS

netconfgen.pl  [CONFIGFILE]

If CONFIGFILE is omitted, STDIN is used.

An input file  serves as central input to netconfgen. 
This config file is splitted in two sections. The first section contains
some general configuration options, like the output filenames, the DNS
zones we are about to encounter, etc. This section is started with
a line containing [setup]. The available [setup] options are documented 
in the example config file.

After the setup section is complete the actual host configuration starts. 
This section is started with [hosts]

In the section each line contains one entry. Lines
starting with # or lines containing just whitespace characters are ignored. 

Each entry consists of the following fields, seperate by the pipe symbol
("|"). Whitespaces in the field are ignored.

hostname | MAC-Address | IPv4-Addr | IPv6-Type | IPv6-info | flags | comment 

hostname:
	Required. The name of the host.
MAC-Address:
	Optional. The MAC-Address of the host.
IPv4-Address:
	Required. The IPv4 Address of the host.
IPv6-Type:
	Required. Specifies the type of IPv6 address this host has. Can be
	one of: 
	none .... No IPv6 address. Don't add to IPv6 DNS files.
	auto .... IPv6 address is obtained through autoconfiguration. The
		subnet prefix (the /64) is required in the IPv6-Info field.
		The EUI-64 part of the address is generated from the
		MAC-Address.
	fix .... A fixed IPv6 address (manually configured). The IPv6-Info
		field contains the full IPv6 address of the host.
IPv6-Info:
	Requried for IPv6-Types "auto" and "fix". For type 
	auto it contains a /64 prefix. E.g. 2001:0db8:f018:42 and for type
	fix it contains a full IPv6 address. E.g.  2001:0db8:f018:42::1:1
flags: 
	Optional. Contain additional flags. Multiple, comma-seperated flags
	can be specified. See below. 
comment: an optional comment field describing the entry. This field is
	ignored.

Defined flags: 
	NOREV .... do not a DNS reverse entry for this host. This flag is
		required if you want to have multiple A or AAAA records
		pointing to the same IP address (like when using virtual
		servers or DNS round robin)
	an all-lowercase word .... is interpreted as a DHCP-realm. Every
		subnet, that has a DHCP server builds a DHCP-realm. So if 
		an entry contains a dhcp-realm-flag the host is added to the
		DHCP-config file for that real. (see examples).
		The DHCP-realms that can be encountered must be predefined in the
		[setup] section.a
	
See EXAMPLES for a small, but complete config file.


When netconfgen is run, it will generate the various configuration fileparts
and store them in the output directory. Before the new files are generated,
the contents of the output directory will be backed up. 


Configuration is done in the script itself. Every option is documented in
the script.

Please note, that netconfgen will only generate the config file stancas
concerning A, AAAA, PTR DNS-records and "host ... {...}" DHCP-entries. 
These generated files must be embedded into the actual DNS-zonefiles and
dhcpd.conf file. You can use the directives

$include "filename"  for Bind  and

include "filename"  for dhcp 


INSTALL

* Copy netconfgen.pl to a directory in your path (e.g. /usr/local/bin). 
* Create the directory structure for netconfgen. Normally this resides in
/etc/netconfgen: 
	mkdir /etc/netconfgen
	mkdir /etc/netconfgen/output
	mkdir /etc/netconfgen/backup
* Create your config (normally /etc/netconfgen/netconfgen.conf), or use and
	adopt the example file.

REQUIREMENTS 

The ipv6calc program is required.


EXAMPLES 

see the examples dir ;-) 

