Community discussions

 
canniscam
newbie
Topic Author
Posts: 25
Joined: Thu May 24, 2007 8:49 pm

RouterOS Not sending DHCP-Server Option 66

Wed Feb 18, 2009 9:29 pm

There may be a be a bug in the dhcp server implementation used by Mikrotik. I have been trying to implement a FOG (Open Source Disk Imaging Server) to help with managing our workstations. When I used the dchp3-server daemon with Ubuntu and FOG it works perfectly fine with the following configuration:

# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
# This file was created by FOG
use-host-decl-names on;
ddns-update-style interim;
ignore client-updates;

### This is the equivalent to option 66
next-server 10.22.1.27;

subnet 10.22.1.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
range dynamic-bootp 10.22.1.199 10.22.1.201;
default-lease-time 21600;
max-lease-time 43200;
option domain-name-servers 10.22.1.13;
option routers 10.22.1.253;
#### Equiv to Option 67
filename "pxelinux.0";
}
I have the following configuration setup in RouterOS:

/ip dhcp-server option
add code=66 name=TFTP-Server value=10.22.1.27
add code=67 name=PXE-FILE value=pxelinux.0
add code=60 name=Client-Redirect value=PXEClient


/ip dhcp-server network
add address=10.22.3.0/24 comment="" dhcp-option=\
Client-Redirect,TFTP-Server,PXE-FILE dns-server=\
10.22.3.2,10.22.0.2 gateway=10.22.3.1

When I review the logs in router OS with the dhcp topic and the debug prefix, I can see other options being sent, but 66 is never transmitted.

I can attach a supout.rif file if requested or I can e-mail it to support.

Best Regards,
Casey Annis
casey.annisATttiwirelessDOTcom
 
changeip
Forum Guru
Forum Guru
Posts: 3803
Joined: Fri May 28, 2004 5:22 pm

Re: RouterOS Not sending DHCP-Server Option 66

Wed Feb 18, 2009 9:57 pm

on 3.20 ?
Colo and Wholesale Bandwidth Available! Sales at SanDiegoBroadband dot com
 
canniscam
newbie
Topic Author
Posts: 25
Joined: Thu May 24, 2007 8:49 pm

Re: RouterOS Not sending DHCP-Server Option 66

Thu Feb 19, 2009 6:46 pm

Doh!

Yes, on 3.20 for X86 with VIA and Realtek NICs...

Casey
 
ricrc
just joined
Posts: 8
Joined: Sat Jun 30, 2007 2:19 pm

Re: RouterOS Not sending DHCP-Server Option 66

Sat Apr 04, 2009 4:53 am

Same problem here.

Option 66, is not being transmitted. I can confirm it was not transmitted on packet capture.

Running RB600A ROS 3.13
 
dssmiktik
Forum Veteran
Forum Veteran
Posts: 732
Joined: Fri Aug 17, 2007 8:42 am

Re: RouterOS Not sending DHCP-Server Option 66

Mon Aug 03, 2009 4:19 am

Option 66 setting:
/ip dhcp-server network set 0 next-server=
Option 67 setting:
/ip dhcp-server network set 0 boot-file-name=
This works on every 3.x version I've tried.
Doug
 
hjoelr
newbie
Posts: 29
Joined: Mon Apr 28, 2008 11:29 pm

Re: RouterOS Not sending DHCP-Server Option 66

Mon Aug 08, 2011 11:34 pm

I was having the same problem of my DHCP server not sending my TFTP option codes. I found that I had to add the "dhcp-option" parameter to each network:
/ip dhcp-server option
add code=66 name=tftp value=192.168.2.8
add code=150 name=tftp1 value=192.168.2.8

/ip dhcp-server network
add address=172.16.12.0/24 dhcp-option=tftp,tftp1 dns-server=\
    208.67.222.222,208.67.220.220 gateway=172.16.12.254
add address=192.168.0.0/24 dhcp-option=tftp,tftp1 dns-server=\
    208.67.222.222,208.67.220.220 gateway=192.168.0.254
This can also be done by going to IP -> DHCP Server -> Networks -> {double-click the network you want} -> DHCP Options.

I hope this helps!
 
miahac
Long time Member
Long time Member
Posts: 513
Joined: Wed Dec 14, 2005 5:04 pm
Location: Wichita, KS
Contact:

Re: RouterOS Not sending DHCP-Server Option 66

Wed Nov 09, 2011 5:19 pm

I am having an issue with some cisco phones on dhcp option 150 with some cisco phone. I put in:
add code=150 name=TFTP value=10.1.11.10
add code=66 name=tftp-66 value=10.1.11.10
and the phone tries to tftp from 49.48.46.96

I think it may be a cisco default or it is reading the value wrong.
Network Administrator
Kansas Hosting and Wichita Data Centers
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8305
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: RouterOS Not sending DHCP-Server Option 66

Wed Nov 09, 2011 6:40 pm

I am having an issue with some cisco phones on dhcp option 150 with some cisco phone. I put in:
add code=150 name=TFTP value=10.1.11.10
add code=66 name=tftp-66 value=10.1.11.10
and the phone tries to tftp from 49.48.46.96

I think it may be a cisco default or it is reading the value wrong.
49, 48, 46 are charcodes for '10.' - try to use HEX values:
add code=150 name=TFTP value=0x0a010b0a
add code=66 name=tftp-66 value=0x0a010b0a
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
miahac
Long time Member
Long time Member
Posts: 513
Joined: Wed Dec 14, 2005 5:04 pm
Location: Wichita, KS
Contact:

Re: RouterOS Not sending DHCP-Server Option 66

Wed Nov 09, 2011 7:13 pm

I will try it! I had tried coping the line directly out of the cisco router that had been using and got a completely different result
ip 10.1.11.10 10.1.11.11
Network Administrator
Kansas Hosting and Wichita Data Centers
 
miahac
Long time Member
Long time Member
Posts: 513
Joined: Wed Dec 14, 2005 5:04 pm
Location: Wichita, KS
Contact:

Re: RouterOS Not sending DHCP-Server Option 66

Thu Nov 10, 2011 5:30 pm

49, 48, 46 are charcodes for '10.' - try to use HEX values:
add code=150 name=TFTP value=0x0a010b0a
add code=66 name=tftp-66 value=0x0a010b0a
WOW HEX WORKED, GOOD EYE!!!
Network Administrator
Kansas Hosting and Wichita Data Centers
 
servaris
newbie
Posts: 46
Joined: Tue May 20, 2014 4:30 pm
Location: Planet Earth
Contact:

Re: RouterOS Not sending DHCP-Server Option 66

Sun Sep 14, 2014 10:01 am

I tried adding it via Mikrotik GUI and do not see the phone able to connect to the tftp server. Turned off the dhcp server on Mikrotik for the wired network and used some windows based dhcp server, used option 66 with the IP and it connected immeditately.

/ip dhcp-server network
add address=192.168.10.0/24 dhcp-option=tftp-66,tftp dns-server=\
192.168.10.253 domain=internal gateway=192.168.10.1 ntp-server=\
206.108.0.132 wins-server=192.168.10.252

/ip dhcp-server option
add code=150 name=tftp value=0x6B063232
add code=66 name=tftp-66 value=0x6B063232

I would much rather use Mikrotik over a windows 7 solution. But for the life of me I cannot see why the above fails to work when the comments in this thread show they are.

What might be wrong here?
Thanks.

I found what I was doing wrong!

The code must be 150 using code 66 is not working. Not sure if this is a bug or not. code 150 is working for sure.
Last edited by servaris on Mon Sep 15, 2014 5:13 am, edited 2 times in total.
 
User avatar
patrikg
Member Candidate
Member Candidate
Posts: 155
Joined: Thu Feb 07, 2013 6:38 pm
Location: Stockholm, Sweden

Re: RouterOS Not sending DHCP-Server Option 66

Sun Sep 14, 2014 11:28 am

I suggest to take a look at the new syntax for the dhcp options in the wiki.

http://wiki.mikrotik.com/wiki/Manual:IP ... CP_Options
 
servaris
newbie
Posts: 46
Joined: Tue May 20, 2014 4:30 pm
Location: Planet Earth
Contact:

Re: RouterOS Not sending DHCP-Server Option 66

Mon Sep 15, 2014 5:17 am

I suggest to take a look at the new syntax for the dhcp options in the wiki.

http://wiki.mikrotik.com/wiki/Manual:IP ... CP_Options
Hi Patrikg,
My syntax is:

/ip dhcp-server option
add code=150 name=tftp-server value=0x63EE56AE

It works. However, if code=66 it will NOT work.
 
User avatar
patrikg
Member Candidate
Member Candidate
Posts: 155
Joined: Thu Feb 07, 2013 6:38 pm
Location: Stockholm, Sweden

Re: RouterOS Not sending DHCP-Server Option 66

Mon Sep 15, 2014 6:39 pm

If you read the Cisco doc's.
Option 66 is for the tftp host name, not the ip.

Maybe you can use it, if you have a correct dns resolving on the cisco phones.
And use a correct host name as string.
ex: tftserver.local.lan

ros code

/ip dhcp-server option add code=66 name=tftp-server-host value="'tftpserver.local.lan'"
 
FIPTech
Member
Member
Posts: 469
Joined: Tue Dec 22, 2009 1:53 am

Re: RouterOS Not sending DHCP-Server Option 66

Thu Apr 20, 2017 8:36 pm

DHCP Option 66 can be used for a host name or an ip address. In both case it is normally a string.

If used for an IP address, according to what i'm used to, it is necessary to convert the IP address to a string. Using four hex values does not work, at least with Aastra phones.

https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server

So you need to put "s" before the IP address to convert it to an string :

s'192.168.112.150'

and you'll get this raw value :

0x 31 39 32 2e 31 36 38 2e 31 31 32 2e 31 35 30

dhcp-server option print
# NAME CODE VALUE RAW-VALUE
6 TFTP server 66 s'192.168.112.150' 3139322e3136382e3131322e313530

If you try to use four hex values for the IP (like this : '192.168.112.150' ), a phone or Wireshark will not decode it correctly, as shown here in Wireshark :

When using four hex values for the option 66 code value you will get something like this :
TFTP Server Name: \300\250\310d

The same goes in the phone. So the phone will not take it and will try another method to get the tftp file server address, or will fail to download the config file.

When using hex values converted as a string (like this : s'192.168.112.150') you'll get the right IP address decoded inside Wireshark and it will work in the phone :

TFTP Server Name: 192.168.112.150

Another solution is to use an mDNS server on the IPBX side. Aastra / Mitel phones do know how to get the tftp server address from it.

I prefer to use DHCP option 66, as i have seen frequent crashes on the mDNS linux deamon.

Who is online

Users browsing this forum: No registered users and 65 guests