Cấu hình bonding và multiple vlan trên Ubuntu server 18
Cấu hình bonding và multiple vlan trên Ubuntu server 18
1./ Mô hình
Cấu hình bonding mode 4 hay 802.3ad sẽ giúp Loadbalencing đều trên các đường link vật lý
Ở ví dụ này có 1 IP 10.100.130.19/24 là IP của server.
các IP vlan:
vlan 4: 172.26.4.29/24
vlan 6: 172.26.6.29/24
Có thể gắn gateway cho các vlan
Các port vật lý bonding là:
enp4s0f0
enp4s0f1
2./ Cấu hình trên server
sudo apt-get install ifenslave
Kiểm tra kernel module đã load bonding chưa
sudo lsmod | grep bonding
#Nếu không có gì xuất hiện tiếp tục gõ
sudo modprobe bonding
#Để chắc chắn răng mode bonding được khởi động sau khi restart server
sudo nano /etc/modules
#Paste ở cuối
bonding
Sau Paste cấu hình network như sau:
#Lưu ý thay đổi IP với từng case
nano /etc/netplan/50-cloud-init.yaml
#replace and paste
# This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot.  To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
   ethernets:
           enp4s0f0:
                   dhcp4: false
           enp4s0f1:
                   dhcp4: false
#
           # ens4f1:
                   # dhcp4: false
                   # optional: true
           eno4:
                   addresses: [10.100.130.19/24]
                   gateway4: 10.100.130.254
                   nameservers:
                           addresses: [1.1.1.1,8.8.8.8]
#
   version: 2
   bonds:
           bond0:
                   interfaces: [enp4s0f0,enp4s0f1]
                   mtu: 9000
                   parameters:
                           mode: 802.3ad
                           lacp-rate: fast
                           mii-monitor-interval: 100
           # bond1:
                   # interfaces: [ens4f1,ens4f0]
                   # mtu: 9000
                   # parameters:
                           # mode: 802.3ad
                           # lacp-rate: fast
                           # mii-monitor-interval: 100
   vlans:
           bond0.4:
                  dhcp4: no
                  id: 4
                  link: bond0
                  mtu: 9000
                  addresses: [172.26.4.29/24]
           bond0.6:
                  dhcp4: no
                  id: 6
                  link: bond0
                  mtu: 9000
                  addresses: [172.26.6.29/24]
                  gateway4: 172.26.6.19
           # bond1.14:
                   # id: 14
                   # link: bond0
                   # addresses: [172.30.14.117/24]
3./ Tham khảo:
https://fixloinhanh.com
https://www.snel.com/support/how-to-set-up-lacp-bonding-on-ubuntu-18-04-with-netplan/

 
																			 
																			 
																			