Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 31657224081 for <~alpine/users@lists.alpinelinux.org>; Wed, 11 Oct 2023 11:14:11 +0000 (UTC) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5230a22cfd1so11818266a12.1 for <~alpine/users@lists.alpinelinux.org>; Wed, 11 Oct 2023 04:14:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697022849; x=1697627649; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aF7bO5Fhkx+wGt15kvj63tiA0fXdDzQrGlmLmwnpdao=; b=L6cCgVPNg+pUoN5zf9XZwrBSMqZ/yXtknBhLTqmh2llXUAwu2pCNZLidkyp0D8ndfb DEPCINuFpk0Gb3E+/B63ENwd8jGLiHmBHE/6lFsodlPQ23DD7GcW6sQsSOKggmcT2sI7 AW8FyVQHwOZXR4OxbhV3zGAm6vSCAJWZqhvVDG/Td/8bVoPnFHyP37yB3DLhyMHSbuBJ jQO12es4Ef9rpAgOqg8PMbgMeUVLuCRZtznr2d8T30RUZYLB+mIAFxgtmghOUtAUGZFz 6Yrezn0lupFwAdavQS+ggMBrhqGo78hf9d8K9WcaEwT1svIbbIGfQr3eRnLPGauih2+C 5sbA== X-Gm-Message-State: AOJu0Yza7TQh5aWPG1CAUmA4jS2iQZKE584aT2UwOPthqegjKDG8Os+N jlakfR5km+/cSFd8v5oDtmQz1SdOmOWAgSytaz73gLgPnJu3Wg== X-Google-Smtp-Source: AGHT+IEyHuVYvdSFAMUqiuJcB/Bj/ZKil8M5tStTmGPPHr1cfNkzEVro8pLkKs7a6r/st2B3Jmv+OCQ7vX4TkqyVr1A= X-Received: by 2002:a50:d0d4:0:b0:53d:a17a:7576 with SMTP id g20-20020a50d0d4000000b0053da17a7576mr4112648edf.8.1697022849209; Wed, 11 Oct 2023 04:14:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Guido Trotter Date: Wed, 11 Oct 2023 13:13:58 +0200 Message-ID: Subject: Re: using ip command to config bond interface To: Guning Lin Cc: ~alpine/users@lists.alpinelinux.org Content-Type: text/plain; charset="UTF-8" On Wed, 11 Oct 2023 at 09:53, Guning Lin 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