Using dhcpcd client to fetch vendor specific options
rajeev Gaur
rajeev11gaur at gmail.com
Sat Mar 11 07:29:05 UTC 2023
Hello Sir
I am working on a project for fetching various different categories of
information from dhcp server.
DHCP Server: ISC DHCP Server 4.4.1
Client: dhcpcd 9.4.0, Compiled in features: INET ARP ARPing IPv4LL INET6
DHCPv6 AUTH
Build environment: Yocto
At this point when I am writing this mail, the basic working looks good.
The DHCP server, starts stops restarts well. In logs I can see the DISCOVER
/ OFFER / REQUEST / ACK all working fine. Lease IP is properly provided to
client.
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
#
authoritative;
option space Vendor-ONAS-INFO code width 1 length width 1 hash size 5;
option Vendor-ONAS-INFO.ipadd code 1 = ip-address;
option Vendor-ONAS-INFO.port code 9 = unsigned integer 16;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.35 192.168.2.52;
option routers 192.168.2.56;
option subnet-mask 255.255.255.0;
option domain-name-servers 8.8.8.8;
default-lease-time 100;
max-lease-time 100;
option host-name "OR-SERVER";
option ntp-servers 138.12.56.111;
option vendor-class-identifier "Vendor-ONAS";
vendor-option-space Vendor-ONAS-INFO;
option Vendor-ONAS-INFO.ipadd 192.168.71.50;
option Vendor-ONAS-INFO.port 11372;
}
On the client side, dhcpcd, I have kept information to allow and deny
interfaces, enabled the standard DHCP options for which I am getting values
( except for dhcp_client_identifier).
When I am performing ifdown and ifup for eth0 I am getting one leased IP
from the dhcp server.
#Use the hardware address of the interface for the Client ID
clientid
allowinterfaces eth0
denyinterfaces eth1
option ntp_servers
option dhcp_server_identifier
option dhcp_client_identifier (**Not getting this output)
My problem / Query:
1) What option to give in dhcpcd.conf to fetch the vendor options that i
have declared in dhcpd.conf at the server side.
2) Do I need to enable any thing on any side (client or server).
I did not see much documentation for dhcpcd client for vendor options.
I did saw the dhcpcd.conf man page for vendor information but it shows:
vendor code ,valueAdd an encapsulated vendor option. code should be between
1 and 254 inclusive. To add a raw vendor string, omit code but keep the
comma. Examples. Set the vendor option 01 with an IP address.
vendor 01,192.168.0.2Set the vendor option 02 with a hex code.
vendor 02,01:02:03:04:05Set the vendor option 03 with an IP address as a
string.vendor 03,\"192.168.0.2\"Set un-encapsulated vendor option to hello
world.vendor ,"hello world"
But I don't need to add any vendor option I have to fetch it from the
server.
I also tried giving vendorclassid so that it can fetch the details provided
for the vendor class identifier in the server, but i don't see any output.
I have previously worked with dhclient and i was able to fetch information
using that and I also see it has much more documentation online. But i see
less documentation for dhcpcd. But this is the only recommended client for
Yocto build environment.
Please suggest how can I fetch the vendor options using dhcpcd client.
Thanks
Rje
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20230311/fb8b5be6/attachment.htm>
More information about the dhcp-users
mailing list