netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: james@nurealm.net, netdev@vger.kernel.org
Subject: Re: feature - ip link set <dev> primary <dev> ?
Date: Fri, 5 Feb 2016 10:10:18 +0100	[thread overview]
Message-ID: <56B466FA.4000706@cumulusnetworks.com> (raw)
In-Reply-To: <56B41209.1060308@nurealm.net>

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

      reply	other threads:[~2016-02-05  9:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05  3:07 feature - ip link set <dev> primary <dev> ? James Feeney
2016-02-05  9:10 ` Nikolay Aleksandrov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B466FA.4000706@cumulusnetworks.com \
    --to=nikolay@cumulusnetworks.com \
    --cc=james@nurealm.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).