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
b3d14817
Commit
b3d14817
authored
May 09, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gateways: pick up interface for manual route to far gateway; closes #880
parent
51531ca0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
system.inc
src/etc/inc/system.inc
+4
-2
system_gateways_edit.php
src/www/system_gateways_edit.php
+2
-1
No files found.
src/etc/inc/system.inc
View file @
b3d14817
...
@@ -662,6 +662,7 @@ function system_staticroutes_configure($interface = '', $update_dns = false)
...
@@ -662,6 +662,7 @@ function system_staticroutes_configure($interface = '', $update_dns = false)
}
}
$gatewayip
=
$gateway
[
'gateway'
];
$gatewayip
=
$gateway
[
'gateway'
];
$needs_iface
=
isset
(
$gateway
[
'fargw'
]);
$interfacegw
=
$gateway
[
'interface'
];
$interfacegw
=
$gateway
[
'interface'
];
$blackhole
=
""
;
$blackhole
=
""
;
...
@@ -715,11 +716,12 @@ function system_staticroutes_configure($interface = '', $update_dns = false)
...
@@ -715,11 +716,12 @@ function system_staticroutes_configure($interface = '', $update_dns = false)
$ip
.=
"/128"
;
$ip
.=
"/128"
;
}
}
$inet
=
(
is_subnetv6
(
$ip
)
?
"-inet6"
:
"-inet"
);
$inet
=
(
is_subnetv6
(
$ip
)
?
"-inet6"
:
"-inet"
);
$iface
=
$needs_iface
?
' -iface '
.
escapeshellarg
(
$interfacegw
)
.
' '
:
''
;
$cmd
=
"
{
$inet
}
{
$blackhole
}
"
.
escapeshellarg
(
$ip
)
.
" "
;
$cmd
=
"
{
$inet
}
{
$blackhole
}
"
.
escapeshellarg
(
$ip
)
.
" "
;
if
(
is_subnet
(
$ip
))
{
if
(
is_subnet
(
$ip
))
{
if
(
is_ipaddr
(
$gatewayip
))
{
if
(
is_ipaddr
(
$gatewayip
))
{
mwexec
(
"/sbin/route delete"
.
$cmd
.
escapeshellarg
(
$gatewayip
));
mwexec
(
"/sbin/route delete"
.
$cmd
.
$iface
.
escapeshellarg
(
$gatewayip
));
mwexec
(
"/sbin/route add"
.
$cmd
.
escapeshellarg
(
$gatewayip
));
mwexec
(
"/sbin/route add"
.
$cmd
.
$iface
.
escapeshellarg
(
$gatewayip
));
}
elseif
(
!
empty
(
$interfacegw
))
{
}
elseif
(
!
empty
(
$interfacegw
))
{
mwexec
(
"/sbin/route delete"
.
$cmd
.
"-iface "
.
escapeshellarg
(
$interfacegw
));
mwexec
(
"/sbin/route delete"
.
$cmd
.
"-iface "
.
escapeshellarg
(
$interfacegw
));
mwexec
(
"/sbin/route add"
.
$cmd
.
"-iface "
.
escapeshellarg
(
$interfacegw
));
mwexec
(
"/sbin/route add"
.
$cmd
.
"-iface "
.
escapeshellarg
(
$interfacegw
));
...
...
src/www/system_gateways_edit.php
View file @
b3d14817
...
@@ -645,7 +645,8 @@ $( document ).ready(function() {
...
@@ -645,7 +645,8 @@ $( document ).ready(function() {
<td>
<td>
<input
name=
"fargw"
type=
"checkbox"
value=
"yes"
<?=
!
empty
(
$pconfig
[
'fargw'
])
?
'checked="checked"'
:
''
;
?>
/>
<input
name=
"fargw"
type=
"checkbox"
value=
"yes"
<?=
!
empty
(
$pconfig
[
'fargw'
])
?
'checked="checked"'
:
''
;
?>
/>
<div
class=
"hidden"
for=
"help_for_fargw"
>
<div
class=
"hidden"
for=
"help_for_fargw"
>
<?=
gettext
(
"This will allow the gateway to exist outside of the interface subnet."
);
?>
<?=
gettext
(
"This will allow the gateway to exist outside of the interface subnet. "
.
"A corresponding route must bet set up for this gateway in order for it to operate correctly."
);
?>
</div>
</div>
</td>
</td>
</tr>
</tr>
...
...
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