Community discussions

MUM Europe 2020
 
WirelessRudy
Forum Guru
Forum Guru
Topic Author
Posts: 3089
Joined: Tue Aug 08, 2006 5:54 pm
Location: Spain

Help needed on DHCP-client v.6

Mon Jun 03, 2013 1:44 pm

I don't understand how this new dhcp-client is working.
In v5 and before I used to set a cpe number in the dhcp-cl hostname field:
/ip dhcp-client
add add-default-route=yes default-route-distance=1 disabled=no host-name=A-003 interface=wlan1 use-peer-dns=yes use-peer-ntp=yes
So in the lease table of the dhcp-server this unit comes up with 'Active Host Name' "A-003". Just the way I want it.

But now in ros v.6;
 /ip dhcp-client
add dhcp-options="clientid,(unknown),hostname" disabled=no interface=wlan1
Where now to fill in the host-name?
If I try to make a new DCHCP Client Option in the "DHCP Client Options" section, I'll get an error "Couldn't add New DHCP Client Option - Unknown data type! (6)"

If I look in the lease table of the AP I see now the client has the full system ID in its 'Active Host Name' field. I don't want that, I just want the antenna number. Not the full ID..... :(

So obviously it has to be done another way. But I can't find any documentation about it and after trying some options I gave up. Why can't MT not come up with a manual if they bring out a new software version!
I mean, its not rc anymore, It's real.....
Show your appreciation of this post by giving me Karma! Thanks.

Rudy R. Puister

WISP operator based on MT routerboard & ROS.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Help needed on DHCP-client v.6

Tue Jun 11, 2013 3:41 pm

similar to dhcp-server, starting RouterOS 6.0 it is possible to add client-side options that are sent to DHCP server. Mechanism used to do that is similar to dhcp-server.

Configuration item is available under '/ip dhcp-client option' where you can set up options used for client.

for example:

ros code

/ip dhcp-client option
set clientid code=61 name=clientid value="0x01\$(CLIENT_MAC)"
set hostname code=12 name=hostname value="\$(HOSTNAME)"
in this case values will be generated on the fly when request is created and CLIENT_MAC will be set to MAC address of interface and hostname will be taken from RouterOS identity. Other options can be added in a similar manner.

In your case you have to add option 12 with different value and name, and use your custom option 12.
 
WirelessRudy
Forum Guru
Forum Guru
Topic Author
Posts: 3089
Joined: Tue Aug 08, 2006 5:54 pm
Location: Spain

Re: Help needed on DHCP-client v.6

Tue Jun 11, 2013 7:23 pm

well that took some time...

Anyway, I have to use opcion 12, I guessed that. But then, how do I get my info in that field?

I want the client to surface in the dhcp-server 'active hostname' with a certain number, like ; "A3-005"

The hostname is actuall different, "A3-005 Mr. Mistername"
But I only want the CPE number to pop up in the dhcp-server. I'm in Spain here and people have long, looong names here.. I don't want that in my dhcp-server hostname overview....

I tried
set hostname code=12 name=hostname value="A3-005"
but that is rejected.

I tried serveral things in winbox but everytime I get an error message. Since there is no manual on how to do this :( I'm getting nowhere......

So please give me a example what to do to make the client pop up in the dchp-server active hostname with "A3-005"

It should be simple......
Show your appreciation of this post by giving me Karma! Thanks.

Rudy R. Puister

WISP operator based on MT routerboard & ROS.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Help needed on DHCP-client v.6

Wed Jun 12, 2013 9:34 am

again, same as dhcp-server option- value="'random text'" or just use HEX - value="0x72616e646f6d2074657874"

note that hex strings do not require quotation marks around them text requires them and variables have a special syntax.

this applies to dhcp-client options:
http://wiki.mikrotik.com/wiki/Manual:IP ... CP_Options
 
WirelessRudy
Forum Guru
Forum Guru
Topic Author
Posts: 3089
Joined: Tue Aug 08, 2006 5:54 pm
Location: Spain

Re: Help needed on DHCP-client v.6

Wed Jun 12, 2013 11:29 am

again, same as dhcp-server option- value="'random text'" or just use HEX - value="0x72616e646f6d2074657874"

note that hex strings do not require quotation marks around them text requires them and variables have a special syntax.

this applies to dhcp-client options:
http://wiki.mikrotik.com/wiki/Manual:IP ... CP_Options
OK, your remark re quotation marks helped. I see now that 'xx' is with quotation marks, and "xx"is merely to quote or give the example.
Hence your "'xx'" was a bit confusiong to me, after I even red over it a hundred time....

Anyway, I've got it now...
Show your appreciation of this post by giving me Karma! Thanks.

Rudy R. Puister

WISP operator based on MT routerboard & ROS.
 
dsobin
Member Candidate
Member Candidate
Posts: 160
Joined: Mon Jun 04, 2007 3:58 am
Location: New Jersey, USA

Re: Help needed on DHCP-client v.6

Sat Jun 15, 2013 12:09 am

Even after reading the previous set of posts 10 times, I still couldn't get it to work. For those who come after me:

You need both apostrophe (looks like this: ' ) AND a quote (looks like this: " ) . If you spread it out (but don't do that) you see this:
 ...    value="  'myhostname'  "
Don't spread it out, though. You need the quote and the apostrophe next to each other to open and close the text.

I hope this helps the next person who looks at these posts.
Remember to give karma to all those who help you - Click the "+" box to the left, under "Karma"

Who is online

Users browsing this forum: MSN [Bot] and 132 guests