Diferent dhcp relay

André netriver at gmail.com
Tue Oct 11 16:50:48 UTC 2011


In reply to
*jeffrey j donovan* donovan at beth.k12.pa.us
<dhcp-users%40lists.isc.org?Subject=Re%3A%20Diferent%20dhcp%20relay&In-Reply-To=%3C0383CF61-0699-42F5-A715-52DA844E9182%40beth.k12.pa.us%3E>
*Tue Oct 11 15:12:20 UTC 2011

*>
> Hello,
>
> I'm running a dhcp server and recently I needed to add a second relay that
will connect to this server.
  >> When you talk about relays,.. are you talking about UDP helper relays ?
Yes

>> [ dhcpd ]--A.x.x.x/24---[ relay1 ]---B.x.x.x/24 --{ client }
>>             |--A.x.x.x/24---[ relay 2]---C.x.x.x/24 --{ client }
>>
>> does your setup look similar to this ^ ?
Yes, my setup is like that.

>
> My relays are on the networks
> 10.1
> and 10.2
>
> This is a cable network so cm's will be served from 10.1 and 10.2
> Due to equipment restrictions I require to use the dhcp giaddr of 10.1.x.1
and 10.2.x.2 for all the hosts
> requesting a IP address.


>> are these two subnets on the same physical broadcast zone ? or are the on
separate VLANS ?
Same physical broadcast zone no vlans.


>
> To solve this I created to shared networks
> The cpe hosts in share net 1 work well no issues the cm's get online ok
>
> My problem is in the new equipment in share net 2 cm's get online well,
> cpe's don't they allways get
> DHCPDISCOVER from 00:14:2a:xc:xx:xc via x.x.x.x: unknown client
>
> My only way to distinct the hosts at this moment is
> CM's have docsis vendor class and have a host { } declaration
>
> CPE's use de remote-id that's obtained from the relay
>
> I'm missing something in the config for the second shared-network or
something is wrong
>
> Any sugestions ?
>
> Best regards,
> FR
>

greetings
post your dhcpd.conf file

<Dhcpd.conf>

ddns-update-style none;
default-lease-time 1800;
max-lease-time 7200;
authoritative;
log-facility local7;
allow leasequery;
ddns-updates off;
deny duplicates;
deny declines;
deny client-updates;
one-lease-per-client off;
update-static-leases on;
stash-agent-options true;

class "online" {
    match option agent.remote-id;
}

include "/etc/dhcp3/online.conf";
include "/etc/dhcp3/hostscm.conf";
include "/etc/dhcp3/static.conf";

class "CM" {
  # only match if first 6 chars of option 61 are docsis
  match if (substring(option vendor-class-identifier,0,6) = "docsis");
  spawn with hardware;
}

class "MTA" {
match if (substring(option vendor-class-identifier,0,4) = "pktc");
spawn with hardware;
}

class "Client" {
match if ((substring(option vendor-class-identifier,0,6) != "docsis") and
(substring(option vendor-class-identifier,0,4) != "pktc"));
spawn with hardware;
}

class "c3" {
match if binary-to-ascii(10, 16, "", substring( option agent.circuit-id,2
,2)) = "99";
spawn with hardware;
}

if known {
    log (info, concat ("HOSTNAME: ", host-decl-name, " on ",binary-to-ascii
(10, 8, ".", leased-address)," at ", binary-to-ascii (16, 8, ":", substring
(hardware, 1, 6))));
}

on commit {
        set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
        set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1,
6));
        #set ClientRemoteId = binary-to-ascii(16, 8, ":", substring( option
agent.remote-id, 2, 12));
        set ClientRemoteId = binary-to-ascii(16, 8, ":", option
agent.remote-id);
        set Via = binary-to-ascii(10, 16, "", substring( option
agent.circuit-id,2 ,2));
        log(concat("Commit: IP: ", ClientIP, " Mac: ", ClientMac," RemoteID:
",
        ClientRemoteId, " Via:", Via
        ));
        execute("/etc/dhcp3/record.pl", "commit", ClientIP, ClientMac,
ClientRemoteId);
}

shared-network share1
{
        option domain-name "cpe.domain";
  option ntp-servers x.x.34.20, x.x.34.10;
        option domain-name-servers x.x.34.10;
        option time-servers x.x.34.20;
        default-lease-time 1800;
  max-lease-time 1800;
        option time-offset 0;

        subnet x.x.35.0 netmask 255.255.255.0 {
                allow unknown-clients;
                option routers x.x.35.1;
                pool {

        allow members of "online";
        deny members of "CM";

                        range x.x.35.2 x.x.35.26;
                        range x.x.35.28 x.x.35.254;

                }
        }

        subnet 10.1.0.0 netmask 255.255.0.0 {
                allow bootp;
                deny unknown-clients;
                default-lease-time 14400;
                max-lease-time 14400;
                option domain-name-servers x.x.34.20;
                option ntp-servers x.x.34.20;
                option time-servers x.x.34.20;
                option domain-name "cuda.cm.domain";
                option time-offset 0;

                option subnet-mask 255.255.0.0;
                option broadcast-address 10.1.255.255;
                option routers 10.1.0.1;
                option log-servers x.x.34.20;
                option tftp-server-name "x.x.34.20";
                next-server x.x.34.20;
        }

        subnet x.x.34.0 netmask 255.255.255.192 {
        # CORE NETWORK DONT TOUCH
        }

        subnet 192.168.0.0 netmask 255.255.0.0 {
        # CORE MANAGEMENT DONT TOUCH
        }

}

shared-network share-c3
{
    option domain-name "c3.cpe.domain";
    option ntp-servers x.x.34.20, x.x.34.10;
    option domain-name-servers x.x.34.20, x.x.34.10;
    option time-servers x.x.34.20;
    default-lease-time 800;
    max-lease-time 800;
    option time-offset 0;

    subnet x.x.48.0 netmask 255.255.255.0 {
        default-lease-time 800;
        max-lease-time 800;
        allow unknown-clients;
        option routers x.x.48.1;
        pool {
            allow members of "online";
            range x.x.48.2 x.x.48.200;
            range x.x.48.201 x.x.48.254;
        }
    }

    subnet 10.2.0.0 netmask 255.255.0.0 {
        deny unknown-clients;
        allow bootp;
        default-lease-time 14400;
        max-lease-time 14400;
        option domain-name-servers 192.168.0.30;
        option domain-name "c3.cm.domain";
        option time-offset 0;
        option ntp-servers 192.168.0.30;
        option time-servers 192.168.0.30;
        option subnet-mask 255.255.0.0;
        option broadcast-address 10.2.255.255;
        option routers 10.2.0.1;
        option log-servers 192.168.0.30;
        option tftp-server-name "192.168.0.30";
        next-server 192.168.0.30;

        pool {
            allow members of "online";
            range 10.2.0.2 10.2.254.253;
        }
    }
}


I removed comments for better readability.
Also If I place the network x.x.48.x inside share1 I get ip's delivered to
it from network for example x.x.35.x
regardless of setting the
dhcp-giaddr to policy ; # making the relay agent use the gateway of x.x.48.1
instead of 10.2.0.1
in the first equipment it looks like I can't specify the use of the normal
network IP

I tryed using circuit-id of the equipments to try to deny them from being
delivered from some subnets of share1.

Thank you for any help.

Best regards,
FR

On Tue, Oct 11, 2011 at 3:54 PM, André <netriver at gmail.com> wrote:

>
> Hello,
>
> I'm running a dhcp server and recently I needed to add a second relay that
> will connect to this server.
>
> My relays are on the networks
> 10.1
> and 10.2
>
> This is a cable network so cm's will be served from 10.1 and 10.2
> Due to equipment restrictions I require to use the dhcp giaddr of 10.1.x.1
> and 10.2.x.2 for all the hosts
> requesting a IP address.
>
> To solve this I created to shared networks
> The cpe hosts in share net 1 work well no issues the cm's get online ok
>
> My problem is in the new equipment in share net 2 cm's get online well,
> cpe's don't they allways get
> DHCPDISCOVER from 00:14:2a:xc:xx:xc via x.x.x.x: unknown client
>
> My only way to distinct the hosts at this moment is
> CM's have docsis vendor class and have a host { } declaration
>
> CPE's use de remote-id that's obtained from the relay
>
> I'm missing something in the config for the second shared-network or
> something is wrong
>
> Any sugestions ?
>
> Best regards,
> FR
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20111011/c0c40ab9/attachment.html>


More information about the dhcp-users mailing list