mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Comment out the srd 6rd device and put in the patched stf device commands.
Still doesn't work but Ermal might be able to debug easily
This commit is contained in:
parent
2d5ca06e67
commit
4aa569bd78
@ -3151,23 +3151,39 @@ function interface_6rd_configure($interface = "wan") {
|
||||
|
||||
/* binary presentation of the prefix for all 128 bits. */
|
||||
$rd6prefixbin = convert_ipv6_to_128bit($rd6prefix);
|
||||
|
||||
|
||||
/* just save the left prefix length bits */
|
||||
$rd6brprefixbin = substr($rd6prefixbin, 0, $rd6prefixlen);
|
||||
/* if the prefix length is not 32 bits we need to shave bits off from the left of the v4 address. */
|
||||
$rd6brprefixbin .= substr(sprintf("%032b", hexdec($hexbrv4)), $wancfg['prefix-6rd-v4plen'], 32);
|
||||
/* fill out the rest with 0's */
|
||||
$rd6brprefixbin = str_pad($rd6brprefixbin, 128, "0", STR_PAD_RIGHT);;
|
||||
|
||||
/* convert the 128 bits for the broker address back into a valid IPv6 address */
|
||||
$rd6brgw = convert_128bit_to_ipv6($rd6brprefixbin);
|
||||
|
||||
/* just save the left prefix length bits */
|
||||
$rd6prefixbin = substr($rd6prefixbin, 0, $rd6prefixlen);
|
||||
/* if the prefix length is not 32 bits we need to shave bits off from the left of the v4 address. */
|
||||
$rd6prefixbin .= substr(sprintf("%032b", hexdec($hexbrv4)), $wancfg['prefix-6rd-v4plen'], 32);
|
||||
$rd6prefixbin .= substr(sprintf("%032b", hexdec($hexwanv4)), $wancfg['prefix-6rd-v4plen'], 32);
|
||||
/* fill out the rest with 0's */
|
||||
$rd6prefixbin = str_pad($rd6prefixbin, 128, "0", STR_PAD_RIGHT);;
|
||||
|
||||
/* convert the 128 bits for the broker address back into a valid IPv6 address */
|
||||
$rd6brgw = convert_128bit_to_ipv6($rd6prefixbin);
|
||||
$rd6prefix = convert_128bit_to_ipv6($rd6prefixbin);
|
||||
|
||||
/* setup the stf interface */
|
||||
/* use the srd device
|
||||
mwexec("/sbin/ifconfig srd0 destroy");
|
||||
mwexec("/sbin/ifconfig srd0 create");
|
||||
mwexec("/sbin/ifconfig srd0 v4plen {$wancfg['prefix-6rd-v4plen']} pfix {$rd6prefix} plen {$rd6prefixlen} braddr {$wancfg['gateway-6rd']}");
|
||||
|
||||
log_error("Created 6rd interface srd0 v4plen {$wancfg['prefix-6rd-v4plen']} pfix {$rd6prefix} plen {$rd6prefixlen} braddr {$wancfg['gateway-6rd']}");
|
||||
*/
|
||||
/* stf approach only works when embedding the entire 32 bits of the v4 */
|
||||
mwexec("/sbin/ifconfig stf0 destroy");
|
||||
mwexec("/sbin/ifconfig stf0 create");
|
||||
mwexec("/sbin/ifconfig stf0 inet6 {$rd6prefix}/{$rd6prefixlen}");
|
||||
log_error("Created 6rd interface stf0 {$rd6prefix}/{$rd6prefixlen}");
|
||||
|
||||
/* write out a default router file */
|
||||
file_put_contents("{$g['tmp_path']}/{$wanif}_routerv6", "{$rd6brgw}\n");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user