Community discussions

MikroTik App
 
User avatar
Chaosphere64
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 94
Joined: Wed Aug 10, 2016 10:19 pm

DHCP-Client report hostname to external server

Thu Oct 27, 2022 3:39 pm

Hi everyone,

I am trying to get the MT DHCP-Client to report the device's hostname back to an external DHCP server. According to the https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Client there are three options supported, including hostname. So my questions would be:

1.) is the System Identity the same as the $hostname (or even FQDN), and if not: how can I set it?
2.) how does the DHCP Client / Advanced menu work? You select all DHCP client options you want to report to the server in the upper part of the menu? And you can sort them (why?)?
3.) what would the configuration needed to report the hostname to the DHCP server look like on the MikroTik?

Thanks in advance!

Edit: posted in the wrong section, pls move to Beginner Basics
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: DHCP-Client report hostname to external server

Fri Oct 28, 2022 3:03 am

Based on quick test, default hostname sent by DHCP client is taken from system identity. If you want something else without touching identity, you can do:
/ip dhcp-client option
add code=12 name=custom_hostname value="'myrouter'"
/ip dhcp-client
add dhcp-options=custom_hostname,clientid interface=<interface>
 
User avatar
Chaosphere64
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 94
Joined: Wed Aug 10, 2016 10:19 pm

Re: DHCP-Client report hostname to external server

Fri Oct 28, 2022 11:59 am

Thanks for taking the time to help, much appreciated!
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: DHCP-Client report hostname to external server

Fri Oct 28, 2022 1:09 pm

Or more simply....
/ip dhcp-client option set hostname value="'mydevicenicename'"
Notice:
the strig must be delimited between ' and '
and is why used " " for represent one string on script and inside is used ' ' for represent a DHCP option string value.

Who is online

Users browsing this forum: No registered users and 18 guests