2015/02/18 (水)
2015-02-18:dhcpd.conf の match if それ以外
以前、NIC のベンダーコードを判別して配るアドレスのレンジを変える dhcpd.conf の話を書いた。
そのときはベンダーAはあっち、ベンダーBはこっちというニーズだったので、
class "group1" { match if substring (hardware,1,3) = 00:12:34; } class "group2" { match if substring (hardware,1,3) = aa:bb:cc; }
といった dhcpd.conf だったのだけど、ここに「それ以外はこちらへ」を追加する必要が出たのでちょっと調べもの。
結論としては
class "group1" { match if substring (hardware,1,3) = 00:12:34; } class "group2" { match if substring (hardware,1,3) = aa:bb:cc; } class "other" { match if ((substring (hardware,1,3) != 00:12:34) and (substring (hardware,1,3) != aa:bb:cc)); }
これでいけた。
comment