Community discussions

MikroTik App
 
FIPTech
Long time Member
Long time Member
Topic Author
Posts: 558
Joined: Tue Dec 22, 2009 1:53 am

DHCP option 121 string calculator - static classless routes distribution

Thu Jan 06, 2022 5:35 pm

Here is a spreadsheet to calculate the string needed for option 121 on a DHCP server.

DHCP option 121 is for distribution of IPv4 classless static routes to clients or why not between routers. Mikrotik DHCP client support it.

I did collect some important information about option 121 that are spread over Internet or that follow my experiments.

There are a couple online calculators available but they do not support /32 masks for the destination network.

Building the option 121 string is a bit tricky because of the hex conversion plus network address shortening (by 8 bits frontiers), so i did add a teaching version string to explain its structure.

Happy new year !
DHCP option 121 calculator v1.2.xlsx
You do not have the required permissions to view the files attached to this post.
 
User avatar
gmsmstr
Trainer
Trainer
Posts: 982
Joined: Fri Jun 04, 2004 2:22 am
Location: St. Louis, MO
Contact:

Re: DHCP option 121 string calculator - static classless routes distribution

Mon May 15, 2023 5:04 pm

I know this is a old post, but I wanted to add to the collective knowledge.

one use for this is /32 DHCP routing. The specific example is that you have a /24 or larger block, but you wish to have all of your customers come back to your router for routing, no ARPs no layer 2 connectivity to any device on the network.

Its really simple to enable this, by changing your DHCP server netmask to 32
However, you also need a DHCP option 121, to point the customer to the classless route, in our case the default gateway. This spreadsheet will allow you to do this (the one in this thread) by simply calculating the value of the DHCP option 121. Then you need to put that option on the network that you wish to use. Note that that option value will be DIFFERANT for each subnet you have.

So simply put to do /32 DHCP routing, with a prefix larger than /32, so lets say a /21 or even a /16. You can change the netmask to 32 in the dhcp networks tab, then add the option 121 to that network.
 
FIPTech
Long time Member
Long time Member
Topic Author
Posts: 558
Joined: Tue Dec 22, 2009 1:53 am

Re: DHCP option 121 string calculator - static classless routes distribution

Mon May 15, 2023 7:58 pm

Very interesting, thanks for sharing this idea.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: DHCP option 121 string calculator - static classless routes distribution

Tue May 16, 2023 4:07 pm

...
Last edited by rextended on Tue May 16, 2023 5:28 pm, edited 1 time in total.
 
FIPTech
Long time Member
Long time Member
Topic Author
Posts: 558
Joined: Tue Dec 22, 2009 1:53 am

Re: DHCP option 121 string calculator - static classless routes distribution

Tue May 16, 2023 4:13 pm

I know this is a old post, but I wanted to add to the collective knowledge.

...
Old things are like stones. They rock !
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: DHCP option 121 string calculator - static classless routes distribution

Tue May 16, 2023 4:16 pm

I know this is a old post, but I wanted to add to the collective knowledge.

...
Old things are like stones. They rock !

Some info on how to read option 121 from client:
viewtopic.php?f=2&t=175272&p=871239#p871239

Who is online

Users browsing this forum: Bing [Bot], icemending and 75 guests