README
author Tero Marttila <tero.marttila@aalto.fi>
Thu, 26 Feb 2015 19:30:27 +0200
changeset 522 6bc714379a13
parent 521 06792c78067e
child 626 5cd99761fe4d
permissions -rw-r--r--
README: experimental features
438
d45fc43c6073 split out pvl-hosts from pvl-verkko
Tero Marttila <tero.marttila@aalto.fi>
parents: 34
diff changeset
     1
= pvl-hosts =
34
491f7da9d29b pvl.verkko-dhcp: fix polling without syslog; README
Tero Marttila <terom@paivola.fi>
parents:
diff changeset
     2
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
     3
DNS/DHCP hosts management/integration for ISC bind9 and dhcpd.
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
     4
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
     5
== Hosts ==
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
     6
The `pvl.hosts-*` tools read hosts files as input, which have an ini format, using section names as hostnames to configure attributes for that host:
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
     7
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
     8
    [foo]
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
     9
        ip          = 192.0.2.1
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    10
        ethernet    = 00:11:22:33:44:55
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    11
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    12
    [bar]
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    13
        ip          = 192.0.2.2
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    14
        ethernet    = 01:23:45:67:89:ab
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    15
520
0310e199435a README: fixup --zone-prefix=
Tero Marttila <tero.marttila@aalto.fi>
parents: 516
diff changeset
    16
The domain name for a host is determined from the basename of the config file, so this example file would generate something like the following output for use in a `zone "example.com" { ... }` zonefile:
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    17
    
516
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    18
    $ bin/pvl.hosts-forward etc/hosts/example.com 
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    19
    foo                               A     192.0.2.1
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    20
    bar                               A     192.0.2.2
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    21
520
0310e199435a README: fixup --zone-prefix=
Tero Marttila <tero.marttila@aalto.fi>
parents: 516
diff changeset
    22
And correspondingly, the reverse zone for `2.0.192.in-addr.arpa`:
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    23
520
0310e199435a README: fixup --zone-prefix=
Tero Marttila <tero.marttila@aalto.fi>
parents: 516
diff changeset
    24
    $ bin/pvl.hosts-reverse --zone-prefix=192.0.2.0/24 etc/hosts/example.com
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    25
    1                                 PTR   foo.example.com.
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    26
    2                                 PTR   bar.example.com.
443
Tero Marttila <tero.marttila@aalto.fi>
parents: 438
diff changeset
    27
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    28
And the associated DHCP hosts:
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    29
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    30
    $ bin/pvl.hosts-dhcp etc/hosts/example.com 
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    31
    host foo {
480
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
    32
        option host-name foo;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
    33
        hardware ethernet 00:11:22:33:44:55;
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    34
        fixed-address 192.0.2.1;
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    35
    }
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    36
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    37
    host bar {
480
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
    38
        option host-name bar;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
    39
        hardware ethernet 01:23:45:67:89:ab;
512
dafac309813e README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents: 509
diff changeset
    40
        fixed-address 192.0.2.2;
452
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    41
    }
d10f2b2188bb README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents: 448
diff changeset
    42
514
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    43
=== Include directories ===
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    44
Host configs can be included:
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    45
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
    46
    $ cat etc/hosts/test
514
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    47
    include = test.d/
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    48
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
    49
    $ cat etc/hosts/test.d/foo 
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    50
    ip = 192.0.2.1
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    51
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
    52
    $ cat etc/hosts/test.d/bar 
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    53
    ip = 192.0.2.2
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    54
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
    55
    $ bin/pvl.hosts-forward etc/hosts/test
514
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    56
    foo                               A     192.0.2.1
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    57
    bar                               A     192.0.2.2
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    58
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    59
Including a directory of files is equivalent to substituiting each file as a named section at the level of the include = statement. Note that this means that included files are treated directly as host definitions, IOW, you should NOT include a section name in an included host file unless you want to declare an additional subdomain:
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    60
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    61
    $ cat etc/hosts/wrong.test 
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    62
    include = wrong.d/
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    63
    
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    64
    $ etc/hosts/wrong.d/host
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    65
    [host]
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    66
        ip  = 192.0.2.6
f19d86b20f24 README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents: 512
diff changeset
    67
516
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    68
Using the --root-zone option to generate the full FQDN for the host:
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    69
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    70
    $ bin/pvl.hosts-forward --root-zone etc/hosts/wrong.test 
9615ffc647a0 pvl.hosts-forward: if only a single hosts file/dir is given, use it as the --zone-origin; support --root-zone
Tero Marttila <tero.marttila@aalto.fi>
parents: 514
diff changeset
    71
    host.host.wrong.test              A     192.0.2.6
507
e3a32f4dff54 pvl.hosts.config: document includes, fix include-only zone, and test
Tero Marttila <tero.marttila@aalto.fi>
parents: 484
diff changeset
    72
484
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    73
=== Host aliases ===
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    74
Hosts can specify DNS aliases:
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    75
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    76
    [foo]
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    77
        ip          = 127.0.0.1
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    78
        alias       = test1
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    79
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    80
    [bar]
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    81
        ip          = 127.0.0.2
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    82
        alias       = test2
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    83
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    84
    $ bin/pvl.hosts-forward --forward-zone alias.test etc/hosts/alias.test 
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    85
    foo                               A     127.0.0.1
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    86
    test1                             CNAME foo
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    87
    bar                               A     127.0.0.2
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    88
    test2                             CNAME bar
099dee149e74 document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents: 483
diff changeset
    89
447
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    90
=== Generated hosts ===
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    91
The hosts file format supports something similar to bind9's $GENERATE directive for hosts:
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    92
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    93
    [asdf{1-3}]
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    94
        ip  = 10.100.100.$
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    95
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    96
    $ bin/pvl.hosts-dns --forward-zone=asdf etc/hosts/asdf 
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    97
    asdf1@asdf                        A     10.100.100.1
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    98
    asdf2@asdf                        A     10.100.100.2
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
    99
    asdf3@asdf                        A     10.100.100.3
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   100
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   101
Note that the generate directives are interpreted and compiled directly by pvl.hosts. 
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   102
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   103
Most of the $GENERATE options should be supported, with a little clever hackery:
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   104
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   105
    [asdf{1-5/2}{0,2}]
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   106
       ip  = 10.100.100.$${10}
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   107
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   108
    $ bin/pvl.hosts-dns --forward-zone=asdf2 etc/hosts/asdf2
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   109
    asdf01@asdf2                      A     10.100.100.11
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   110
    asdf03@asdf2                      A     10.100.100.13
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   111
    asdf05@asdf2                      A     10.100.100.15
6f0357759e9b pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents: 443
diff changeset
   112
448
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   113
This feature can be used for generating reverse delegations:
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   114
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   115
    [foo-{240-247}]
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   116
        forward =
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   117
        reverse = $.240/29.0.0.10.in-addr.arpa
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   118
        ip      = 10.0.0.$
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   119
    
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   120
    $ bin/pvl.hosts-dns --reverse-zone=10 etc/hosts/reverse 
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   121
    240.0.0                           CNAME 240.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   122
    241.0.0                           CNAME 241.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   123
    242.0.0                           CNAME 242.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   124
    243.0.0                           CNAME 243.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   125
    244.0.0                           CNAME 244.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   126
    245.0.0                           CNAME 245.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   127
    246.0.0                           CNAME 246.240/29.0.0.10.in-addr.arpa.
5ab0ec8200c3 README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents: 447
diff changeset
   128
    247.0.0                           CNAME 247.240/29.0.0.10.in-addr.arpa.
480
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   129
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   130
=== DHCP Options ===
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   131
The hosts need not specify any fixed ip address, leaving IP address allocation to dhcpd:
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   132
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   133
    [foo]
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   134
        ethernet    = 00:11:22:33:44:55 
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   135
    
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   136
    $ bin/pvl.hosts-dhcp etc/hosts/dhcp1 
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   137
    host foo {
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   138
        option host-name foo;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   139
        hardware ethernet 00:11:22:33:44:55;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   140
    }
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   141
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   142
=== DHCP Boot options ===
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   143
The hosts can specify DHCP boot server/file options:
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   144
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   145
    [foo]
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   146
        ethernet    = 00:11:22:33:44:55
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   147
        boot        = boot.lan:debian/wheezy/pxelinux.0
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   148
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   149
    $ bin/pvl.hosts-dhcp etc/hosts/boot.dhcp 
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   150
    host foo {
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   151
        option host-name foo;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   152
        hardware ethernet 00:11:22:33:44:55;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   153
        next-server boot.lan;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   154
        filename debian/wheezy/pxelinux.0;
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   155
    }
7e44854e85d4 README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents: 452
diff changeset
   156
483
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   157
=== DHCP hosts in multiple subnets/domains ===
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   158
A host with different interfaces in multiple domains must specify unique interface names:
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   159
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   160
    [foo.dhcp]
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   161
        [[asdf]]
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   162
            ip              = 10.1.0.1
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   163
            ethernet.eth1   = 00:11:22:33:44:55
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   164
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   165
    [bar.dhcp]
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   166
        [[asdf]]
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   167
            ip              = 10.2.0.1
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   168
            ethernet.eth2   = 55:44:33:22:11:00
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   169
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   170
    $ bin/pvl.hosts-dhcp etc/hosts/dhcp2 
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   171
    host asdf-eth1 {
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   172
        option host-name asdf;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   173
        hardware ethernet 00:11:22:33:44:55;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   174
        fixed-address 10.1.0.1;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   175
    }
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   176
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   177
    host asdf-eth2 {
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   178
        option host-name asdf;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   179
        hardware ethernet 55:44:33:22:11:00;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   180
        fixed-address 10.2.0.1;
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   181
    }
19d084bb4afd pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents: 480
diff changeset
   182
521
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   183
== Host structure ==
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   184
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   185
Creating a tree of symlinks for managing split zonefile domains can be useful:
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   186
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   187
    $ tree etc/zones/
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   188
    etc/zones/
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   189
    ├── forward
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   190
    │   └── test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   191
    │       ├── asdf.test -> ../../../hosts/asdf.test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   192
    │       └── test -> ../../../hosts/test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   193
    └── reverse
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   194
        └── 192.0.2
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   195
            ├── asdf.test -> ../../../hosts/asdf.test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   196
            └── test -> ../../../hosts/test
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   197
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   198
Given a structure like above, the `pvl.hosts-forward` can generate a single forward zone containing all sub-domains:
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   199
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   200
    $ bin/pvl.hosts-forward --hosts-include etc/hosts/ etc/zones/forward/test/
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   201
    foo                               A     192.0.2.1
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   202
    bar                               A     192.0.2.2
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   203
    quux.asdf                         A     192.0.2.5
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   204
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   205
Note that the directory name is treated separately as a zone origin; the file names within the domain are still treated as a flat namespace independent of the directory name (which is different than *pvl.hosts* would behave for `include = etc/zones/forward/test/`).
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   206
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   207
The same trick also works for `pvl.hosts-reverse`:
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   208
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   209
    $ bin/pvl.hosts-reverse --hosts-include etc/hosts/ etc/zones/reverse/192.0.2/
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   210
    1                                 PTR   foo.test.
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   211
    2                                 PTR   bar.test.
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   212
    5                                 PTR   quux.asdf.test.
06792c78067e setup and document etc/zone/ structure
Tero Marttila <tero.marttila@aalto.fi>
parents: 520
diff changeset
   213
522
6bc714379a13 README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents: 521
diff changeset
   214
= Experimental features = 
6bc714379a13 README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents: 521
diff changeset
   215
6bc714379a13 README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents: 521
diff changeset
   216
Features that are still under development
6bc714379a13 README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents: 521
diff changeset
   217
6bc714379a13 README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents: 521
diff changeset
   218
* DHCP host status tracking from syslog/dhcpd.leases into a database 
6bc714379a13 README: experimental features
Tero Marttila <tero.marttila@aalto.fi>
parents: 521
diff changeset
   219
* SNMP network topology discovery