The solution to my problem was quite simple, and I further complicated it by thinking more about it.
While configuring the ISC DHCP server on Linux, you can create classes for each subnet in the DHCP pool. Each class would match the 'giaddr' field in the DHCP requests and this would be the IP address of the DHCP relay agent. Within the subnet definition, match the appropriate class.
Below is the sample configuration.
subnet 10.0.0.0 netmask 255.255.255.0 { }
class "VLAN1" {
match if (binary-to-ascii(10,8, ".", packet(24,4)) ="10.0.1.1");
}
class "VLAN2" {
match if (binary-to-ascii(10,8, ".", packet(24,4)) ="10.0.2.1");
}
class "VLAN3" {
match if (binary-to-ascii(10,8, ".", packet(24,4)) ="10.0.3.1");
}
subnet 10.0.1.0 netmask 255.255.255.0 {
pool {
allow members of "VLAN1";
default-lease-time 86400;
max-lease-time 7200;
range 10.0.1.10 10.0.1.254;
option routers 10.0.1.1;
option broadcast-address 10.0.1.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 4.2.2.2;
}
}
subnet 10.0.2.0 netmask 255.255.255.0 {
pool {
allow members of "VLAN2";
default-lease-time 86400;
max-lease-time 7200;
range 10.0.2.10 10.0.2.254;
option routers 10.0.2.1;
option broadcast-address 10.0.2.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 4.2.2.2;
}
}
subnet 10.0.3.0 netmask 255.255.255.0 {
pool {
allow members of "VLAN3";
default-lease-time 86400;
max-lease-time 7200;
range 10.0.3.10 10.0.3.254;
option routers 10.0.3.1;
option broadcast-address 10.0.3.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 4.2.2.2;
}
}