RustBond
A Rust implementation of the MetalBond route distribution protocol.
MetalBond distributes virtual network routes across hypervisors over TCP/IPv6.
Features
- Async client/server with Tokio
- Automatic reconnection
- VNI-based subscriptions
- Multi-server HA with ECMP support
- Standard, NAT, and LoadBalancer route types
- Interoperable with Go MetalBond
- Optional netlink integration for kernel route installation
Quick Start
Server
use ;
let server = start.await?;
// ... server.shutdown().await?;
Client
use ;
;
let client = connect;
client.wait_established.await?;
client.subscribe.await?;
Multi-Server (HA)
For high availability, connect to multiple servers simultaneously:
let client = connect;
client.wait_any_established.await?;
// Routes are deduplicated across servers; ECMP supported
Examples
# Run server (default: [::1]:4711)
# Run server on custom address
# Connect client to VNI 100
# Announce a route (VNI#prefix@nexthop)
# Multi-server HA (just add more -s flags)
Route Types
Announcement format: VNI#prefix@nexthop[#type[#fromPort#toPort]]
# Standard route (default) on VNI 100
# NAT route with port range on VNI 200
# Load balancer target on VNI 100
Kernel Route Installation (Netlink)
Enable the netlink feature to install routes directly into the Linux kernel routing tables:
# Install routes from VNI 100 to kernel routing table 100
Options:
--install-routes VNI#TABLE- Map VNI to kernel routing table (can be repeated)--tun DEVICE- Tunnel device name (default: ip6tnl0)
Routes are marked with protocol 254 for identification. Stale routes from previous runs are automatically cleaned up on startup.
Note: Requires root privileges to modify kernel routing tables.
Testing