Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
Sending Classless Static Routing to DHCP clients.
« previous
next »
Print
Pages: [
1
]
Author
Topic: Sending Classless Static Routing to DHCP clients. (Read 16329 times)
BertM
Jr. Member
Posts: 53
Karma: 12
Sending Classless Static Routing to DHCP clients.
«
on:
January 06, 2016, 10:14:16 pm »
I am not sure if this is the right place to post it, but maybe other people can benefit from the info below.
Having a chat about classless static routing with a few former colleagues, I realized that for may people it is unclear how to configure DHCP server to send classless static routing to DHCP clients.
Here below there is a copy of a short write-up I made for them.
Sending Classless Static Routes to DHCP Clients from OPNsense.
In the OPNsense Web GUI, go to Services ==> DHCP ==> Server and select the tab for the apropriate interface.
Scroll down to "Additional BOOTP/DHCP Options" and click the "Advanced" button.
Click the little Plus button to add an additional option.
In the Number field, enter the option number 121 for the Classless Static Route Option.
Select String in the Type field, because this option sends is a string of octets to the DHCP client.
Enter the apropriate string value field. This value is a number of octets, represented as a hexadecimal number and separated by colons.
Understanding the value string.
The string is made of the netmask and network of the destination (destination descriptor) and the address of the router that forwards traffic to the destination.
All octets are entered as their hexadecimal value.
So for example, if we want to route traffic to 192.168.10.0/24 via a router at 192.168.5.10, the string would be made as follows:
|-- Destination Descriptor --|
Netmask bits, Network address, Forwarding router address
24 192.168.10.0 192.168.5.10
| _| | | | | | |
| | __| | | | | |
| | | ___| | | | |
| | | | __________| | | |
| | | | | ___________| | |
| | | | | | ___________| |
|_________ | | | | | | ___________|
| | | | | | | |
Hex string: 18:C0:A8:0A:C0:A8:05:0A
Note that in the example above, the last octet of the network address is omitted.
This is because, according to RFC 3442, the descriptor of the destination is in compact format.
This means that the destination descriptor starts with one octet that represents the subnet mask, followed by only the significant octets of the destination network address.
Significant octets are all octets where at least one of the corresponding netmask bits is 1.
So for example if I wanted to route the complete private class-B address range via 192.168.5.10, this would look like:
Netmask bits, Network address, Destination router address
12 172.16.0.0 192.168.5.10
| _| | | | | |
| | __| | | | |
| | | ___________| | | |
| | | | ____________| | |
| | | | | ____________| |
|_________ | | | | | ____________|
| | | | | | |
Hex string: 0C:AC:10:C0:A8:05:0A
Should we want to send multiple Classless Static Routing entries to the DHCP client, we can simply concatenate the two strings with a colon in between.
So for example for the above two routing entries, this would look like:
18:C0:A8:0A:C0:A8:05:0A:0C:AC:10:C0:A8:05:0A
Kind regards,
Bert
Logged
huwylphi
Newbie
Posts: 7
Karma: 0
Re: Sending Classless Static Routing to DHCP clients.
«
Reply #1 on:
September 28, 2023, 06:19:33 pm »
Hi,
great example thanks!
This works on windows PC but unfortunately this classless static routing doesn't seems to work on android device (DHCP client)
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
Sending Classless Static Routing to DHCP clients.