Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dhcpd.conf - multiple routers

2,728 views
Skip to first unread message

Dan Johnson

unread,
Jul 22, 2004, 7:08:06 PM7/22/04
to
Hello!

How do you setup dhcpd to assign multiple routers/gateways to clients?
The "option routers" makes me think you should be able to do this.
I've tried "option routers 192.168.0.50, 192.168.0.51, 192.168.0.52;"
but the client only gets the first router. The client gets the
multiple dns servers with "option domain-name-servers 192.168.0.10,
192.168.0.11, 192.168.0.12;" I've looked through a lot of documents on
dhcpd.conf, but I haven't had any luck yet.

Can anyone help me?? Thanks!

Claire McIvor

unread,
Jul 22, 2004, 8:47:34 PM7/22/04
to

Generally a machine will pick up the DCHP server on its own subnet to the
exclusion of all others.

If you need to access other subnets, you need to set up routes to those
subnets from your own in the routing table and you will then be able to
gain access to those subnets. If a computer was able to obtain IP
addresses simultaneously from different network segments the system would
be completely confused.

Thisnk of a postman trying to deliver a letter which has three house
addresess written on it and all for the same street. Which letter box
should he drop the letter through. At best he can only be correct in
33.33% of cases. Do you really want someone else to receive your files and
email or have yours arrive with the wrong person>

Hope this helps.

Claire

Jim Hicks

unread,
Jul 22, 2004, 9:14:01 PM7/22/04
to
DHCP uses bootp protocol which only traverses a router with proper
configuration. Most major router vendors have configurations for this.
Configuring through routers to systems complicates the actual assignment
of addresses as the dhcp server needs to know what network segment a
requesting system resides on to assign the proper address and default route.
This is not trivial. The dhcp server configuration needs to support
multiple networks.
A google search of configure multiple networks dhcp yielded many
informative results.

Bernhard Kastner

unread,
Jul 23, 2004, 3:23:45 AM7/23/04
to
Dan Johnson wrote:

you can't have more than one default-router.
with that option routers-option, you set the default-gateway for the
machine, but every machine can only have _one_ *default*-gateway.
i think what you need, are several gateways for several subnets which
are accessed via the three gateways.
as I know, there's no possibility to edit the routing-tables for a
machine via DHCP. to reach the subnets, you have to edit the
routing-tables for each client-machine, and you have to do this either
manually or via a script. but don't ask me about this script ^^

--
---
http://www.alf.at.tc
Austrian Linux Forum

Juha Laiho

unread,
Jul 23, 2004, 5:22:03 AM7/23/04
to
qulix...@hotmail.com (Dan Johnson) said:
>How do you setup dhcpd to assign multiple routers/gateways to clients?
>The "option routers" makes me think you should be able to do this.
>I've tried "option routers 192.168.0.50, 192.168.0.51, 192.168.0.52;"
>but the client only gets the first router.

"option routers" is just for specifying the default route -- and these
you can only have one on a given system. I think that the clients will
try to connect to each router listed by #option routers" list, and end
up using the first one to respond.

Are these three addresses really redundant (all giving same/similar
routing in some kind of load-balancing/failover configuration), or
are they routers for some specific subnets?

If the latter, then I guess you'll need to use "option static-routes"
to tell the clients about the routers used for specific networks. However,
pay attention to the warning in dhcp-options manual page about the use
of static-routes option.

>The client gets the multiple dns servers with "option
>domain-name-servers 192.168.0.10, 192.168.0.11, 192.168.0.12;" I've
>looked through a lot of documents on dhcpd.conf, but I haven't had any
>luck yet.

Yes, DNS configuration makes it easy to store addresses for several
resolvers working in parallel; for routing no such storage is available.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)

Bernhard Kastner

unread,
Jul 23, 2004, 6:40:04 AM7/23/04
to
have to correct myself: with the option "option static routers" it IS
possible to edit the routing-table by DHCP ;)
thx 2 juha laiho

Dan Johnson

unread,
Jul 23, 2004, 9:02:23 AM7/23/04
to
Thanks for the replies!

Ok, let me define my situation a little better.

I have three linux masq boxes (192.168.0.50, 192.168.0.51,
192.168.0.52). Each connected to the internet. I want to have
redundant masq boxes. If one fails, one of the other boxes is used.
From what I understand, you can only use one gateway at a time, and
that's fine with me.

I've set this up manually on my xp workstation. I set 192.168.0.50 as
my primary gateway and 192.168.0.51 as my secondary. Then I
disconnected 192.168.0.50 and my workstation timed-out the primary
(192.168.0.50) and used the secondary (192.168.0.51). That's exactly
what I want it to do. I just need dhcp to assign what I did manually,
automatically. The fact that the option is called "routers" makes me
think you should be able to assign multiple routerS.

Thanks again!

Juha Laiho

unread,
Jul 23, 2004, 2:22:03 PM7/23/04
to
qulix...@hotmail.com (Dan Johnson) said:
>I have three linux masq boxes (192.168.0.50, 192.168.0.51,
>192.168.0.52). Each connected to the internet. I want to have
>redundant masq boxes. If one fails, one of the other boxes is used.

Could be easier to set up the system so that there's some kind of
heartbeat across the masq boxes, so that all the machines know
each others' state. Then, if the primary fails, there'll be some kind
of competition among the secondaries to determine which one will
take up the router IP address. It should even be possible to switch
over the router MAC address to one of the secondaries -- you'll just
have to check how your switches react to that.

Look for failover clustering and you should find a solution.

0 new messages