Match based on Ralay Agent IP

Simon Hobson dhcp1 at thehobsons.co.uk
Fri May 7 12:21:09 UTC 2010


Pawel Warowny wrote:

>Is there any possibility to match dhcp discover packets based on Relay
>Agent IP in dhcpd.conf file?
>
>I need something like this:
>
>class "relayagent-1" {
>     match if <some relay agent ip matching> = "10.0.1.1";
>}
>class "relayagent-2" {
>     match if <some relay agent ip matching> = "10.0.2.1";
>}
>
>subnet 192.168.100.0 netmask 255.255.255.0 {
>     pool {
>         range 192.168.100.2 192.168.100.254;
>         allow members of "relayagent-1";
>     }
>}
>
>subnet 192.168.200.0 netmask 255.255.255.0 {
>     pool {
>         range 192.168.200.2 192.168.200.254;
>         allow members of "relayagent-2";
>     }
>}

You mean, clients in the 192.168.100.0 subnet should automatically 
get addresses in that subnet, and similarly with clients in the 
192.168.200.0 subnet ? You don't do anything at all - just define the 
subnets and the DHCP server will take care of it autopmagically. SO 
all you need is :


subnet 192.168.100.0 netmask 255.255.255.0 {
     option routers ....
     pool {
         range 192.168.100.2 192.168.100.254;
     }
}

subnet 192.168.200.0 netmask 255.255.255.0 {
     option routers ....
     pool {
         range 192.168.200.2 192.168.200.254;
     }
}

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the dhcp-users mailing list