Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 

Cisco IOS DHCP Server + classless static routes on DHCP clients

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
New Member

Cisco IOS DHCP Server + classless static routes on DHCP clients

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.

New Member

Cisco IOS DHCP Server + classless static routes on DHCP clients

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

6 REPLIES
New Member

Cisco IOS DHCP Server + classless static routes on DHCP clients

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.

Cisco IOS DHCP Server + classless static routes on DHCP clients

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!

New Member

Cisco IOS DHCP Server + classless static routes on DHCP clients

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

Cisco IOS DHCP Server + classless static routes on DHCP clients

Hi Pascal,

When needing a /16 mask, we need specify only in hex format?

I will try this when returning home.

Thanks!

Cisco IOS DHCP Server + classless static routes on DHCP clients

Hi Pascal, it worked!

Also I got working this way:

option 121 hex 10:C0:A8:C0:A8:6E:01

Thanks!

Cisco IOS DHCP Server + classless static routes on DHCP clients

Thank you for syntax! You solved my problem in a moment!

6931
Views
0
Helpful
6
Replies
CreatePlease to create content