Professional Documents
Culture Documents
ChatGPT
Poe
Để cấu hình Multi-VRRPv3 với load sharing trên hai router MikroTik, chúng ta có thể sử dụng tính năng tracking để điều chỉnh ưu tiên
(priority) dựa trên trạng thái giao diện mạng. Dưới đây là một ví dụ về cấu hình Multi-VRRPv3 với load sharing trên hai router R1 và R2,
sử dụng VRID là 1 và địa chỉ IP ảo là 192.168.1.1/24:
Router R1:
Router R2:
Trong ví dụ này, chúng ta sử dụng hai giao diện mạng ether2 và ether3 để thực hiện load sharing. Cả R1 và R2 đều đặt ưu tiên là 100 và 90
tương ứng. Tuy nhiên, thông qua việc sử dụng tracking và weight, chúng ta có thể điều chỉnh ưu tiên dựa trên trạng thái của giao diện
mạng.
Trong trường hợp này, mỗi giao diện mạng được đặt với weight là 50, tổng cộng là 100. Nếu cả hai giao diện mạng đều hoạt động, load sẽ
được chia đều giữa hai router. Nếu một trong hai giao diện mạng không khả dụng, router đó sẽ mất điểm và router còn lại sẽ lấy lại vai trò
bộ định tuyến chính.
Lưu ý rằng cấu hình load sharing và tracking có thể thay đổi tùy thuộc vào mạng và yêu cầu của bạn. Hãy điều chỉnh các giá trị này theo
nhu cầu của bạn và đảm bảo cả hai router được kết nối qua cùng một mạng và chia sẻ địa chỉ IP ảo.
Manual:VRRP-examples
Jump to navigationJump to search
Contents
1.2.1Configuration
1.3.1Configuration
1.3.2Testing
1.4.1Configuration
2See Also
Basic Setup
This is the basic VRRP configuration example.
According to this configuration, as long as the master, R1, is functional, all traffic destined to the external network gets
directed to R1. But as soon as R1 fails, R2 takes over as the master and starts handling packets forwarded to the interface
associated with IP(R1). In this setup Router R2 is completely idle during Backup period.
Configuration
R1 configuration:
R2 configuration:
Testing
First of all check if both routers have correct flags at vrrp interfaces. On router R1 it should look like this
As you can see vrrp interface mac addresses are identical on both routers. Now to check if vrrp is working correctly, try to
ping virtual address from client and check arp entries:
Now unplug ether1 cable on router R1. R2 will become VRRP master, ARP table on client will not change but traffic will start
to flow over R2 router.
Note: In case VRRP is used with Reverse Path Filtering, then it is recommended that rp-filter is set to loose, otherwise the VRRP interface
might not be reachable.
Load sharing
In the basic configuration example, R2 is completely idle during Backup state. This behaviour may be considered as a waste of
valuable resources. In such circumstances R2 router can be set as the gateway for some clients.
The obvious advantage of this configuration is the establishment of a load-sharing scheme. But by doing so R2 router is not
protected by current VRRP setup.
To make this setup work we need two virtual routers.
Configuration for V1 virtual router will be identical to configuration in basic example - R1 is the Master and R2 is Backup
router. In V2 Master is R2 and Backup is R1.
With this configuration, we establish load-sharing between R1 and R2; moreover, we create a protection setup by having two
routers acting as backups for each other.
Configuration
R1 configuration:
R2 configuration:
Configuration
We will be using the same setup as in basic example. Only difference is during configuration set preemption-mode=no. It can
be done easily by modifying the existing configuration:
Testing
Try turning off R1 router, R2 will become Master router because it has the highest priority among available routers.
Now turn R1 router on and you will see that R2 router continues to be the Master even if R1 has the higher priority.
See Also
VRRP
Scripting