author | Tero Marttila <tero.marttila@aalto.fi> |
Thu, 26 Feb 2015 19:16:25 +0200 | |
changeset 520 | 0310e199435a |
parent 516 | 9615ffc647a0 |
child 521 | 06792c78067e |
permissions | -rw-r--r-- |
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 | 3 |
DNS/DHCP hosts management/integration for ISC bind9 and dhcpd. |
4 |
||
5 |
Also includes network SNMP discovery. |
|
6 |
||
7 |
== Hosts == |
|
512
dafac309813e
README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents:
509
diff
changeset
|
8 |
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 | 9 |
|
10 |
[foo] |
|
512
dafac309813e
README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents:
509
diff
changeset
|
11 |
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
|
12 |
ethernet = 00:11:22:33:44:55 |
443 | 13 |
|
14 |
[bar] |
|
512
dafac309813e
README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents:
509
diff
changeset
|
15 |
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
|
16 |
ethernet = 01:23:45:67:89:ab |
443 | 17 |
|
520
0310e199435a
README: fixup --zone-prefix=
Tero Marttila <tero.marttila@aalto.fi>
parents:
516
diff
changeset
|
18 |
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
|
19 |
|
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
|
20 |
$ 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
|
21 |
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
|
22 |
bar A 192.0.2.2 |
443 | 23 |
|
520
0310e199435a
README: fixup --zone-prefix=
Tero Marttila <tero.marttila@aalto.fi>
parents:
516
diff
changeset
|
24 |
And correspondingly, the reverse zone for `2.0.192.in-addr.arpa`: |
443 | 25 |
|
520
0310e199435a
README: fixup --zone-prefix=
Tero Marttila <tero.marttila@aalto.fi>
parents:
516
diff
changeset
|
26 |
$ 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
|
27 |
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
|
28 |
2 PTR bar.example.com. |
443 | 29 |
|
452
d10f2b2188bb
README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents:
448
diff
changeset
|
30 |
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
|
31 |
|
512
dafac309813e
README: update to use example.com 192.0.2.0/24
Tero Marttila <tero.marttila@aalto.fi>
parents:
509
diff
changeset
|
32 |
$ 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
|
33 |
host foo { |
480
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
34 |
option host-name foo; |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
35 |
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
|
36 |
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
|
37 |
} |
d10f2b2188bb
README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents:
448
diff
changeset
|
38 |
|
d10f2b2188bb
README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents:
448
diff
changeset
|
39 |
host bar { |
480
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
40 |
option host-name bar; |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
41 |
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
|
42 |
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
|
43 |
} |
d10f2b2188bb
README etc/hosts/test with ethernet and pvl.hosts-dhcp output
Tero Marttila <tero.marttila@aalto.fi>
parents:
448
diff
changeset
|
44 |
|
514
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
45 |
=== 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
|
46 |
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
|
47 |
|
514
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
48 |
$ cat etc/hosts/test/test |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
49 |
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
|
50 |
|
514
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
51 |
$ cat etc/hosts/test/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
|
52 |
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
|
53 |
|
514
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
54 |
$ cat etc/hosts/test/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
|
55 |
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
|
56 |
|
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
|
57 |
$ bin/pvl.hosts-forward etc/hosts/test/test |
514
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
58 |
foo A 192.0.2.1 |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
59 |
bar A 192.0.2.2 |
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 |
And an entire directory of hosts-files, containing sub-domains, can be given: |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
62 |
|
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
63 |
$ ls etc/hosts/test/ |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
64 |
asdf.test test test.d |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
65 |
|
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
66 |
$ cat etc/hosts/test/asdf.test |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
67 |
[quux] |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
68 |
ip = 192.0.2.5 |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
69 |
|
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
|
70 |
$ bin/pvl.hosts-forward etc/hosts/test/ |
514
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
71 |
foo A 192.0.2.1 |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
72 |
bar A 192.0.2.2 |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
73 |
quux.asdf A 192.0.2.5 |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
74 |
|
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
75 |
Note that the (include) directory name itself is NOT treated as a domain name. However, the file names which are included are. |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
76 |
|
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
77 |
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
|
78 |
|
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
79 |
$ cat etc/hosts/wrong.test |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
80 |
include = wrong.d/ |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
81 |
|
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
82 |
$ etc/hosts/wrong.d/host |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
83 |
[host] |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
84 |
ip = 192.0.2.6 |
f19d86b20f24
README: document includes
Tero Marttila <tero.marttila@aalto.fi>
parents:
512
diff
changeset
|
85 |
|
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
|
86 |
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
|
87 |
|
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
|
88 |
$ 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
|
89 |
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
|
90 |
|
484
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
91 |
=== Host aliases === |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
92 |
Hosts can specify DNS aliases: |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
93 |
|
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
94 |
[foo] |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
95 |
ip = 127.0.0.1 |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
96 |
alias = test1 |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
97 |
|
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
98 |
[bar] |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
99 |
ip = 127.0.0.2 |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
100 |
alias = test2 |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
101 |
|
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
102 |
$ 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
|
103 |
foo A 127.0.0.1 |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
104 |
test1 CNAME foo |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
105 |
bar A 127.0.0.2 |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
106 |
test2 CNAME bar |
099dee149e74
document host alias=
Tero Marttila <tero.marttila@aalto.fi>
parents:
483
diff
changeset
|
107 |
|
447
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
108 |
=== Generated hosts === |
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
109 |
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
|
110 |
|
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
111 |
[asdf{1-3}] |
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
112 |
ip = 10.100.100.$ |
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
113 |
|
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
114 |
$ 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
|
115 |
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
|
116 |
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
|
117 |
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
|
118 |
|
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
119 |
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
|
120 |
|
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
121 |
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
|
122 |
|
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
123 |
[asdf{1-5/2}{0,2}] |
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
124 |
ip = 10.100.100.$${10} |
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
125 |
|
6f0357759e9b
pvl.hosts: fixup and document host expansion
Tero Marttila <tero.marttila@aalto.fi>
parents:
443
diff
changeset
|
126 |
$ 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
|
127 |
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
|
128 |
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
|
129 |
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
|
130 |
|
448
5ab0ec8200c3
README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents:
447
diff
changeset
|
131 |
This feature can be used for generating reverse delegations: |
5ab0ec8200c3
README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents:
447
diff
changeset
|
132 |
|
5ab0ec8200c3
README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents:
447
diff
changeset
|
133 |
[foo-{240-247}] |
5ab0ec8200c3
README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents:
447
diff
changeset
|
134 |
forward = |
5ab0ec8200c3
README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents:
447
diff
changeset
|
135 |
reverse = $.240/29.0.0.10.in-addr.arpa |
5ab0ec8200c3
README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents:
447
diff
changeset
|
136 |
ip = 10.0.0.$ |
5ab0ec8200c3
README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents:
447
diff
changeset
|
137 |
|
5ab0ec8200c3
README reverse delegation example
Tero Marttila <tero.marttila@aalto.fi>
parents:
447
diff
changeset
|
138 |
$ 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
|
139 |
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
|
140 |
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
|
141 |
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
|
142 |
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
|
143 |
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
|
144 |
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
|
145 |
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
|
146 |
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
|
147 |
|
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
148 |
=== DHCP Options === |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
149 |
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
|
150 |
|
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
151 |
[foo] |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
152 |
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 |
|
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
154 |
$ 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
|
155 |
host foo { |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
156 |
option host-name foo; |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
157 |
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
|
158 |
} |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
159 |
|
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
160 |
=== DHCP Boot options === |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
161 |
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
|
162 |
|
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
163 |
[foo] |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
164 |
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
|
165 |
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
|
166 |
|
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
167 |
$ 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
|
168 |
host foo { |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
169 |
option host-name foo; |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
170 |
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
|
171 |
next-server boot.lan; |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
172 |
filename debian/wheezy/pxelinux.0; |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
173 |
} |
7e44854e85d4
README and test host boot= and dynamic ip=
Tero Marttila <tero.marttila@aalto.fi>
parents:
452
diff
changeset
|
174 |
|
483
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
175 |
=== 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
|
176 |
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
|
177 |
|
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
178 |
[foo.dhcp] |
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
179 |
[[asdf]] |
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
180 |
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
|
181 |
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
|
182 |
|
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
183 |
[bar.dhcp] |
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
184 |
[[asdf]] |
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
185 |
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
|
186 |
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
|
187 |
|
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
188 |
$ 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
|
189 |
host asdf-eth1 { |
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
190 |
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
|
191 |
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
|
192 |
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
|
193 |
} |
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
194 |
|
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
195 |
host asdf-eth2 { |
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
196 |
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
|
197 |
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
|
198 |
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
|
199 |
} |
19d084bb4afd
pvl.hosts.dhcp: test and document hosts on multiple networks
Tero Marttila <tero.marttila@aalto.fi>
parents:
480
diff
changeset
|
200 |