rtnetlink 0.21.0

manipulate linux networking resources via netlink
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-License-Identifier: MIT

use rtnetlink::{new_connection, LinkBridge};

#[tokio::main]
async fn main() -> Result<(), String> {
    let (connection, handle, _) = new_connection().unwrap();
    tokio::spawn(connection);

    handle
        .link()
        .add(LinkBridge::new("my-bridge").build())
        .execute()
        .await
        .map_err(|e| format!("{e}"))
}