dhcp with two relay agents

fadey fadey at scancom.es
Wed Oct 29 16:25:21 UTC 2008


Thanks for your reply. I was trying to simplify my network setup and
messed it up :-)

I'm in a cable network. Behind every router I have about 3-5 different
networks. Thats why I use shared-network option:

shared-network eth1 {
  subnet that.is.on.networkcard1 {...}
  subnet router1.cable_modems {...}
  subnet router1.emtas {...}
  subnet router1.hosts1 {...}
  subnet router1.hosts2 {...}
}

shared-network eth2 {
  subnet that.is.on.networkcard2 {...}
  subnet router2.cable_modems {...}
  subnet router2.emtas {...}
  subnet router2.hosts1 {...}
  subnet router2.hosts2 {...}
  subnet router2.hosts3 {...}
}

Cable_modems and emtas subnets only accept known-hosts, defined with:
host cable_modem_001cea112cb3 {
    hardware ethernet 00:11:11:11:11:11;
}

Hosts are not. So If I dump it all into one shared-network dhcp server
will start to offer IPs of router1.hosts1 to hosts behind router2. 


> >Subject: dhcp with two relay agents
> >From: fadey <fadey at scancom.es>
> >To: dhcp-users at isc.org
> >Date: Wed, 29 Oct 2008 11:59:35 +0100
> >
> >Hi,everyone
> >
> >I guess it is a common issue, however I couldn't find any solution
> >searching this list.
> >
> >I have two networks behind two routers (please, see diagram image
> >attached). I'd like to use the same dhcp server for both of those
> >networks. Right now I've configured two separate network cards on my
> >dhcp machine and in dhcpd.conf I have two separate shared-networks for
> >each card:
> >
> >shared-network eth1 {
> >  subnet actual.subnet.behind.router1 {...}
> >  subnet that.is.on.networkcard1 {...}
> >}
> >
> >shared-network eth2 {
> >  subnet actual.subnet.behind.router2 {...}
> >  subnet that.is.on.networkcard2 {...}
> >}
> >
> >This is the only way I've managed to configure the system so that the
> >network1 IPs are server to router1's relay agent and network2 IPs are
> >served to router2's relay agent.
> >As you can see this will not scale very well since for every additional
> >router in the network I'll have to add an additional network card to
> >dhcp server (secondary IP for existing network card won't do the trick).
> >I was wondering if there is another solution for this. Such as explicit
> >matching on giaddr field...
> >Thanks in advance
> >
> Hi Fadey
> 
> Have a look at the example in the dhcpd.conf man page.
> 
> dhcpd does the matching on giaddr automatically, so you only need to
> define the subnets in dhcpd.conf, set up a relay on each subnet (could
> be the router, eg cisco ip helper command).
> 
> Be careful with shared-networks, as what you have is not a
> shared-network. A shared-network is where you have two subnets on the
> same physical part of the network. This means dhcpd can assign
> addresses from either subnet to clients and they will be valid. In your
> case 1.1.1.0/28 and 10.10.10.0/24 are not shared subnets, as there is a
> router in between them.
> 
> Your dhcpd.conf should look something like this:
> 
> subnet that.is.on.networkcard1 {...}
> subnet actual.subnet.behind.router1 {...}
> subnet actual.subnet.behind.router2 {...}
> 
> regards,
> -glenn
> 
> 
> 



More information about the dhcp-users mailing list