我们在我们的networking中实施Option 82,我只是抓住如何设置我的服务器的表面。 我已经根据包中包含的代理电路ID成功创build了我的第一个Option 82 ACL,现在我只需要指导如何将Option 82数据导入到日志中。 这是我在服务器上的O82设置:
## Option 82 Class class "myvendor" { match if option agent.circuit-id = 00:04:00:6b:00:84; } # Test Option 82 logging if exists agent.circuit-id { log (info, concat( "Lease for ", option agent.circuit-id (leased-address), "is an address assigned using Option82")); } pool { allow members of "myvendor"; range xxxx xxxx; }
我遇到的问题是当我重新启动dhcpd之前检查conf我得到的错误:
etc/dhcp/dhcpd.conf line 135: right parenthesis expected. log (info, concat( "Lease for ", option agent.circuit-id ( ^
任何人都可以告诉我我做错了什么,以及如何解决这个错误? 我已经尝试了多个括号的位置和configuration,但不断抱怨。
我假设你想有一个日志行如:
租约<IP地址>,电路ID <电路ID>使用Option82分配
我想这应该工作:
日志(info,concat(
“租 ”,
binary-to-ascii(10,8,“。”,租用地址),
“,电路ID”,
选项agent.circuit-id,
“使用Option82分配”)
);
请注意,如果您的电路ID字段是二进制的(例如,不是常规的人类可读值),则需要先将其转换为可读取的内容。 另请参阅man dhcp-eval。