Networking Forums

Networking Forums > Computer Networking > Linux Networking > DHCP question: How to specify a static route _with_ netmask?

Reply
Thread Tools Display Modes

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

 
 
Ramon F Herrera
Guest
Posts: n/a

 
      11-21-2003, 05:24 AM
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
 
 
 
 
Allen Kistler
Guest
Posts: n/a

 
      11-21-2003, 05:41 PM
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
 
W Cardwell
Guest
Posts: n/a

 
      11-26-2003, 03:27 PM
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" <(E-Mail Removed)> wrote in message
news:R%svb.3699$(E-Mail Removed) .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
 
Derek Robert Price
Guest
Posts: n/a

 
      07-29-2004, 03:04 PM
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
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the netmask in a DHCP server vv Windows Networking 2 04-21-2008 03:08 PM
How To Add A Static Route to DHCP Options Marwan Kandeel Windows Networking 0 03-29-2007 10:00 AM
Static route over DHCP problem ! Noomilop Windows Networking 0 03-02-2007 09:31 AM
route and static route to a gateway Sting Linux Networking 2 02-21-2004 03:35 AM
How can add static route in dhcp server? ben Linux Networking 0 08-29-2003 04:01 AM



1 2 3 4 5 6 7 8 9 10 11