11-12-2011 11:18 AM - edited 03-07-2019 03:21 AM
Hi there, I was trying to find if it's possible to add the option for static routes for DHCP clients on Cisco IOS DHCP config mode. I'm looking to add a settings as defined on RFC 3442, like this one, set on ISC DHCPd server:
Global settings:
option rfc3442-classless-static-routes code 121 = array of integer 8;
option ms-classless-static-routes code 249 = array of integer 8;
And for the subnet declaration:
option rfc3442-classless-static-routes 24, 192, 168, 30, 192, 168, 10, 1;
option ms-classless-static-routes 24, 192, 168, 30, 92, 168, 10, 1;
Is it possible?
Thanks!
Vitor
Solved! Go to Solution.
11-16-2011 06:00 PM
Yes, the fun part is converting it into a format IOS will accept. You could try:
ip dhcp pool 0
option 121 ip 24.192.168.30 192.168.10.1
option 249 ip 24.192.168.30 92.168.10.1
If that doesn't work, change the "ip" to "hex" and convert each of your decimal bytes into hex.
10-16-2012 08:35 PM
When entering a static route for a /24 you can use ip notation because you have 3 significant octets. With a /16 you only have 2 significant octets so you have to convert to hex:
option 121 hex 10C0.A8C0.A86E.01
11-16-2011 06:00 PM
Yes, the fun part is converting it into a format IOS will accept. You could try:
ip dhcp pool 0
option 121 ip 24.192.168.30 192.168.10.1
option 249 ip 24.192.168.30 92.168.10.1
If that doesn't work, change the "ip" to "hex" and convert each of your decimal bytes into hex.
10-16-2012 03:57 PM
Hi Pascal, how are you?
Almost one year ago, I noticed this was my post HAHA
It worked for me, but I need to add more networks on options 121 and 249. Example, now I'm running with 2 different networks and I would like to use /16 to summarize both. I need to recall if this way worked on DHCPd server, it was a quite long time ago. I got rid from a VM with DHCPd serving these options from my home lab.
Here are the current config I got working today, on a IOS DHCP server:
!
ip dhcp pool DATA
network 192.168.110.0 255.255.255.0
dns-server 8.8.8.8
option 121 ip 24.192.168.120 192.168.110.1 24.192.168.130 192.168.110.1
option 249 ip 24.192.168.120 192.168.110.1 24.192.168.130 192.168.110.1
!
And this is the routing output from my computer now. I just pasted the routes from above. Ignore default route:
vitor@mantis:/$ ip route
192.168.130.0/24 via 192.168.110.1 dev wlan0 proto static
192.168.110.0/24 dev wlan0 proto kernel scope link src 192.168.110.3 metric 2
192.168.120.0/24 via 192.168.110.1 dev wlan0 proto static
169.254.0.0/16 dev wlan0 scope link metric 1000
default dev ppp0 scope link
vitor@mantis:/$
Thanks!
10-16-2012 08:35 PM
When entering a static route for a /24 you can use ip notation because you have 3 significant octets. With a /16 you only have 2 significant octets so you have to convert to hex:
option 121 hex 10C0.A8C0.A86E.01
10-17-2012 04:50 AM
Hi Pascal,
When needing a /16 mask, we need specify only in hex format?
I will try this when returning home.
Thanks!
10-18-2012 06:04 PM
Hi Pascal, it worked!
Also I got working this way:
option 121 hex 10:C0:A8:C0:A8:6E:01
Thanks!
10-29-2013 03:43 AM
Thank you for syntax! You solved my problem in a moment!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide