after reading and asking on the mailing list abut adding more options to DHCP server in m0n0wall. i managed with the help of my friend who knows php4 a little.
to add the option of subnetmask in the services_dhcp.php which is working by editing /etc/inc/services.inc and adding simple lines for testing.
$dhcpdifs = array();
foreach ($dhcpdcfg as $dhcpif => $dhcpifconf) {
$ifcfg = $config['interfaces'][$dhcpif];
if (!isset($dhcpifconf['enable']) ||
(($dhcpif != "lan") &&
(!isset($ifcfg['enable']) || !$ifcfg['if'] || $ifcfg['bridge'])))
continue;
$subnet = gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);
$subnetmask = gen_subnet_mask($ifcfg['subnet']);
$dnscfg = "";
if ($dhcpifconf['domain']) {
$dnscfg .= " option domain-name \"{$dhcpifconf['domain']}\";\n";
}
if (is_array($dhcpifconf['dnsserver']) && ($dhcpifconf['dnsserver'][0])) {
$dnscfg .= " option domain-name-servers " . join(",", $dhcpifconf['dnsserver']) . ";";
} else if (isset($config['dnsmasq']['enable'])) {
$dnscfg .= " option domain-name-servers " . $ifcfg['ipaddr'] . ";";
} else if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
$dnscfg .= " option domain-name-servers " . join(",", $syscfg['dnsserver']) . ";";
}
$dhcpdconf .= "subnet $subnet netmask $subnetmask {\n";
$dhcpdconf .= " pool {\n";
if (isset($dhcpifconf['denyunknown']))
$dhcpdconf .= " deny unknown clients;\n";
if ($dhcpifconf['gateway']){
$routers = $dhcpifconf['gateway'];
$subnetm = $dhcpifconf['subnetmask'];
}
else{
$routers = $ifcfg['ipaddr'];
$subnetm = gen_subnet_mask($ifcfg['subnet']);
}
$dhcpdconf .= <<<EOD
range {$dhcpifconf['range']['from']} {$dhcpifconf['range']['to']};
}
option routers {$routers};
option subnet-mask {$subnetm};
$dnscfg
and it worked fine, after editing services_dhcp.php which is attached.
this option i managed to put it inside m0n0wall using workon.sh
i hope m0n0wall developers write this in the right way to have this option in m0n0wall.
Regards.
Mohammed