NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

dhcp lease: /var/lib/dhcp/dhclient.leases is empty. udhcpc vs dhclient in labview realtime

Hi,

i am wondering how dhcpclient is configured in labview realtime.

My /var/lib/dhcp/dhclient.leases file is empty even though i got an ip from the dhcp-server.

As i just learned labview is using udhcpc instead of dhclient as ps told me:

/bin/busybox.nosuid /sbin/udhcpc -a -b -x hostname NI-sbRIO-9607-030bca33 -i eth0 -r 10.8.0.111 -s /etc/natinst/networking/udhcpc.script -p /var/run/udhcpc.eth0.pid

Where is udhcpc configured in labview realtime ?

Where is udcpc started from?

How to configure udcpc to obtain dhcp-options in a leasefile?

Any help appreciated.

What i am trying to do is to receive an ftp server address via an dhcp-option on the client side.

Thanks in advance

Arne

0 Kudos
Message 1 of 3
(5,523 Views)

As is shown in the snippet you've posted, the script used for handling DHCP actions is /etc/natinst/networking/udhcpc.script. Start there.

I don't really see a DHCP OPTION type for FTP servers, but I do see TFTP options (meant for loading a boot payload from a bootloader). Some (but not all) DHCP OPTION fields are filled-out by busybox's udhcpc, see: https://git.busybox.net/busybox/tree/networking/udhcp/common.c?h=1_22_stable#n52 (specifically: you'll need the server to be using the 0x42/66 DHCP OPTION).

Of course, I'm assuming I read into what you were asking correctly...

0 Kudos
Message 2 of 3
(5,190 Views)

Adding a bit more info: udhcpc does not deal in lease files, it instead runs scripts that have access to some of the networking details (both from the configuration as well as the DHCP traffic that it sees when negotiating). You can certainly create a script that would spit out a leasefile, but you're probably more interested in taking some action based on the OPTION field(s) you're interested in...

0 Kudos
Message 3 of 3
(5,190 Views)