mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
interfaces: allow explicit mtu to reach the stf device; closes #2553
This commit is contained in:
parent
adf314a4ab
commit
bc3dd5afca
@ -2725,6 +2725,12 @@ function interface_6rd_configure($interface = 'wan', $wancfg)
|
||||
legacy_interface_create('stf', $stfiface);
|
||||
legacy_interface_flags($stfiface, 'link2');
|
||||
|
||||
$mtu = !empty($wancfg['mtu']) ? $wancfg['mtu'] - 20 : 1280;
|
||||
if ($mtu > 1480) {
|
||||
$mtu = 1480;
|
||||
}
|
||||
legacy_interface_mtu($stfiface, $mtu);
|
||||
|
||||
mwexecf('/sbin/ifconfig %s inet6 %s/%s', array($stfiface, $rd6prefix, $rd6prefixlen + 32 - $wancfg['prefix-6rd-v4plen']));
|
||||
mwexecf('/sbin/ifconfig %s stfv4br %s', array($stfiface, $wancfg['gateway-6rd']));
|
||||
mwexecf('/sbin/ifconfig %s stfv4net %s/%s', array($stfiface, $ip4address, $wancfg['prefix-6rd-v4plen']));
|
||||
@ -2818,7 +2824,14 @@ function interface_6to4_configure($interface = 'wan', $wancfg)
|
||||
}
|
||||
legacy_interface_create('stf', $stfiface);
|
||||
legacy_interface_flags($stfiface, 'link2');
|
||||
mwexec("/sbin/ifconfig {$stfiface} inet6 {$stflanpr} prefixlen 16");
|
||||
|
||||
$mtu = !empty($wancfg['mtu']) ? $wancfg['mtu'] - 20 : 1280;
|
||||
if ($mtu > 1480) {
|
||||
$mtu = 1480;
|
||||
}
|
||||
legacy_interface_mtu($stfiface, $mtu);
|
||||
|
||||
mwexecf('/sbin/ifconfig %s inet6 %s prefixlen 16', array($stfiface, $stflanpr));
|
||||
|
||||
/* write out a default router file */
|
||||
file_put_contents("/tmp/{$wanif}_routerv6", "{$stfbrgw}");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user