Skip to content

Commit 1b9c849

Browse files
committed
ip link add: support bond device creation
Introduced support `ip link add NAME type bond [OPTIONS]`. Accepts all bond options identical to iproute2. Uses netlink-packet-route FromStr/Display for all bond options (BondMode, BondArpValidate, BondArpAllTargets, BondPrimaryReselect, BondFailOverMac, BondAdSelect, BondXmitHashPolicy) via a generic parse_from_str helper. Added arp_ip_target, ns_ip6_target, ad_actor_sys_prio, ad_user_port_key, ad_actor_system display fields. Includes 7 integration tests for bond creation with various option combinations. Signed-off-by: Gris Ge <cnfourt@gmail.com>
1 parent 6f4162c commit 1b9c849

3 files changed

Lines changed: 444 additions & 20 deletions

File tree

src/ip/link/add.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ impl LinkAddCommand {
5252
InfoKind::Vlan => {
5353
base_conf.apply(base_conf.apply_vlan(&handle).await?)?
5454
}
55+
InfoKind::Bond => {
56+
base_conf.apply(base_conf.apply_bond(&handle).await?)?
57+
}
5558
t => {
5659
return Err(CliError::from(format!(
5760
"Unsupported device type: {t}"

0 commit comments

Comments
 (0)