If you have hundreds of stations on your LANforge and want to give them all hostnames, this is certainly possible. Please get the add-dhcp-hostname.pl script from the lanforge-scripts repository.
- First bring up your stations with DHCP enabled. This will create your dhclient config files in /home/lanforge/vr_conf.
- Admin-down the stations.
- With a root shell, go to that vr_conf directory and run this script on the files you want to give hostnames to.
- For just one station:
root# ~lanforge/scripts/add-dhcp-hostname.pl dhclient_sta0000.conf
- For all the stations:
root# ~lanforge/scripts/add-dhcp-hostname.pl dhclient_sta*conf
- For just one station:
- Admin-up the stations.
- If you are sniffing, you will see a DHCP Request packet that has a hostname attribute.
- If you are inspecting a LANforge dhcpd server in a virtual router, you would check /home/lanforge/vr_conf/vrcx_eth1_dhcp_lease.db for entries with the setting client-hostname.
That should work.