Chuyển đến nội dung chính

Bài 14: WAN Load Balancing, QoS và Monitoring

Hướng dẫn cấu hình cân bằng tải WAN, QoS, giám sát lưu lượng trên VyOS, lab thực hành dual-WAN, cấu hình NetFlow, SNMP, syslog, Prometheus.

WAN Load Balancing, QoS và Monitoring

WAN Load Balancing, QoS và Monitoring trên VyOS

Đảm bảo kết nối Internet ổn định, tối ưu hóa băng thông và giám sát lưu lượng là yêu cầu quan trọng. VyOS cung cấp các tính năng mạnh mẽ cho cân bằng tải WAN, QoS và monitoring.

WAN Load Balancing

set load-balancing wan rule 10 inbound-interface eth0
set load-balancing wan rule 10 interface eth1 weight 100
set load-balancing wan rule 10 interface eth2 weight 50
set load-balancing wan rule 10 failover
set load-balancing wan rule 10 exclude traffic source address 192.168.1.0/24
set load-balancing wan interface-health eth1 test 10 type ping target 8.8.8.8
set load-balancing wan interface-health eth2 test 10 type ping target 1.1.1.1

QoS: Traffic Shaping và Ưu tiên

set qos policy shaper SHAPER bandwidth 100mbit
set qos policy shaper SHAPER default bandwidth 80mbit
set qos policy shaper SHAPER class 10 match ip destination address 192.168.2.0/24
set qos policy shaper SHAPER class 10 bandwidth 20mbit
set interfaces ethernet eth0 qos policy shaper SHAPER

Ưu tiên traffic VoIP/gaming bằng CAKE hoặc HTB.

NetFlow/sFlow, SNMP, Syslog

set system flow-accounting interface eth0
set system flow-accounting netflow server 192.168.10.10 port 2055
set service snmp community public authorization ro
set service snmp listen-address 0.0.0.0
set system syslog host 192.168.10.20 facility all level info
set system syslog host 192.168.10.20 transport tls

Prometheus Monitoring Integration

VyOS hỗ trợ xuất số liệu qua SNMP hoặc exporter container.

Lab thực hành: Dual-WAN Load Balancing + QoS

  1. Cấu hình hai WAN interface (eth1, eth2) với rule cân bằng tải.
  2. Thiết lập interface-health kiểm tra ping.
  3. Cấu hình QoS shaper cho eth0, ưu tiên traffic cần thiết.
  4. Kiểm tra failover bằng cách ngắt một WAN.
  5. Kiểm tra NetFlow, SNMP, syslog gửi về server giám sát.
# Kiểm tra trạng thái load balancing
show load-balancing wan
# Kiểm tra QoS
show qos
# Kiểm tra flow-accounting
show system flow-accounting

Tổng kết

Bài này giúp bạn cấu hình cân bằng tải WAN, QoS, giám sát lưu lượng trên VyOS, thực hành dual-WAN, cấu hình NetFlow, SNMP, syslog, Prometheus để vận hành hệ thống mạng chuyên nghiệp.