mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Allow for tcp and udp on ports. Create a proto list in thise case.
This commit is contained in:
parent
52d62b6afd
commit
6dfd800f50
@ -409,7 +409,10 @@ function filter_generate_altq_rules() {
|
||||
$line .= $interface;
|
||||
|
||||
if (isset($rule['protocol'])) {
|
||||
$line .= "proto {$rule['protocol']} ";
|
||||
if($rule['protocol'] == "tcp/udp")
|
||||
$line .= "proto { tcp udp } ";
|
||||
else
|
||||
$line .= "proto {$rule['protocol']} ";
|
||||
} else {
|
||||
if($rule['source']['port'] <> "" || $rule['destination']['port'] <> "") {
|
||||
$line .= "proto tcp ";
|
||||
@ -746,12 +749,22 @@ function filter_nat_rules_generate() {
|
||||
$lanif = $lancfg['if'];
|
||||
|
||||
if ((!$extport[1]) || ($extport[0] == $extport[1])) {
|
||||
$natrules .=
|
||||
"rdr on $natif proto " . $rule['protocol'] . " from any to any port {$extport[0]} -> {$target} \n";
|
||||
if($rule['protocol'] == "tcp/udp")
|
||||
$natrules .=
|
||||
"rdr on $natif proto { tcp udp } from any to any port {$extport[0]} -> {$target} \n";
|
||||
else
|
||||
$natrules .=
|
||||
"rdr on $natif proto " . $rule['protocol'] . " from any to any port {$extport[0]} -> {$target} \n";
|
||||
|
||||
} else {
|
||||
$natrules .=
|
||||
"rdr on $natif proto " . $rule['protocol']. " from any to any port {$extport[0]}:{$extport[1]} " .
|
||||
"-> {$target} \n";
|
||||
if($rule['protocol'] == "tcp/udp")
|
||||
$natrules .=
|
||||
"rdr on $natif proto { tcp udp } from any to any port {$extport[0]}:{$extport[1]} " .
|
||||
"-> {$target} \n";
|
||||
else
|
||||
$natrules .=
|
||||
"rdr on $natif proto " . $rule['protocol']. " from any to any port {$extport[0]}:{$extport[1]} " .
|
||||
"-> {$target} \n";
|
||||
}
|
||||
|
||||
$natrules .= "\n";
|
||||
@ -1186,9 +1199,21 @@ EOD;
|
||||
if ($ispptp) {
|
||||
$line .= "on ng" . ($iif+1) . " ";
|
||||
}
|
||||
|
||||
//if($rule['protocol'] == "tcp/udp")
|
||||
// $line .= "proto { tcp udp } ";
|
||||
//else
|
||||
// $line .= "proto {$rule['protocol']} ";
|
||||
|
||||
if (isset($rule['protocol'])) {
|
||||
$line .= "proto {$rule['protocol']} ";
|
||||
if($rule['protocol'] == "tcp/udp")
|
||||
$line .= "proto { tcp udp } ";
|
||||
else
|
||||
$line .= "proto {$rule['protocol']} ";
|
||||
} else {
|
||||
if($rule['source']['port'] <> "" || $rule['destination']['port'] <> "") {
|
||||
$line .= "proto tcp ";
|
||||
}
|
||||
}
|
||||
|
||||
/* source address */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user