<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Class/subclass would better fit your needs:<br>
<font color="#993300"><tt># -------------</tt><tt><br>
</tt><tt>class "gaeste" { </tt><tt><br>
</tt><tt> match hardware;</tt><tt><br>
</tt><tt> option routers 10.69.0.251; # can set the routers
here or in "gaste" pool</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><tt># MAC address is preceded by '1:' indicating ethernet</tt><tt><br>
</tt><tt>subclass "gaeste" 1:aa:bb:cc:dd:ee:ff; # test1</tt><tt><br>
</tt><tt># -------------</tt><tt><br>
</tt><tt><br>
</tt><tt># -------------</tt><tt><br>
</tt><tt>class "subnet2" {</tt><tt><br>
</tt><tt> match hardware;</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><tt>subclass "subnet2" 1:bb:cc:dd:ee:ff:aa; # test2</tt><tt><br>
</tt><tt>subclass "subnet2" 1:cc:dd:ee:ff:aa:bb { # test3 -
can have additional settings</tt><tt><br>
</tt><tt> ddns-hostname = "test3-PC";</tt><tt><br>
</tt><tt> ddns-domainname "different.domain.com";</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><tt># -------------</tt><tt><br>
</tt><tt><br>
</tt><tt>shared-network tfd {</tt><tt><br>
</tt><tt></tt><tt> subnet 10.69.0.0 netmask 255.255.0.0 {</tt><tt><br>
</tt><tt> ...</tt><tt><br>
</tt><tt> pool { # host test1 should get IP of this pool</tt><tt><br>
</tt><tt> allow members of "gaeste";</tt><tt><br>
</tt><tt># option routers 10.69.0.251;</tt><tt><br>
</tt><tt> range 10.69.253.1 10.69.253.254;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> subnet 130.75.69.0 netmask 255.255.255.0 {</tt><tt><br>
</tt><tt> ...</tt><tt><br>
</tt><tt> pool { # host test2 should get IP of this pool</tt><tt><br>
</tt><tt> allow members of "subnet2";</tt><tt><br>
</tt><tt> range 130.75.69.50 130.75.69.60;</tt><tt><br>
</tt><tt> ....</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> pool { # NO INTERNET</tt><tt><br>
</tt><tt> deny members of "gaeste";</tt><tt><br>
</tt><tt> deny members of "subnet2";</tt><tt><br>
</tt><tt> range 130.75.69.61 130.75.69.70;</tt><tt><br>
</tt><tt> ....</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><tt>#host test1 {</tt><tt><br>
</tt><tt># hardware ethernet aa:bb:cc:dd:ee:ff;</tt><tt><br>
</tt><tt># option tfd-scope-identifier "gaeste";</tt><tt><br>
</tt><tt>#}</tt><tt><br>
</tt><tt>#host test2 {</tt><tt><br>
</tt><tt># hardware ethernet bb:cc:dd:ee:ff:aa;</tt><tt><br>
</tt><tt>#}</tt><tt><br>
</tt></font><br>
Host declarations are global and should not be inside any<br>
other structure except 'group'. Pools should be inside subnet<br>
declarations.<br>
<br>
There are other ways to do class matches:<br>
<font color="#993300"><tt>class "10.mobile_device" {</tt><tt><br>
</tt><tt> match if (</tt><tt><br>
</tt><tt> option host-name ~~ "dhcpcd"</tt><tt><br>
</tt><tt> or option host-name ~~ "android"</tt><tt><br>
</tt><tt> or option vendor-class-identifier ~~ "android"</tt><tt><br>
</tt><tt> or option host-name ~~ "samsung-sm"</tt><tt><br>
</tt><tt> or option host-name ~~ "iphone"</tt><tt><br>
</tt><tt> or option host-name ~~ "ipod"</tt><tt><br>
</tt><tt> or option host-name ~~ "ipad"</tt><tt><br>
</tt><tt> or option host-name ~~ "watch"</tt><tt><br>
</tt><tt> );</tt><tt><br>
</tt><tt><br>
</tt><tt> if (lcase(option host-name) = "iphone") {
ddns-hostname = concat("iPhone-", binary-to-ascii(16, 8, "",
substring(hardware, 4, 3))); }</tt><tt><br>
</tt><tt> if (lcase(option host-name) = "iphone-2") {
ddns-hostname = concat("iPhone2-", binary-to-ascii(16, 8, "",
substring(hardware, 4, 3))); }</tt><tt><br>
</tt><tt> if (lcase(option host-name) = "ipod") { ddns-hostname
= concat("iPod-", binary-to-ascii(16, 8, "", substring(hardware,
4, 3))); }</tt><tt><br>
</tt><tt> if (lcase(option host-name) = "ipad") { ddns-hostname
= concat("iPad-", binary-to-ascii(16, 8, "", substring(hardware,
4, 3))); }</tt><tt><br>
</tt><tt> if (substring(lcase(option host-name), 0, 10) =
"samsung-sm") {</tt><tt><br>
</tt><tt> ddns-hostname = concat("samsung-",
binary-to-ascii(16, 8, "", substring(hardware, 4, 3)));</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt></font>The 'if' statements above creates a unique name for
those people<br>
that leave their iPhone name with the out-of-the-box default name.<br>
~~ is a regex comparison.<br>
<br>
Kyocera printer:<br>
<font color="#993300"><tt>class "Kyocera" {</tt><tt><br>
</tt><tt># match if substring(hardware, 1,3) = 00:c0:ee;</tt><tt><br>
</tt><tt> match if (</tt><tt><br>
</tt><tt> substring(hardware, 1,3) = 00:c0:ee</tt><tt><br>
</tt><tt> or substring(hardware, 1,3) = 00:17:c8</tt><tt><br>
</tt><tt> );</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt></font><br>
Bill<br>
<br>
<div class="moz-cite-prefix">On 12/7/2017 3:49 AM, Sven Schumacher
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:a4c48db7-f11d-7b1d-b776-a8a81b64bc07@tfd.uni-hannover.de">
<pre wrap="">class "gaeste" {
match if (config-option tfd-scope-identifier = "gaeste");
}
shared-network tfd {
subnet 10.69.0.0 netmask 255.255.0.0 {
deny unknown-clients;
...
}
subnet 130.75.69.0 netmask 255.255.255.0 {
deny unknown-clients;
...
}
host test1 {
hardware ethernet aa:bb:cc:dd:ee:ff;
option tfd-scope-identifier "gaeste";
}
host test2 {
hardware ethernet bb:cc:dd:ee:ff:aa;
}
pool { # host test2 should get IP of this pool
range 130.75.69.50 130.75.69.60;
deny members of "gaeste";
....
}
pool { # host test1 should get IP of this pool, but didn't
range 10.69.253.1 10.69.253.254;
option routers 10.69.0.251;
allow members of "gaeste";
}
}</pre>
</blockquote>
<br>
</body>
</html>