# HG changeset patch # User Tero Marttila # Date 1424798676 -7200 # Node ID d10f2b2188bb6cc2958e84b3bb33105352eca29d # Parent d302b4957b07efd90bdf7b4ba11d48f8e856880f README etc/hosts/test with ethernet and pvl.hosts-dhcp output diff -r d302b4957b07 -r d10f2b2188bb README --- a/README Tue Feb 24 19:24:06 2015 +0200 +++ b/README Tue Feb 24 19:24:36 2015 +0200 @@ -8,10 +8,12 @@ The `pvl.hosts-* etc/hosts/test` tools read hosts files as input, which have an ini format, using section names as hostnames to configure attributes for that host: [foo] - ip = 127.0.0.1 + ip = 127.0.0.1 + ethernet = 00:11:22:33:44:55 [bar] - ip = 127.0.0.2 + ip = 127.0.0.2 + ethernet = 01:23:45:67:89:ab The default mechanism uses the basename of the given config file as the domain name, so this example file would generate something like the following output for use in a `zone "test" { ... }` zonefile: @@ -25,6 +27,21 @@ 1.0.0 PTR foo.test. 2.0.0 PTR bar.test. +And the associated DHCP hosts: + + $ bin/pvl.hosts-dhcp etc/hosts/test + host foo { + option host-name "foo"; + hardware ethernet 00:11:22:33:44:55; + fixed-address 127.0.0.1; + } + + host bar { + option host-name "bar"; + hardware ethernet 01:23:45:67:89:ab; + fixed-address 127.0.0.2; + } + === Generated hosts === The hosts file format supports something similar to bind9's $GENERATE directive for hosts: diff -r d302b4957b07 -r d10f2b2188bb etc/hosts/test --- a/etc/hosts/test Tue Feb 24 19:24:06 2015 +0200 +++ b/etc/hosts/test Tue Feb 24 19:24:36 2015 +0200 @@ -1,5 +1,7 @@ [foo] - ip = 127.0.0.1 + ip = 127.0.0.1 + ethernet = 00:11:22:33:44:55 [bar] - ip = 127.0.0.2 + ip = 127.0.0.2 + ethernet = 01:23:45:67:89:ab