Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DHCP Host Name Option #42

Open
krzysztof-sprzaczkowski opened this issue Nov 24, 2017 · 2 comments
Open

DHCP Host Name Option #42

krzysztof-sprzaczkowski opened this issue Nov 24, 2017 · 2 comments

Comments

@krzysztof-sprzaczkowski

Hi,
Is it possible to enable on the Arista switch sending Host-Name option in DHCP? - thru CLI or SDK API
By default only Client-Identifier option is sent.

Regards,
Krzysztof

@krzysztof-sprzaczkowski
Copy link
Author

I will add that I need to send DHCP host-name option on Management interface only.

In the first step I modified /etc/dhcp/dhclient-default.conf manually adding "send host-name = gethostname();" to verify that new option will be sent

interface "ma1" {
send dhcp-client-identifier "Arista-2899.3a43.71dc-Ma1";
send host-name = gethostname();
}

It works but obviously it is not right way - it was a simple verification only.

In the next step I tried to use Event-Handler mechanism described https://eos.arista.com/adding-interface-dhcp-support-with-an-event-handler/ but unfortunately it doesn't work for me.

I have prepare my own /mnt/flash/dhclient.conf file (with an additional line "send host-name = gethostname();" to force sending host-name) and added thsi file as a parameter to dhclient ( dhclient -pf $PIDFILE -lf $LEASEFILE -sf $DHCLIENTSCRIPT -cf $DHCLIENTCONF $KERNELINTF)

Next I tested the following scenarios:

  1. When I implement everything exactly according to the recipe I can see that IP address/mask on Management (ma1) interface is set as static (because of ip address $new_ip_address $new_subnet_mask" is in the eosdhclientscript script). In such case 'option host-name' is not sent.

  2. When I change one line in the eosdhclientscript script to "ip address dhcp" then the option is sent but DHCP server assigns a new IP address every few second but I can not see any IP address on Ma1 interface

  3. When I set additionally "ip address dhcp" on CLI for Ma1 interface I can see 2- dhclient processes on Linux CLI
    bash-4.3# ps -ef | grep dhclient
    root 8052 8042 0 17:18 ? 00:00:00 dhclient -pf /var/run/dhclient.Management1.pid -lf /var/lib/dhclient/dhclient.Management1.leases -sf /mnt/flash/eosdhclientscript -cf /mnt/flash/dhclient-psme.conf ma1
    root 8299 1 0 17:20 ? 00:00:00 dhclient -e SYSNAME=ar -e SYSDBSOCKNAME=sysdb -sf /etc/dhcp/dhclient-script.py -pf /var/run/dhclient-default.pid -cf /etc/dhcp/dhclient-default.conf -lf /var/lib/dhclient/dhclient-default.leases -e ma1=Management1

Do you have any idea how to configure DHCP properly to send host-name option on Ma1 interface?

Regards,
Krzysztof

@tsuna
Copy link
Member

tsuna commented Nov 25, 2017

Not sure if this is the best place where to ask for this kinda non-EosSdk related thing, I'd recommend reaching out to [email protected], they can either tell you what to do or find someone that knows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants