~alpine/users

2 2

using ip command to config bond interface

Guning Lin <guningh@gmail.com>
Details
Message ID
<CAKhWdagfwgi2PSJZ0W6RjM-2Oe64Mwx+E7NjmtjJ0mhyerR4hQ@mail.gmail.com>
DKIM signature
missing
Download raw message
Hi:

I want to use ip command to config bond interface at once, but it didn't
work, Can you help me? Here are context:

1. I have two native interfaces eth0 and eth1

2. I've tried this command blow to add a bond interface bond0

ip link add bond0 type bond mode active-backup miimon 200 downdelay 100
> updelay 100

ip link add bond0 type bond mode 2 miimon 200 downdelay 100 updelay 100

ip link add bond0 type bond mod=2 miimon=200 downdelay=100 updelay=100

3. all of them return code 0 but when I see the mode using  `cat
/proc/net/bonding/bond0`, it shows:

localhost:~# cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v6.1.27-2-lts


> Bonding Mode: load balancing (round-robin)

MII Status: up

MII Polling Interval (ms): 0

Up Delay (ms): 0

Down Delay (ms): 0

Peer Notification Delay (ms): 0

.....


There must be something wrong with my command, so it result in the default
params

I've ried some way to find the `ip` command manaual, but got nothing
useful.

Thanks!
Guido Trotter <ultrotter@debian.org>
Details
Message ID
<CAM4p=JOfSuGBXVXLBS5VZ8G-5+Z-cvqTdUCor8Ekp0zDanLVjQ@mail.gmail.com>
In-Reply-To
<CAKhWdagfwgi2PSJZ0W6RjM-2Oe64Mwx+E7NjmtjJ0mhyerR4hQ@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
On Wed, 11 Oct 2023 at 09:53, Guning Lin <guningh@gmail.com> wrote:
>
> Hi:
>
> I want to use ip command to config bond interface at once, but it didn't work, Can you help me? Here are context:
>
> 1. I have two native interfaces eth0 and eth1
>
> 2. I've tried this command blow to add a bond interface bond0
>>
>> ip link add bond0 type bond mode active-backup miimon 200 downdelay 100 updelay 100
>>
>> ip link add bond0 type bond mode 2 miimon 200 downdelay 100 updelay 100
>>
>> ip link add bond0 type bond mod=2 miimon=200 downdelay=100 updelay=100
>
> 3. all of them return code 0 but when I see the mode using  `cat /proc/net/bonding/bond0`, it shows:
>>
>> localhost:~# cat /proc/net/bonding/bond0
>>
>> Ethernet Channel Bonding Driver: v6.1.27-2-lts
>>
>>
>> Bonding Mode: load balancing (round-robin)
>>
>> MII Status: up
>>
>> MII Polling Interval (ms): 0
>>
>> Up Delay (ms): 0
>>
>> Down Delay (ms): 0
>>
>> Peer Notification Delay (ms): 0
>>
>> .....
>
>
> There must be something wrong with my command, so it result in the default params
>
> I've ried some way to find the `ip` command manaual, but got nothing useful.
>
> Thanks!

It seems you created the bond, but you also need to add interfaces to it?

Something like:

ip link set eth0 master bond0
ip link set eth1 master bond0

And then of course you'll need to bring the interface up, etc...
Any reason you don't want to do this via /etc/network/interfaces ?

Cheers,

Guido
Guning Lin <guningh@gmail.com>
Details
Message ID
<CAKhWdaihesJx4iV-vyqw9GSdyXVdFFN-_AqfzPW4k=Z+Be6R7w@mail.gmail.com>
In-Reply-To
<CAM4p=JOfSuGBXVXLBS5VZ8G-5+Z-cvqTdUCor8Ekp0zDanLVjQ@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
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.


Guido Trotter <ultrotter@debian.org> 于2023年10月11日周三 19:14写道:

> On Wed, 11 Oct 2023 at 09:53, Guning Lin <guningh@gmail.com> wrote:
> >
> > Hi:
> >
> > I want to use ip command to config bond interface at once, but it didn't
> work, Can you help me? Here are context:
> >
> > 1. I have two native interfaces eth0 and eth1
> >
> > 2. I've tried this command blow to add a bond interface bond0
> >>
> >> ip link add bond0 type bond mode active-backup miimon 200 downdelay 100
> updelay 100
> >>
> >> ip link add bond0 type bond mode 2 miimon 200 downdelay 100 updelay 100
> >>
> >> ip link add bond0 type bond mod=2 miimon=200 downdelay=100 updelay=100
> >
> > 3. all of them return code 0 but when I see the mode using  `cat
> /proc/net/bonding/bond0`, it shows:
> >>
> >> localhost:~# cat /proc/net/bonding/bond0
> >>
> >> Ethernet Channel Bonding Driver: v6.1.27-2-lts
> >>
> >>
> >> Bonding Mode: load balancing (round-robin)
> >>
> >> MII Status: up
> >>
> >> MII Polling Interval (ms): 0
> >>
> >> Up Delay (ms): 0
> >>
> >> Down Delay (ms): 0
> >>
> >> Peer Notification Delay (ms): 0
> >>
> >> .....
> >
> >
> > There must be something wrong with my command, so it result in the
> default params
> >
> > I've ried some way to find the `ip` command manaual, but got nothing
> useful.
> >
> > Thanks!
>
> It seems you created the bond, but you also need to add interfaces to it?
>
> Something like:
>
> ip link set eth0 master bond0
> ip link set eth1 master bond0
>
> And then of course you'll need to bring the interface up, etc...
> Any reason you don't want to do this via /etc/network/interfaces ?
>
> Cheers,
>
> Guido
>
Reply to thread Export thread (mbox)