netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* feature - ip link set <dev> primary <dev> ?
@ 2016-02-05  3:07 James Feeney
  2016-02-05  9:10 ` Nikolay Aleksandrov
  0 siblings, 1 reply; 2+ messages in thread
From: James Feeney @ 2016-02-05  3:07 UTC (permalink / raw)
  To: netdev

Should there be an

 ip link set <primary-slave-device> primary <master-device>

command in the iproute2 package, to set the Primary Slave on a "bond" type link?

It seems that the alternative now is to use the sysfs, with

 echo -n <primary> > /sys/devices/virtual/net/<master-device>/bonding/primary

which, in systemd Service Unit Files, requires "/usr/bin/sh -c 'echo ...'"
rather than simply "/usr/bin/echo ...".  "ip" seems to handle all other "bond"
configuration itself.

Thanks
James

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: feature - ip link set <dev> primary <dev> ?
  2016-02-05  3:07 feature - ip link set <dev> primary <dev> ? James Feeney
@ 2016-02-05  9:10 ` Nikolay Aleksandrov
  0 siblings, 0 replies; 2+ messages in thread
From: Nikolay Aleksandrov @ 2016-02-05  9:10 UTC (permalink / raw)
  To: james, netdev

On 02/05/2016 04:07 AM, James Feeney wrote:
> Should there be an
> 
>  ip link set <primary-slave-device> primary <master-device>
> 
> command in the iproute2 package, to set the Primary Slave on a "bond" type link?
> 
> It seems that the alternative now is to use the sysfs, with
> 
>  echo -n <primary> > /sys/devices/virtual/net/<master-device>/bonding/primary
> 
> which, in systemd Service Unit Files, requires "/usr/bin/sh -c 'echo ...'"
> rather than simply "/usr/bin/echo ...".  "ip" seems to handle all other "bond"
> configuration itself.
> 
> Thanks
> James
> 

Hi James,
There is an iproute2 command that changes the primary,
$ ip link set dev <bond device> type bond primary <slave device>

Here's the output from the type bond help:
Usage: ... bond [ mode BONDMODE ] [ active_slave SLAVE_DEV ]
                [ clear_active_slave ] [ miimon MIIMON ]
                [ updelay UPDELAY ] [ downdelay DOWNDELAY ]
                [ use_carrier USE_CARRIER ]
                [ arp_interval ARP_INTERVAL ]
                [ arp_validate ARP_VALIDATE ]
                [ arp_all_targets ARP_ALL_TARGETS ]
                [ arp_ip_target [ ARP_IP_TARGET, ... ] ]
                [ primary SLAVE_DEV ]
                [ primary_reselect PRIMARY_RESELECT ]
                [ fail_over_mac FAIL_OVER_MAC ]
                [ xmit_hash_policy XMIT_HASH_POLICY ]
                [ resend_igmp RESEND_IGMP ]
                [ num_grat_arp|num_unsol_na NUM_GRAT_ARP|NUM_UNSOL_NA ]
                [ all_slaves_active ALL_SLAVES_ACTIVE ]
                [ min_links MIN_LINKS ]
                [ lp_interval LP_INTERVAL ]
                [ packets_per_slave PACKETS_PER_SLAVE ]
                [ lacp_rate LACP_RATE ]
                [ ad_select AD_SELECT ]

BONDMODE := balance-rr|active-backup|balance-xor|broadcast|802.3ad|balance-tlb|balance-alb
ARP_VALIDATE := none|active|backup|all
ARP_ALL_TARGETS := any|all
PRIMARY_RESELECT := always|better|failure
FAIL_OVER_MAC := none|active|follow
XMIT_HASH_POLICY := layer2|layer2+3|layer3+4
LACP_RATE := slow|fast
AD_SELECT := stable|bandwidth|count

Cheers,
 Nik

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-05  9:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-05  3:07 feature - ip link set <dev> primary <dev> ? James Feeney
2016-02-05  9:10 ` Nikolay Aleksandrov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).