Community discussions

 
steger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Sat Jul 29, 2006 9:17 am

dhcp-client "add-default-route=special-classless" - why option 3 (router) is still requested?

Thu May 17, 2018 8:28 am

hello there,

i have 2 interfaceinstances in the routingtable:
1 of them is internet the other one is management, both of them acts as a dhcp-client.

my management as shown:
/ip dhcp-client option
add code=60 name=opt60-mgt value=0x4d4754

/ip dhcp-client
add add-default-route=special-classless default-route-distance=5 dhcp-options=hostname,opt60-mgt,clientid disabled=no interface=vlan501

why the dhcp-client is still requesting the dhcp option 3 (router)

07:26:15 dhcp,debug,packet Parameter-List = Subnet-Mask,Classless-Route,Router,Static-Route,Domain-Server,NTP-Server,CAPWAP-Server,Vendor-Specific

how can i supress to request the dhcp option 3 (router) when dhcp opt 121 (classless-route) is requested?

actually i dont like unrequired static routes. (of course i can set a distance... but i try to avoid this)

btw: if i reboot the CPE - the default route is gone... as expected.... - any known issues ?

thank you!

christian
 
sindy
Forum Guru
Forum Guru
Posts: 2249
Joined: Mon Dec 04, 2017 9:19 pm

Re: dhcp-client "add-default-route=special-classless" - why option 3 (router) is still requested?

Thu May 17, 2018 9:42 am

What actually bothers you, that router (i.e. the default gateway) is requested even though you the client is told not to use it, or that it is used?

Both router and classless-route are requested regardless the add-default-route value, what differs is how the client uses the received values. And to say it all, the name of "use default route" is a historic one, it should actually read "use routing info".

So to request the classless route, you do not need to set add-default-route to special-classless. This value only says "even if you do receive the classless route, use the value from router as well if you receive it", which is a behaviour which the classless route RFC normally prohibits.

So by setting add-default-route=special-classless you actually say do use the router if it is there, regardless whether classless-route is received and used; by setting add-default-route=yes, you ask the client to only use the value from classless-route if it is present in the response and ignore the value of router if present as well, and only the value from router if it is present but classless-route is not. And by setting add-default-route=no, you ignore any of the two.

And the value of default-route-distance is used also for all the routes provided by classless-route.
Instead of writing novels, post /export hide-sensitive. Use find&replace in your favourite text editor to systematically replace each occurrence of any public IP address potentially identifying you by a distinctive pattern such as my.public.ip.1.
 
steger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Sat Jul 29, 2006 9:17 am

Re: dhcp-client "add-default-route=special-classless" - why option 3 (router) is still requested?

Thu May 17, 2018 1:43 pm

hi sindy!

thank you for your explaination! - great answer!

back to my original addition question:
is there a way to request only the classless-static-route (option121) and not in addition the option3?

on most cpe´s i know i can explicitly request option 121 and do seperate an request for option 3.

thanik you!

christian
 
sindy
Forum Guru
Forum Guru
Posts: 2249
Joined: Mon Dec 04, 2017 9:19 pm

Re: dhcp-client "add-default-route=special-classless" - why option 3 (router) is still requested?

Thu May 17, 2018 1:58 pm

is there a way to request only the classless-static-route (option121) and not in addition the option3?
It was my very first question - "what actually bothers you?"

So I'm afraid that both options 3 and 121 are hardcoded into the DHCPDISCOVER and DHCPREQUEST and you cannot remove them by configuration.
Instead of writing novels, post /export hide-sensitive. Use find&replace in your favourite text editor to systematically replace each occurrence of any public IP address potentially identifying you by a distinctive pattern such as my.public.ip.1.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5661
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: dhcp-client "add-default-route=special-classless" - why option 3 (router) is still requested?

Thu May 17, 2018 3:11 pm

You cannot disable options 3 and 121 in requests. What is the main reason for such feature?
 
steger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Sat Jul 29, 2006 9:17 am

Re: dhcp-client "add-default-route=special-classless" - why option 3 (router) is still requested?

Fri May 18, 2018 7:54 am

hi mrz,

its actually simple to explain and probably in depency of the missing management feature inside an vrf:

we use for our customer one servicechannel (l3vpn or internetaccess) and one for management. (2 different vlan´s with 2 different destinations of course :))
so because of the missing management feature inside an vrf, i cannot accept more than one default-route. (of course i can work with the distance..)
therefore for Management i push opt 121 to reach the ACS and dont Need an default-route.

anyway i can work without the feature.. but would be probably nice to have it seperatly requestable..

thank you!

christian
 
sindy
Forum Guru
Forum Guru
Posts: 2249
Joined: Mon Dec 04, 2017 9:19 pm

Re: dhcp-client "add-default-route=special-classless" - why option 3 (router) is still requested?

Fri May 18, 2018 8:31 am

Does your DHCP server in the management VLAN change the contents of Option 121 in its responses depending on whether Option 3 was or was not requested by the client?

If it doesn't, i.e. if it constantly provides the gateway for (implicit) prefix 0.0.0.0/0 in Option 3 and the gateway(s) for some other, longer, prefix(es) in Option 121, then just configure the DHCP client in the management VLAN with add-default-route=yes. In this case, your DHCP server will return both Option 3 and Option 121, but the Mikrotik's DHCP client will ignore the contents of Option 3 and only add to its routing table the routes from Option 121. (As said - add-default-route is actually a historic name which is now confusing because it doesn't reflect the actual behaviour any more).

What I've just described is the intended behaviour, as RFC3442 states:

If the DHCP server returns both a Classless Static Routes option and a Router option, the DHCP client MUST ignore the Router option.

So if you configure the client this way using add-default-route=yes and it behaves different from the description above, it is a bug and a support ticket needs to be open.
Instead of writing novels, post /export hide-sensitive. Use find&replace in your favourite text editor to systematically replace each occurrence of any public IP address potentially identifying you by a distinctive pattern such as my.public.ip.1.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5661
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: dhcp-client "add-default-route=special-classless" - why option 3 (router) is still requested?

Fri May 18, 2018 11:10 am

ROS client works as sindy described, "router" option is ignored if option 121 is received form the server. Exception is if add-default-route=special-classless is set, then "router" option is not ignored.
 
steger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Sat Jul 29, 2006 9:17 am

Re: dhcp-client "add-default-route=special-classless" - why option 3 (router) is still requested?

Fri May 18, 2018 11:27 am

hi mrz,

understood! - just checked it out with add-default-route where opt 121 are also offered.
had to disable and enable the Interface...
it works! - the description "add-default-route" made me crazy.

all fine!

great help!

thank you!

christian

Who is online

Users browsing this forum: No registered users and 30 guests