Created
December 29, 2016 00:54
-
-
Save PiBa-NL/7bc8cfb94556f0532c6e063cb5dab09c 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
hello,
It's awesome! I really need this code.
I would like to install tinc package on pfsense, but the default webUI configuration does not satify my need, I have to hack to add some custom rules. and I found your code.
two questions: