In a non-full-mesh OpenFabric setup, nodes may need to relay traffic
between peers that are not directly connected. This requires forwarding
ipv6 packets between fabric bridges. With the addition of
'force_forwarding' to the Linux kernel, this can be done without
enabling 'all.forwarding', which disables Router Advertisements.

Configure fabric bridges with the required 'post-up'/'post-down'
commands to enable 'force_forwarding'.

Signed-off-by: Lukas Sichert <[email protected]>
---
 pve-rs/src/bindings/sdn/fabrics.rs | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/pve-rs/src/bindings/sdn/fabrics.rs 
b/pve-rs/src/bindings/sdn/fabrics.rs
index f96b6b1..785b537 100644
--- a/pve-rs/src/bindings/sdn/fabrics.rs
+++ b/pve-rs/src/bindings/sdn/fabrics.rs
@@ -596,6 +596,16 @@ pub mod pve_rs_sdn_fabrics {
             writeln!(interface, "\tlink-type {link_type}")?;
         }
         writeln!(interface, "\tip-forward 1")?;
+        if cidr.is_ipv6() {
+            writeln!(
+                interface,
+                "\tpost-up echo 1 > 
/proc/sys/net/ipv6/conf/{name}/force_forwarding"
+            )?;
+            writeln!(
+                interface,
+                "\tpost-down echo 0 > 
/proc/sys/net/ipv6/conf/{name}/force_forwarding"
+            )?;
+        }
 
         Ok(interface)
     }
-- 
2.47.3




Reply via email to