Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
d64260cb
Commit
d64260cb
authored
Jun 01, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(trafficshaper) move enabled option to pipe/queue tag
parent
44f70602
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
11 deletions
+43
-11
dialogPipe.xml
...p/controllers/OPNsense/TrafficShaper/forms/dialogPipe.xml
+6
-0
dialogQueue.xml
.../controllers/OPNsense/TrafficShaper/forms/dialogQueue.xml
+6
-0
TrafficShaper.xml
...e/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml
+8
-4
ipfw.conf
src/opnsense/service/templates/OPNsense/IPFW/ipfw.conf
+11
-6
rc.conf.d
src/opnsense/service/templates/OPNsense/IPFW/rc.conf.d
+12
-1
No files found.
src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/forms/dialogPipe.xml
View file @
d64260cb
<form>
<field>
<id>
pipe.enabled
</id>
<label>
enabled
</label>
<type>
checkbox
</type>
<help>
enable this pipe and it's related queues and rules
</help>
</field>
<field>
<id>
pipe.bandwidth
</id>
<label>
bandwidth
</label>
...
...
src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/forms/dialogQueue.xml
View file @
d64260cb
<form>
<field>
<id>
pipe.enabled
</id>
<label>
enabled
</label>
<type>
checkbox
</type>
<help>
enable this queue and it's related rules
</help>
</field>
<field>
<id>
queue.pipe
</id>
<label>
pipe
</label>
...
...
src/opnsense/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml
View file @
d64260cb
...
...
@@ -4,10 +4,6 @@
OPNsense traffic shaper
</description>
<items>
<enabled
type=
"BooleanField"
>
<default>
0
</default>
<Required>
Y
</Required>
</enabled>
<pipes>
<pipe
type=
"ArrayField"
>
<number
type=
"IntegerField"
>
...
...
@@ -16,6 +12,10 @@
<ValidationMessage>
Pipe number must be between 1...65535
</ValidationMessage>
<Required>
Y
</Required>
</number>
<enabled
type=
"BooleanField"
>
<default>
1
</default>
<Required>
Y
</Required>
</enabled>
<bandwidth
type=
"IntegerField"
>
<Required>
Y
</Required>
<MinimumValue>
1
</MinimumValue>
...
...
@@ -67,6 +67,10 @@
<ValidationMessage>
Queue number must be between 1...65535
</ValidationMessage>
<Required>
Y
</Required>
</number>
<enabled
type=
"BooleanField"
>
<default>
1
</default>
<Required>
Y
</Required>
</enabled>
<pipe
type=
"ModelRelationField"
>
<Model>
<pipes>
...
...
src/opnsense/service/templates/OPNsense/IPFW/ipfw.conf
View file @
d64260cb
...
...
@@ -70,11 +70,11 @@ add 150 deny layer2 not mac-type ip,ipv6
#======================================================================================
{%
for
intf_key
,
interface
in
interfaces
.
iteritems
() %}
{%
if
intf_key
!=
"wan"
and
interface
.
ipaddr
!=
"dhcp"
and
interface
.
ipaddr
!=
""
%}
add
{{
loop
.
index
+
1000
}}
allow
udp
from
any
to
{{
interface
.
ipaddr
}}
dst
-
port
53
keep
-
state
add
{{
loop
.
index
+
1000
}}
allow
ip
from
any
to
{
255
.
255
.
255
.
255
or
{{
interface
.
ipaddr
}} }
in
add
{{
loop
.
index
+
1000
}}
allow
ip
from
{
255
.
255
.
255
.
255
or
{{
interface
.
ipaddr
}} }
to
any
out
add
{{
loop
.
index
+
1000
}}
allow
icmp
from
{
255
.
255
.
255
.
255
or
{{
interface
.
ipaddr
}} }
to
any
out
icmptypes
0
add
{{
loop
.
index
+
1000
}}
allow
icmp
from
any
to
{
255
.
255
.
255
.
255
or
{{
interface
.
ipaddr
}} }
in
icmptypes
8
add
{{
loop
.
index
+
1000
}}
skipto
60000
udp
from
any
to
{{
interface
.
ipaddr
}}
dst
-
port
53
keep
-
state
add
{{
loop
.
index
+
1000
}}
skipto
60000
ip
from
any
to
{
255
.
255
.
255
.
255
or
{{
interface
.
ipaddr
}} }
in
add
{{
loop
.
index
+
1000
}}
skipto
60000
ip
from
{
255
.
255
.
255
.
255
or
{{
interface
.
ipaddr
}} }
to
any
out
add
{{
loop
.
index
+
1000
}}
skipto
60000
icmp
from
{
255
.
255
.
255
.
255
or
{{
interface
.
ipaddr
}} }
to
any
out
icmptypes
0
add
{{
loop
.
index
+
1000
}}
skipto
60000
icmp
from
any
to
{
255
.
255
.
255
.
255
or
{{
interface
.
ipaddr
}} }
in
icmptypes
8
{%
endif
%}
{%
endfor
%}
...
...
@@ -141,17 +141,22 @@ add 60000 return via any
{%
for
rule
in
helpers
.
toList
(
'OPNsense.TrafficShaper.rules.rule'
,
'sequence'
) %}
{%
if
helpers
.
getUUIDtag
(
rule
.
target
)
in
[
'pipe'
,
'queue'
] %}
{%
if
helpers
.
getNodeByTag
(
'interfaces.'
+
rule
.
interface
) %}
{%
if
helpers
.
getUUID
(
rule
.
target
).
enabled
|
default
(
'0'
) ==
'1'
%}
{%
if
helpers
.
getUUIDtag
(
rule
.
target
) ==
'pipe'
or
helpers
.
getUUID
(
helpers
.
getUUID
(
rule
.
target
).
pipe
).
enabled
|
default
(
'0'
) ==
'1'
%}
add
{{
loop
.
index
+
60000
}} {{
helpers
.
getUUIDtag
(
rule
.
target
) }} {{
helpers
.
getUUID
(
rule
.
target
).
number
}} {{
rule
.
proto
}}
from
{{
rule
.
source
}}
to
{{
rule
.
destination
}}
src
-
port
{{
rule
.
src_port
}}
dst
-
port
{{
rule
.
dst_port
}} {{
rule
.
direction
}}
via
{{
helpers
.
getNodeByTag
(
'interfaces.'
+
rule
.
interface
).
if
}}
{%
endif
%}
{%
endif
%}
{%
endif
%}
{%
endif
%}
{%
endfor
%}
{%
endif
%}
# pass authorized
add
65533
pass
ip
from
any
to
any
...
...
src/opnsense/service/templates/OPNsense/IPFW/rc.conf.d
View file @
d64260cb
...
...
@@ -6,6 +6,17 @@
{%
endif
%}
{%
endfor
%}
{%
endif
%}
firewall_enable
=
"{% if OPNsense.TrafficShaper.enabled|default("
0
") == "
1
" or cp_zones %}YES{% else %}NO{% endif %}"
{
#
collect
enabled
#
}
{%
set
shapers
=
[]
%}
{%
if
helpers
.
exists
(
'
OPNsense
.
TrafficShaper
'
)
%}
{%
if
helpers
.
exists
(
'
OPNsense
.
TrafficShaper
.
pipes
.
pipe
'
)
%}
{%
for
pipe
in
helpers
.
toList
(
'
OPNsense
.
TrafficShaper
.
pipes
.
pipe
'
)
%}
{%
if
pipe
.
enabled
|
default
(
'0'
)
==
'1'
%}
{%
do
shapers
.
append
(
cp_key
)
%}
{%
endif
%}
{%
endfor
%}
{%
endif
%}
{%
endif
%}
firewall_enable
=
"{% if shapers or cp_zones %}YES{% else %}NO{% endif %}"
firewall_script
=
"/usr/local/etc/rc.ipfw"
dummynet_enable
=
"YES"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment