mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
interfaces: figure out point-to-point or subnet setup
PR: https://forum.opnsense.org/index.php?topic=29654.0
This commit is contained in:
parent
e1e8abc03e
commit
d69ff4a16a
@ -590,12 +590,20 @@ function _interfaces_gre_configure($gre)
|
||||
mwexecf('/sbin/ifconfig %s tunnel %s %s', [$gre['greif'], get_interface_ip($gre['if']), $gre['remote-addr']]);
|
||||
}
|
||||
if (is_ipaddrv6($gre['tunnel-local-addr']) || is_ipaddrv6($gre['tunnel-remote-addr'])) {
|
||||
mwexecf('/sbin/ifconfig %s inet6 %s %s prefixlen %s', [
|
||||
$gre['greif'],
|
||||
$gre['tunnel-local-addr'],
|
||||
$gre['tunnel-remote-addr'],
|
||||
'128',
|
||||
]);
|
||||
/* check if destination is local to source and if not we need the traditional point-to-point setup */
|
||||
if (ip_in_subnet($gre['tunnel-remote-addr'], "{$gre['tunnel-local-addr']}/{$gre['tunnel-remote-net']}")) {
|
||||
mwexecf('/sbin/ifconfig %s inet6 %s prefixlen %s', [
|
||||
$gre['greif'],
|
||||
$gre['tunnel-local-addr'],
|
||||
$gre['tunnel-remote-net'],
|
||||
]);
|
||||
} else {
|
||||
mwexecf('/sbin/ifconfig %s inet6 %s %s prefixlen 128', [
|
||||
$gre['greif'],
|
||||
$gre['tunnel-local-addr'],
|
||||
$gre['tunnel-remote-addr'],
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
mwexecf('/sbin/ifconfig %s inet6 ifdisabled', [$gre['greif']]);
|
||||
mwexecf('/sbin/ifconfig %s %s %s netmask %s', [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user