已/etc/dhcp/dhcpd.conf
添加
omapi-port 7911;
omapi-key testkey;
key testkey {
algorithm hmac-sha256;
secret QUt1z1O3fxqgSDKILAMXFA==;
}
但它不让我连接
# systemctl restart dhcpd
# omshell
> server localhost
> key testkey QUt1z1O3fxqgSDKILAMXFA==
> connect
dhcpctl_connect: not found
密钥由
# dnssec-keygen -a hmac-sha256 -b 128 -n USER dhcpupdate
# cat Kdhcpupdate.+163+41847.*
dhcpupdate. IN KEY 0 3 163 QUt1z1O3fxqgSDKILAMXFA==
Private-key-format: v1.3
Algorithm: 163 (HMAC_SHA256)
Key: QUt1z1O3fxqgSDKILAMXFA==
Bits: AAA=
Created: 20181123141544
Publish: 20181123141544
Activate: 20181123141544
问题
有人能看到我做错什么吗?
答案1
我今天正在寻找一些其他 omshell 信息,然后找到了你的问题。尝试在你的密钥周围加上引号,并在最后一个括号后加上分号:
key testkey {
algorithm hmac-sha256;
secret "QUt1z1O3fxqgSDKILAMXFA==";
};
我希望这能有所帮助。
答案2
hmac-sha256 改为 HMAC-SHA256 或者使用 HMAC-MD5
例子:
omapi-port 7911;
key omapi_key {
algorithm HMAC-MD5;
secret WRcLh5+g2U7kBL6u7+9kh6jv2OwHAQFlLOYUnBfYvmVFutggwGdzIeJL7dnbc5ROdmhl6Eg28wQ61Q==;
}
omapi-key omapi_key;