DHCP question: How to specify a static route _with_ netmask?

This is a discussion on DHCP question: How to specify a static route _with_ netmask? within the Linux Networking forums, part of the Linux Forums category; Hello: I have been using a statement like this to add several static routes to our Windows clients: option static-...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-21-2003
Ramon F Herrera
 
Posts: n/a
Default DHCP question: How to specify a static route _with_ netmask?

Hello:

I have been using a statement like this to add several static routes
to our Windows clients:

option static-routes <dest network1> <gateway1>,
<dest network2> <gateway2>,
<dest network3> <gateway3>;



The above adds the routes with a 255.255.255.255 netmask.

How can I specify some other netmask for the routes?

Thanks,

-Ramon F. Herrera
Reply With Quote
  #2 (permalink)  
Old 11-21-2003
Allen Kistler
 
Posts: n/a
Default Re: DHCP question: How to specify a static route _with_ netmask?

Ramon F Herrera wrote:
> I have been using a statement like this to add several static routes
> to our Windows clients:
>
> option static-routes <dest network1> <gateway1>,
> <dest network2> <gateway2>,
> <dest network3> <gateway3>;
>
>
>
> The above adds the routes with a 255.255.255.255 netmask.
>
> How can I specify some other netmask for the routes?


Unfortunately you can't. You can only specify routes to hosts, not
routes to networks, with DHCP.

Reply With Quote
  #3 (permalink)  
Old 11-26-2003
W Cardwell
 
Posts: n/a
Default Re: DHCP question: How to specify a static route _with_ netmask?

RFC 3442 describes a classless static-routes option that encodes a prefix
length within the 4-byte destination address. Not all clients support it and
I haven't looked to see if Windows does, but here's a link:
http://www.faqs.org/rfcs/rfc3442.html


--

wcardwell at nc dot rr dot com


"Allen Kistler" <ackistler@oohay.moc> wrote in message
news:R%svb.3699$aw2.1056160@newssrv26.news.prodigy .com...
> Ramon F Herrera wrote:
> > I have been using a statement like this to add several static routes
> > to our Windows clients:
> >
> > option static-routes <dest network1> <gateway1>,
> > <dest network2> <gateway2>,
> > <dest network3> <gateway3>;
> >
> >
> >
> > The above adds the routes with a 255.255.255.255 netmask.
> >
> > How can I specify some other netmask for the routes?

>
> Unfortunately you can't. You can only specify routes to hosts, not
> routes to networks, with DHCP.
>



Reply With Quote
  #4 (permalink)  
Old 07-29-2004
Derek Robert Price
 
Posts: n/a
Default Re: DHCP question: How to specify a static route _with_ netmask?

W Cardwell wrote:
> RFC 3442 describes a classless static-routes option that encodes a prefix
> length within the 4-byte destination address. Not all clients support it and
> I haven't looked to see if Windows does, but here's a link:
> http://www.faqs.org/rfcs/rfc3442.html



Spent a lot of time researching this, so I thought I'd post an answer
despite the post's age. Hopefully Google will archive it.


Windows 2000 & XP, at least, support routes with netmasks. I'm not sure
about other clients. Instructions for configuring a Windows 2003 DHCP
Server are here:
<http://www.microsoft.com/technet/community/columns/cableguy/cg1003.mspx>.
There were several other Windows Tech Net articles I found via Google
on similar subjects as well.

The gist is, the RFC Mr. Cardwell sent above, and several others I
found, specify a DHCP code of 121 or "unassigned" for
classless-static-routes. Microsoft went with 249, maybe just to be
different or possibly to be first. Who knows.

Based on RFC 3442, RFC 2132, the code 249 from the Windows
documentation, and the "DEFINING NEW OPTIONS" section of my
"dhcp-options(5)" man page (from the ISC DHCPD 3.0p11 installation), I
added the following lines to my Linux DHCPD server's /etc/dhcpd.conf,
configuring my Linux dhcpd to send classless static routes suitable for
configuring Windows DHCP clients:

option new-static-routes code 249 = string;
option new-static-routes 18:0a:00:00:0a:02:00:01;

The first line defines a new option, "new-static-routes", sent as DHCP
code 249 (see the DHCP RFCs for an explanation of codes:
<http://www.faqs.org/rfcs/rfc2132.html>) and must be put in the global
section of the dhcpd.conf.

The second line above uses the new definition of new-static-routes and
may appear in global, subnet, or host sections of the dhcpd.conf file.
In this particular case, it defines 10.2.0.1 as the router for the
10.0.0.0/24 subnet, using a hex encoded data string based on the
specification in RFC 3442.

Unfortunately, my DHCPD does not yet support arrays of strings, so I
could only configure it to send a single subnet/router combination, but
that was all I needed. I'm not sure what happens if you specify
new-static-routes multiple times in dhcpd.conf.

In theory, if you had a client that used the RFC 3442's DHCP code of 121
for the option, you would need to define a second DHCP option and repeat
the classless static route definition line for that option number as
well for the other clients.

Cheers,

Derek
--
Derek R. Price
CVS Solutions Architect

Get CVS Support at Ximbiot <http://ximbiot.com>!
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:40 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0