Subject: Re: using ip command to config bond interface

From: Guning Lin <[email-masked]>
Date: Wed, 11 Oct 2023 22:03:41 +0800

Hi Jeff:
I read the manul you provided above and try some commands again. Here is my
commands and outputs:
-----
localhost:~# ip link del bond0
localhost:~# ip link add bond0 type bond mode active-backup
localhost:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v6.1.27-2-lts

Bonding Mode: load balancing (round-robin)
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
-----
localhost:~# ip link del bond0
localhost:~# ip link add bond0 type bond mode=active-backup
localhost:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v6.1.27-2-lts

Bonding Mode: load balancing (round-robin)
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
-----
localhost:~# ip link del bond0
localhost:~# ip link add bond0 type bond "mode=active-backup"
localhost:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v6.1.27-2-lts

Bonding Mode: load balancing (round-robin)
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
-----
localhost:~# ip link del bond0
localhost:~# ip link add bond0 type bond "mode active-backup"
localhost:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v6.1.27-2-lts

Bonding Mode: load balancing (round-robin)
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
-----
localhost:~# ip link del bond0
localhost:~# ip link add bond0 type bond mode=1
localhost:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v6.1.27-2-lts

Bonding Mode: load balancing (round-robin)
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0

.......

Still get the wrong result.
I notice that this line "Ethernet Channel Bonding Driver: v6.1.27-2-lts"
is diffrent from the line in CentOS7:
-----
[root@guning ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: None
MII Status: down
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
----
(Yes, the first command I try in alpine work in CentOS!!!)

The ip-link(8) https://man7.org/linux/man-pages/man8/ip-link.8.html did not
tell me the BOND ARGS FORMAT.

Jeffrey Walton <[email-masked]> 于2023年10月11日周三 20:03写道：

> On Wed, Oct 11, 2023 at 7:32 AM Guning Lin <[email-masked]> wrote:
> >
> > Hi Guido:
> >   Thanks for your reply. The command you mentioned above is what I am
> going to run.
> >   But I am trapped in the bond-type interface args not being effected.
> >   My target is to set the bond0 interface in mode active-backup(mode 2),
> and the command I run to create this interface bond0 did not work
> >   And in my situation, I just want to run the command once without
> saving any file on disk.But I will consider your opinion.
> >
> >   If we can find the `ip` command or  `bond type` manaul , i think we
> can solve the problem.
>
> According to the ip(8) man page on Debian:
>
> HISTORY
>       ip was written by Alexey N. Kuznetsov and added in Linux 2.2.
>
> SEE ALSO
>       ip-address(8), ip-addrlabel(8), ip-ioam(8), ip-l2tp(8), ip-link(8),
> ip-
>       maddress(8), ip-monitor(8), ip-mptcp(8), ip-mroute(8),
> ip-neighbour(8),
>       ip-netns(8), ip-ntable(8), ip-route(8), ip-rule(8),
> ip-tcp_metrics(8),
>       ip-token(8), ip-tunnel(8), ip-vrf(8), ip-xfrm(8)
>       IP Command reference ip-cref.ps
>
> REPORTING BUGS
>       Report any bugs to the Network Developers mailing list <net‐
>       [email-masked]> where the development and maintenance is
> primarily
>       done.  You do not have to be subscribed to the list to send a message
>       there.
>
> AUTHOR
>       Original Manpage by Michail Litvak <[email-masked]>
>
> Jeff
>

---

From: Guido Trotter <[email-masked]>
Date: Wed, 11 Oct 2023 17:01:18 +0200

On Wed, 11 Oct 2023 at 16:04, Guning Lin <[email-masked]> wrote:
>
> Hi Jeff:
> I read the manul you provided above and try some commands again. Here is my commands and outputs:
> -----

Just checking: did you do "apk add iproute2" ?
It seems the "ip" version that comes by default in busybox may not
support all options and might be ignoring your arguments.
I was able to reproduce your error on busybox, and it went away after
I installed iproute2

Alternatively the wiki suggests installing the "bonding" packages and
configuring through the interfaces file which I guess does it
differently.

Cheers,

Guido

---

From: Guning Lin <[email-masked]>
Date: Wed, 11 Oct 2023 23:44:46 +0800

Thanks, I'll check it out!

---

From: Guning Lin <[email-masked]>
Date: Fri, 13 Oct 2023 09:56:00 +0800

It works! Thank you so much！