Assigning Static Routes To Clients Using DHCP

From Baranoski.ca
Jump to navigation Jump to search

You can configure the DHCP server in a Cisco router to hand out static routes to clients. This is good if you have some extra subnets that are accessible by gateway other than the default, or you want to push routes to VPN clients.

Here's how to do a static route for 192.168.0.0/16 via 192.168.10.1.

ip dhcp pool PPTP-VPN
   network 192.168.10.0 255.255.255.0
   dns-server 192.168.10.1
   domain-name example.com
   option 121 hex 10c0.a8c0.a80a.01
   option 249 hex 10c0.a8c0.a80a.01

The example above shows a hex string in two DHCP options. From what I've seen, both options are necessary, for compatibility with various clients.

If you take the hex string, and convert each pair of characters to decimal, you'll end up with 16 192 168 192 168 10 01. The format is subnet mask (16), subnet (192 168), gateway (192 168 10 1).