Linux Network Interface bonding

1.  sudo apt update && sudo apt upgrade

2. sudo apt install ifenslave

3. sudo su - modprobe bonding echo 'bonding' >> /etc/modules

Die Datei interfaces, zu finden unter "/etc/network/interfaces", wird dazu verwendet.

4. sudo vim /etc/network/interfaces

This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # Frontend bond interface auto bond0 iface bond0 inet static address 192.168.56.9/24 gateway 192.168.56.1 bond-slaves enp0s3 enp0s8 bond-mode 1 bond-primary enp0s3 bond-miimon 100 bond-downdelay 300 bond-updelay 700

5. sudo ifdown enp0s3 enp0s8 sudo ifup bond0   # Interface up

6. check status

$ ifconfig bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500 inet 192.168.56.109 netmask 255.255.255.0 broadcast 192.168.56.255 inet6 fe80::d01d:ff:fe01:2e3 prefixlen 64 scopeid 0x20<link> ether d2:1d:00:01:02:e3 txqueuelen 1000 (Ethernet) RX packets 1 bytes 590 (590.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 50 bytes 6988 (6.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s3: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500 inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255 ether d2:1d:00:01:02:e3 txqueuelen 1000 (Ethernet) RX packets 127 bytes 49643 (48.4 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 215 bytes 22755 (22.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s8: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500 inet 192.168.56.119 netmask 255.255.255.0 broadcast 192.168.56.255 ether d2:1d:00:01:02:e3 txqueuelen 1000 (Ethernet) RX packets 474 bytes 43181 (42.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 446 bytes 85422 (83.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 53 bytes 4172 (4.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 53 bytes 4172 (4.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

$ more /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v5.10.0-11-amd64 Bonding Mode: fault-tolerance (active-backup) Primary Slave: enp0s3 (primary_reselect always) Currently Active Slave: enp0s3 MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 700 Down Delay (ms): 300 Peer Notification Delay (ms): 0 Slave Interface: enp0s3 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 08:00:27:e1:5f:56 Slave queue ID: 0 Slave Interface: enp0s8 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: 08:00:27:00:96:03 Slave queue ID: 0

$ sudo dmesg -T | tail -10 [Tue Mar 1 02:18:15 2022] bond0: active interface up! [Tue Mar 1 02:18:15 2022] IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready [Tue Mar 1 02:18:15 2022] e1000: enp0s8 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX [Tue Mar 1 02:18:15 2022] bond0: (slave enp0s8): link status up, enabling it in 700 ms [Tue Mar 1 02:18:15 2022] bond0: (slave enp0s8): invalid new link 3 on slave [Tue Mar 1 02:18:16 2022] bond0: (slave enp0s8): link status definitely up, 1000 Mbps full duplex [Tue Mar 1 02:20:31 2022] bond0: (slave enp0s3): Releasing backup interface [Tue Mar 1 02:20:31 2022] bond0: (slave enp0s8): making interface the new active one [Tue Mar 1 02:20:35 2022] e1000: enp0s3 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX [Tue Mar 1 02:20:35 2022] IPv6: ADDRCONF(NETDEV_CHANGE): enp0s3: link becomes ready

Method 2- Configure Network Bonding using NMCLI

Trifft bei Debian 11 zu...

$ sudo nmcli connection add type bond con-name bond0 ifname bond0 bond.options "mode=balance-rr" Connection 'bond0' (9d37ef5d-4905-48ce-88d6-fbce925cc940) successfully added.

$ nmcli device status DEVICE TYPE STATE CONNECTION enp0s3 ethernet connected Wired connection 1 enp0s8 ethernet connected Wired connection 2 lo loopback unmanaged --

$ sudo nmcli connection add type ethernet slave-type bond con-name bond0-port1 ifname enp0s3 master bond0 Connection 'bond0-port1' (b2b69f0b-780e-4579-bf38-e80933d3d98d) successfully added. ####### $ sudo nmcli connection add type ethernet slave-type bond con-name bond0-port1 ifname enp0s8 master bond0 Warning: There is another connection with the name 'bond0-port1'. Reference the connection by its uuid '1fb56698-ff12-4a9b-826d-dfea323477fb' Connection 'bond0-port1' (1fb56698-ff12-4a9b-826d-dfea323477fb) successfully added.

sudo nmcli connection modify bond0 ipv4.addresses '192.168.56.109/24'

sudo nmcli connection modify bond0 ipv4.gateway '192.168.56.1'

sudo nmcli connection modify bond0 ipv4.dns '8.8.8.8'

sudo nmcli connection modify bond0 ipv4.method manual

sudo nmcli connection up bond0 Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)

$ nmcli device status DEVICE TYPE STATE CONNECTION enp0s3 ethernet connected Wired connection 1 enp0s8 ethernet connected Wired connection 2 bond0 bond connected bond0 lo loopback unmanaged --

$ sudo dmesg -T | tail -10 [Tue Mar 1 02:40:38 2022] e1000: enp0s8 NIC Link is Down [Tue Mar 1 02:40:38 2022] usb 2-1: new full-speed USB device number 3 using ohci-pci [Tue Mar 1 02:40:39 2022] usb 2-1: New USB device found, idVendor=80ee, idProduct=0021, bcdDevice= 1.00 [Tue Mar 1 02:40:39 2022] usb 2-1: New USB device strings: Mfr=1, Product=3, SerialNumber=0 [Tue Mar 1 02:40:39 2022] usb 2-1: Product: USB Tablet [Tue Mar 1 02:40:39 2022] usb 2-1: Manufacturer: VirtualBox [Tue Mar 1 02:40:39 2022] input: VirtualBox USB Tablet as /devices/pci0000:00/0000:00:06.0/usb2/2-1/2-1:1.0/0003:80EE:0021.0002/input/input9 [Tue Mar 1 02:40:39 2022] hid-generic 0003:80EE:0021.0002: input,hidraw0: USB HID v1.10 Mouse [VirtualBox USB Tablet] on usb-0000:00:06.0-1/input0 [Tue Mar 1 02:40:42 2022] e1000: enp0s3 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX [Tue Mar 1 02:40:42 2022] e1000: enp0s8 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX

 

Kommentieren nicht möglich