interfaces: employ gre trick here for gif as well

Also try to pin 128 bit net to use that immediately as the
configuration is already correct.
This commit is contained in:
Franco Fichtner 2022-08-11 14:26:35 +02:00
parent 6043b5b125
commit e6d53a4f8e

View File

@ -591,7 +591,7 @@ function _interfaces_gre_configure($gre)
}
if (is_ipaddrv6($gre['tunnel-local-addr']) || is_ipaddrv6($gre['tunnel-remote-addr'])) {
/* 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']}")) {
if ($gre['tunnel-remote-net'] != '128' && 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'],
@ -680,12 +680,20 @@ function _interfaces_gif_configure($gif)
mwexecf('/sbin/ifconfig %s tunnel %s %s', array($gif['gifif'], $realifip, $gif['remote-addr']));
}
if (is_ipaddrv6($gif['tunnel-local-addr']) || is_ipaddrv6($gif['tunnel-remote-addr'])) {
mwexecf('/sbin/ifconfig %s inet6 %s %s prefixlen %s', [
$gif['gifif'],
$gif['tunnel-local-addr'],
$gif['tunnel-remote-addr'],
'128',
]);
/* check if destination is local to source and if not we need the traditional point-to-point setup */
if ($gif['tunnel-remote-net'] != '128' && ip_in_subnet($gif['tunnel-remote-addr'], "{$gif['tunnel-local-addr']}/{$gif['tunnel-remote-net']}")) {
mwexecf('/sbin/ifconfig %s inet6 %s prefixlen %s', [
$gif['gifif'],
$gif['tunnel-local-addr'],
$gif['tunnel-remote-net'],
]);
} else {
mwexecf('/sbin/ifconfig %s inet6 %s %s prefixlen 128', [
$gif['gifif'],
$gif['tunnel-local-addr'],
$gif['tunnel-remote-addr'],
]);
}
} else {
mwexecf('/sbin/ifconfig %s inet6 ifdisabled', [$gif['gifif']]);
mwexecf('/sbin/ifconfig %s %s %s netmask %s', [