-
-
Save zlinuxboy/b8d460c5f93e5236ef4ec3903ec8aeb8 to your computer and use it in GitHub Desktop.
adding custom rules on pfSense not supported by webgui
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this file as: /usr/local/pkg/CUSTOM_rules.inc | |
// pfSense will automatically add the rules defined here into the rules it loads in pf | |
require_once("util.inc"); | |
function CUSTOM_rules_generate_rules($type) { | |
// called by filter.inc when pfSense rules generation happens | |
$rules = ""; | |
switch($type) { | |
case 'nat': | |
$rules .= "# CUSTOM NAT RULES \n"; | |
$rules .= "nat on em0 inet6 proto tcp from ! (em0) to any -> 123::456\n"; | |
$rules .= "# END CUSTOM NAT RULES \n"; | |
break; | |
case 'filter': | |
$rules .= "# CUSTOM RULES \n"; | |
$rules .= "# END CUSTOM RULES \n"; | |
break; | |
} | |
return $rules; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment