Feature #3541
closedAdd "Stateless DHCP" to Router Advertisements
100%
Description
Hi,
I just wanted to add Stateless DHCP as an option to the drop down list of Router Advertisement modes. Its a fairy simple addition as I have documented in this video http://youtu.be/4eVx5y5EO7o
I'll also copy and paste the changes I have described in the pfSense forum post https://forum.pfsense.org/index.php?topic=73760.15
Files that need to be modified.
1. /usr/local/www/services_router_advertisements.php
2. /etc/inc/services.inc
First we modify the services_router_advertisements.php to add the "Stateless DHCP" option to the drop down box. Super easy:-
CHANGE
$advertise_modes = array("disabled" => "Disabled",
"router" => "Router Only",
"unmanaged" => "Unmanaged",
"managed" => "Managed",
"assist" => "Assisted");
TO
$advertise_modes = array("disabled" => "Disabled",
"router" => "Router Only",
"unmanaged" => "Unmanaged",
"managed" => "Managed",
"assist" => "Assisted",
"stateless_dhcp" => "Stateless DHCP");
Save and Exit. Then modify the file, services.inc. Change is at TWO places:-
CHANGE-ONE
CHANGE FROM
switch($dhcpv6ifconf['ramode']) {
case "managed":
case "assist":
$radvdconf .= "\tAdvManagedFlag on;\n";
$radvdconf .= "\tAdvOtherConfigFlag on;\n";
break;
}
TO
switch($dhcpv6ifconf['ramode']) {
case "managed":
case "assist":
$radvdconf .= "\tAdvManagedFlag on;\n";
$radvdconf .= "\tAdvOtherConfigFlag on;\n";
break;
case "stateless_dhcp":
$radvdconf .= "\tAdvManagedFlag off;\n";
$radvdconf .= "\tAdvOtherConfigFlag on;\n";
break;
}
CHANGE-TWO
CHANGE FROM
switch($dhcpv6ifconf['ramode']) {
case "managed":
$radvdconf .= "\t\tAdvOnLink on;\n";
$radvdconf .= "\t\tAdvAutonomous off;\n";
$radvdconf .= "\t\tAdvRouterAddr on;\n";
break;
case "router":
$radvdconf .= "\t\tAdvOnLink off;\n";
$radvdconf .= "\t\tAdvAutonomous off;\n";
$radvdconf .= "\t\tAdvRouterAddr on;\n";
break;
case "assist":
$radvdconf .= "\t\tAdvOnLink on;\n";
$radvdconf .= "\t\tAdvAutonomous on;\n";
$radvdconf .= "\t\tAdvRouterAddr on;\n";
break;
case "unmanaged":
$radvdconf .= "\t\tAdvOnLink on;\n";
$radvdconf .= "\t\tAdvAutonomous on;\n";
$radvdconf .= "\t\tAdvRouterAddr on;\n";
break;
}
TO
switch($dhcpv6ifconf['ramode']) {
case "managed":
$radvdconf .= "\t\tAdvOnLink on;\n";
$radvdconf .= "\t\tAdvAutonomous off;\n";
$radvdconf .= "\t\tAdvRouterAddr on;\n";
break;
case "router":
$radvdconf .= "\t\tAdvOnLink off;\n";
$radvdconf .= "\t\tAdvAutonomous off;\n";
$radvdconf .= "\t\tAdvRouterAddr on;\n";
break;
case "stateless_dhcp":
case "assist":
$radvdconf .= "\t\tAdvOnLink on;\n";
$radvdconf .= "\t\tAdvAutonomous on;\n";
$radvdconf .= "\t\tAdvRouterAddr on;\n";
break;
case "unmanaged":
$radvdconf .= "\t\tAdvOnLink on;\n";
$radvdconf .= "\t\tAdvAutonomous on;\n";
$radvdconf .= "\t\tAdvRouterAddr on;\n";
break;
}
For CHANGE-TWO all we do is add the line
case "stateless_dhcp":
above
case "assist":
Save and exit
That's it. Hope you guys can add this to pfSense!
Updated by Aqueeb Qadri over 11 years ago
Please delete this request. I have figured out how to use Github pull request and submitted a pull request to have my changes added to the codebase.
Sorry for my ignorance.
Kind regards,
Aqueeb.