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
17c0885c
Commit
17c0885c
authored
Dec 09, 2014
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
etc: move bogons*
parent
36f79213
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
16 deletions
+11
-16
bogons
usr/local/etc/bogons
+0
-0
bogonsv6
usr/local/etc/bogonsv6
+0
-0
filter.inc
usr/local/etc/inc/filter.inc
+6
-6
rc.update_bogons.sh
usr/local/etc/rc.update_bogons.sh
+5
-10
No files found.
etc/bogons
→
usr/local/
etc/bogons
View file @
17c0885c
File moved
etc/bogonsv6
→
usr/local/
etc/bogonsv6
View file @
17c0885c
File moved
usr/local/etc/inc/filter.inc
View file @
17c0885c
...
...
@@ -589,13 +589,13 @@ function filter_generate_aliases() {
$aliases
.=
"#Snort tables
\n
"
;
$aliases
.=
"table <snort2c>
\n
"
;
$aliases
.=
"table <virusprot>
\n
"
;
if
(
!
file_exists
(
"/etc/bogons"
))
@
file_put_contents
(
"/etc/bogons"
,
""
);
if
(
!
file_exists
(
"/etc/bogonsv6"
))
@
file_put_contents
(
"/etc/bogonsv6"
,
""
);
$aliases
.=
"table <bogons> persist file
\"
/etc/bogons
\"\n
"
;
if
(
!
file_exists
(
"/
usr/local/
etc/bogons"
))
@
file_put_contents
(
"/
usr/local/
etc/bogons"
,
""
);
if
(
!
file_exists
(
"/
usr/local/
etc/bogonsv6"
))
@
file_put_contents
(
"/
usr/local/
etc/bogonsv6"
,
""
);
$aliases
.=
"table <bogons> persist file
\"
/
usr/local/
etc/bogons
\"\n
"
;
if
(
is_bogonsv6_used
())
$aliases
.=
"table <bogonsv6> persist file
\"
/etc/bogonsv6
\"\n
"
;
$aliases
.=
"table <bogonsv6> persist file
\"
/
usr/local/
etc/bogonsv6
\"\n
"
;
$vpns_list
=
filter_get_vpns_list
();
if
(
$vpns_list
)
...
...
usr/local/etc/rc.update_bogons.sh
View file @
17c0885c
...
...
@@ -69,11 +69,6 @@ fi
echo
"rc.update_bogons.sh is beginning the update cycle."
| logger
# Load custom bogon configuration
if
[
-f
/var/etc/bogon_custom
]
;
then
.
/var/etc/bogon_custom
fi
# Set default values if not overriden
v4url
=
${
v4url
:-
"https://files.pfsense.org/lists/fullbogons-ipv4.txt"
}
v6url
=
${
v6url
:-
"https://files.pfsense.org/lists/fullbogons-ipv6.txt"
}
...
...
@@ -105,8 +100,8 @@ if [ "$BOGON_V4_CKSUM" = "$ON_DISK_V4_CKSUM" ] || [ "$BOGON_V6_CKSUM" = "$ON_DIS
ENTRIES_V4
=
`
pfctl
-vvsTables
|
awk
'/-\tbogons$/ {getline; print $2}'
`
LINES_V4
=
`
wc
-l
/tmp/bogons |
awk
'{ print $1 }'
`
if
[
$ENTRIES_MAX
-gt
$((
2
*
ENTRIES_TOT-
${
ENTRIES_V4
:-
0
}
+
LINES_V4
))
]
;
then
egrep
-v
"^192.168.0.0/16|^172.16.0.0/12|^10.0.0.0/8"
/tmp/bogons
>
/etc/bogons
RESULT
=
`
/sbin/pfctl
-t
bogons
-T
replace
-f
/etc/bogons 2>&1
`
egrep
-v
"^192.168.0.0/16|^172.16.0.0/12|^10.0.0.0/8"
/tmp/bogons
>
/
usr/local/
etc/bogons
RESULT
=
`
/sbin/pfctl
-t
bogons
-T
replace
-f
/
usr/local/
etc/bogons 2>&1
`
echo
"
$RESULT
"
|
awk
'{ print "Bogons V4 file downloaded: " $0 }'
| logger
else
echo
"Not updating IPv4 bogons (increase table-entries limit)"
| logger
...
...
@@ -124,15 +119,15 @@ if [ "$BOGON_V4_CKSUM" = "$ON_DISK_V4_CKSUM" ] || [ "$BOGON_V6_CKSUM" = "$ON_DIS
if
[
$BOGONS_V6_TABLE_COUNT
-gt
0
]
;
then
ENTRIES_V6
=
`
pfctl
-vvsTables
|
awk
'/-\tbogonsv6$/ {getline; print $2}'
`
if
[
$ENTRIES_MAX
-gt
$((
2
*
ENTRIES_TOT-
${
ENTRIES_V6
:-
0
}
+
LINES_V6
))
]
;
then
egrep
-iv
"^fc00::/7"
/tmp/bogonsv6
>
/etc/bogonsv6
RESULT
=
`
/sbin/pfctl
-t
bogonsv6
-T
replace
-f
/etc/bogonsv6 2>&1
`
egrep
-iv
"^fc00::/7"
/tmp/bogonsv6
>
/
usr/local/
etc/bogonsv6
RESULT
=
`
/sbin/pfctl
-t
bogonsv6
-T
replace
-f
/
usr/local/
etc/bogonsv6 2>&1
`
echo
"
$RESULT
"
|
awk
'{ print "Bogons V6 file downloaded: " $0 }'
| logger
else
echo
"Not saving or updating IPv6 bogons (increase table-entries limit)"
| logger
fi
else
if
[
$ENTRIES_MAX
-gt
$((
2
*
ENTRIES_TOT+LINES_V6
))
]
;
then
egrep
-iv
"^fc00::/7"
/tmp/bogonsv6
>
/etc/bogonsv6
egrep
-iv
"^fc00::/7"
/tmp/bogonsv6
>
/
usr/local/
etc/bogonsv6
echo
"Bogons V6 file downloaded but not updating IPv6 bogons table because IPv6 Allow is off"
| logger
else
echo
"Not saving IPv6 bogons table (IPv6 Allow is off and table-entries limit is potentially too low)"
| logger
...
...
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