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
bdfbe06f
Commit
bdfbe06f
authored
Jul 09, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) cleanups system.inc
parent
207b3f70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
system.inc
src/etc/inc/system.inc
+13
-14
system_advanced_network.php
src/www/system_advanced_network.php
+9
-0
No files found.
src/etc/inc/system.inc
View file @
bdfbe06f
...
...
@@ -258,7 +258,7 @@ function system_hosts_generate()
$lhosts
=
""
;
$dhosts
=
""
;
if
(
$config
[
'interfaces'
][
'lan'
]
)
{
if
(
isset
(
$config
[
'interfaces'
][
'lan'
])
)
{
$cfgip
=
get_interface_ip
(
"lan"
);
if
(
is_ipaddr
(
$cfgip
))
$hosts
.=
"
{
$cfgip
}
{
$syscfg
[
'hostname'
]
}
.
{
$syscfg
[
'domain'
]
}
{
$syscfg
[
'hostname'
]
}
\n
"
;
...
...
@@ -445,13 +445,13 @@ function system_routing_configure($interface = '')
break
;
}
}
if
(
$foundgw
==
false
)
{
if
(
!
$foundgw
)
{
$defaultif
=
get_real_interface
(
"wan"
);
$interfacegw
=
"wan"
;
$gatewayip
=
get_interface_gateway
(
"wan"
);
@
touch
(
"/tmp/
{
$defaultif
}
_defaultgw"
);
}
if
(
$foundgwv6
==
false
)
{
if
(
!
$foundgwv6
)
{
$defaultifv6
=
get_real_interface
(
"wan"
);
$interfacegwv6
=
"wan"
;
$gatewayipv6
=
get_interface_gateway_v6
(
"wan"
);
...
...
@@ -671,6 +671,7 @@ function system_syslogd_get_remote_servers($syslogcfg, $facility = "*.*") {
function
system_syslogd_start
()
{
global
$config
,
$g
;
$retval
=
null
;
/* XXX temporary hook for newsyslog.conf regeneration */
configd_run
(
'template reload OPNsense.Syslog'
);
...
...
@@ -940,9 +941,12 @@ function system_generate_lighty_config(
$captiveportal
=
',"mod_evasive"'
;
$http_rewrite_rules
=
"url.rewrite-once = (
\"
(.*captiveportal.*)
\"
=>
\"
$1
\"
,
\"
(.*)
\"
=>
\"
/index.php?zone=
{
$captive_portal
}
&redirurl=$1
\"
)
\n
"
;
$maxprocperip
=
$config
[
'captiveportal'
][
$captive_portal
][
'maxprocperip'
];
if
(
empty
(
$maxprocperip
))
if
(
!
isset
(
$config
[
'captiveportal'
][
$captive_portal
][
'maxprocperip'
])
||
empty
(
$config
[
'captiveportal'
][
$captive_portal
][
'maxprocperip'
]))
{
$maxprocperip
=
10
;
}
else
{
$maxprocperip
=
$config
[
'captiveportal'
][
$captive_portal
][
'maxprocperip'
];
}
$captive_portal_mod_evasive
=
"evasive.max-conns-per-ip =
{
$maxprocperip
}
"
;
$server_upload_dirs
=
"server.upload-dirs = (
\"
/tmp/captiveportal/
\"
)
\n
"
;
...
...
@@ -1239,8 +1243,11 @@ EOD;
// Add HTTP to HTTPS redirect
if
(
$captive_portal
===
false
&&
$config
[
'system'
][
'webgui'
][
'protocol'
]
==
"https"
&&
!
isset
(
$config
[
'system'
][
'webgui'
][
'disablehttpredirect'
]))
{
if
(
$lighty_port
!=
"443"
)
if
(
$lighty_port
!=
"443"
)
{
$redirectport
=
":
{
$lighty_port
}
"
;
}
else
{
$redirectport
=
""
;
}
$lighty_config
.=
<<<EOD
\$SERVER["socket"] == ":80" {
\$HTTP["host"] =~ "(.*)" {
...
...
@@ -1711,14 +1718,6 @@ function system_disable_arp_wrong_if()
));
}
function
system_enable_arp_wrong_if
()
{
set_sysctl
(
array
(
"net.link.ether.inet.log_arp_wrong_iface"
=>
"1"
,
"net.link.ether.inet.log_arp_movements"
=>
"1"
));
}
function
enable_watchdog
()
{
global
$config
;
...
...
src/www/system_advanced_network.php
View file @
bdfbe06f
...
...
@@ -33,6 +33,15 @@ require_once("guiconfig.inc");
require_once
(
"functions.inc"
);
require_once
(
"filter.inc"
);
function
system_enable_arp_wrong_if
()
{
set_sysctl
(
array
(
"net.link.ether.inet.log_arp_wrong_iface"
=>
"1"
,
"net.link.ether.inet.log_arp_movements"
=>
"1"
));
}
$pconfig
[
'ipv6nat_enable'
]
=
isset
(
$config
[
'diag'
][
'ipv6nat'
][
'enable'
]);
$pconfig
[
'ipv6nat_ipaddr'
]
=
$config
[
'diag'
][
'ipv6nat'
][
'ipaddr'
];
$pconfig
[
'ipv6allow'
]
=
isset
(
$config
[
'system'
][
'ipv6allow'
]);
...
...
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