Difference between revisions of "Linux: Interface BONDING"

From OnnoWiki
Jump to navigation Jump to search
Line 20: Line 20:
  
 
  modprobe --first-time bonding
 
  modprobe --first-time bonding
 +
modprobe bonding
 
  modinfo bonding | more
 
  modinfo bonding | more
  
Edit
 
  
vi /etc/modprobe.d/bonding.conf
+
==Edit Interface==
  
  alias bond0 bonding
+
  sudo vi /etc/network/interfaces
  
  
Edit
 
 
vi /etc/sysconfig/network-scripts/ifcfg-bond0
 
 
DEVICE=bond0
 
NAME=bond0
 
TYPE=Bond
 
BONDING_MASTER=yes
 
IPADDR=192.168.43.100
 
PREFIX=24
 
ONBOOT=yes
 
BOOTPROTO=none
 
BONDING_OPTS="mode=1 miimon=100"
 
 
Note the directive BONDING_OPTS line, bonding uses a variety of options and mode. Modes can be:
 
 
* mode 0 or balance-rr: Sets a round-robin policy for fault tolerance and load balancing.
 
* mode 1 or active-backup: Sets an active-backup policy for fault tolerance.
 
* mode 2 or balance-xor: Sets an XOR (exclusive-or) mode for fault tolerance and load balancing.
 
* mode 3 or broadcast: Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.
 
* mode 4 or 802.3ad: Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share the same speed and duplex settings.
 
* mode 5 or balance-tlb: Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed slave. This mode is only suitable for local addresses known to the kernel bonding module and therefore cannot be used behind a bridge with virtual machines.
 
* mode 6 or balance-alb: Sets an Adaptive Load Balancing (ALB) policy for fault tolerance and load balancing. Includes transmit and receive load balancing for IPv4 traffic.
 
 
 
==Konfigurasi Interface untuk Bonding==
 
 
Interface ens33
 
 
vi /etc/sysconfig/network-scripts/ifcfg-ens33
 
 
DEVICE=ens33
 
NAME=bond0-slave
 
TYPE=Ethernet
 
BOOTPROTO=none
 
ONBOOT=yes
 
MASTER=bond0
 
SLAVE=yes
 
 
Interface ens34
 
 
vi /etc/sysconfig/network-scripts/ifcfg-ens34
 
 
DEVICE=ens34
 
NAME=bond0-slave
 
TYPE=Ethernet
 
BOOTPROTO=none
 
ONBOOT=yes
 
MASTER=bond0
 
SLAVE=yes
 
  
 +
# eth0 is manually configured, and slave to the "bond0" bonded NIC
 +
auto eth0
 +
iface eth0 inet manual
 +
    bond-master bond0
 +
    bond-primary eth0
 +
 +
# eth1 ditto, thus creating a 2-link bond.
 +
auto eth1
 +
iface eth1 inet manual
 +
    bond-master bond0
 +
 +
# bond0 is the bonding NIC and can be used like any other normal NIC.
 +
# bond0 is configured using static network information.
 +
auto bond0
 +
iface bond0 inet static
 +
    address 192.168.1.10
 +
    gateway 192.168.1.1
 +
    netmask 255.255.255.0
 +
    bond-mode active-backup
 +
    bond-miimon 100
 +
    bond-slaves none
  
  
 
==Aktifasi Bonding==
 
==Aktifasi Bonding==
  
Interface Down
+
  sudo start networking
 
 
  # ifdown ifcfg-ens33
 
# ifdown ifcfg-ens34
 
 
 
Interface Up
 
 
 
# ifup ifcfg-ens33
 
# ifup ifcfg-ens34
 
 
 
AKtifasi bonding
 
  
# nmcli con reload
+
==Cek==
  
Cek
+
cat /proc/net/bonding/bond0
  
  # ifconfig
+
  ifconfig
  
 
==Referensi==
 
==Referensi==

Revision as of 05:43, 30 September 2019

Sumber: https://help.ubuntu.com/community/UbuntuBonding


Aktifkan Module

sudo su
vi /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

loop
lp
rtc
bonding

Aktifkan module

modprobe --first-time bonding
modprobe bonding
modinfo bonding | more


Edit Interface

sudo vi /etc/network/interfaces


# eth0 is manually configured, and slave to the "bond0" bonded NIC
auto eth0
iface eth0 inet manual 
    bond-master bond0
    bond-primary eth0

# eth1 ditto, thus creating a 2-link bond.
auto eth1
iface eth1 inet manual
    bond-master bond0

# bond0 is the bonding NIC and can be used like any other normal NIC.
# bond0 is configured using static network information.
auto bond0
iface bond0 inet static
    address 192.168.1.10
    gateway 192.168.1.1
    netmask 255.255.255.0
    bond-mode active-backup
    bond-miimon 100
    bond-slaves none 


Aktifasi Bonding

sudo start networking

Cek

cat /proc/net/bonding/bond0
ifconfig

Referensi