Article title: using VRRP to implement simple router backup (figure ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Sometimes, to ensure the stability and reliability of our network, we may apply for two egress links and use two routers. When one of the routers fails to work normally, another router takes over the corresponding work. The principle of implementation is to use the VRRP (Virtual Router Redundancy Protocol) Protocol described in RFC2338. The implementation tool is keepalived.
Lab name: vro backup with VRRP
OS: RedHat 7.3
Kernel used: linux-2.4.24
Module used in the experiment: keepalived-1.16.tar.gz (if you do not know much about VRRP and Keepalived, first look here)
Shows the network structure. in the figure, V-Gate is the VIP in VRRP.
There are two Linux Router in the network:
(1), Master (eth0: 192.168.1.10/24 connected to the Internet; eth1: 192.168.3.1/24 connected to the intranet)
(2), Backup (eth0: 192.168.2.10/24 connected to the Internet; eth1: 192.168.3.2/24 connected to the intranet)
The intranet IP address segment is 192.168.3.0/24, and the Gateway (V-Gate) is 192.168.3.3/24. remember that the address 192.168.3.3/24 takes effect when Keepalived is started.
First, install keepalived-1.1.6.tar.gz on Linux Router master.
The methods for installing keepalived on Linux Router Backup are the same. The difference is that the configuration file/usr/local/keepalived/etc/keepalived. conf is as follows:
Before starting keepalived on the Master, let's take a look at the eth1 situation on the Master:
--------------------------------------------------------------
# Ip add show eth1
8: eth1: Mtu 1500 qdisc pfifo_fast qlen 1000
Link/ether 00: e0: 4c: 3a: d7: 25 brd ff: ff
Inet 192.168.3.1/24 brd 192.168.3.255 scope global eth1
Inet6 fe80: 2e0: 4cff: fe3a: d725/64 scope link
--------------------------------------------------------------
We can see that there is only one IP address: 192.168.3.1/24. now we start keepalived on the Master.
#/Usr/local/keepalived/sbin/keepalived? D? F/usr/local/keepalived/etc/keepalived. conf
Now let's look at the eth1 situation on the Master:
--------------------------------------------------------------
# Ip add show eth1
8: eth1: Mtu 1500 qdisc pfifo_fast qlen 1000
Link/ether 00: e0: 4c: 3a: d7: 25 brd ff: ff
Inet 192.168.3.1/24 brd 192.168.3.255 scope global eth1
Inet 192.168.3.3/32 scope global eth1
Inet6 fe80: 2e0: 4cff: fe3a: d725/64 scope link
---------------------------------------------------------------
We can see two IP addresses, one of which is V-Gate: 192.168.3.3/32.
Start keepalived on Backup in the same way
#/Usr/local/keepalived/sbin/keepalived? D? F/usr/local/keepalived/etc/keepalived. conf
In this way, when the Master fails, Backup will obtain the message through the MultiCast address: 224.0.0.18 and take over the address 192.168.3.3.
To sum up, please pay attention to the topic "using the VRRP function of Keepalived to implement simple router backup", instead of route backup. The purpose of this experiment is to familiarize everyone with the VRRP protocol and how to use Keepalived to implement the VRRP protocol.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.