Vro backup using VRRP (Figure)

Source: Internet
Author: User
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.
  
Download keepalived-1.1.6.tar.gz (http://www.keepalived.org)
  
(2) decompress:
# Tar zxvf keepalived-1.1.6.tar.gz
  
(3) compile keepalived
# Cd keepalived-1.1.6
#./Configure? Prefix =/usr/local/keepalived
# Make
  
(4) install keepalived
# Make install
  
(5) configure VRRP for the Linux Router Master,
# Vi/usr/local/keepalived/etc/keepalived. conf
The content is as follows:
  
--------------------------------------------------------------------------------
  
Vrrp_instance VI_1 {
State MASTER
Interface eth1
Virtual_router_id 51
Priority100
Advert_int 1
Authentication {
Auth_type PASS
Auth_pass 1111
}
Virtual_ipaddress {
192.168.3.3
}
}
  
--------------------------------------------------------------------------------
  
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:
  
--------------------------------------------------------------------------------
  
Vrrp_instance VI_1 {
State BACKUP
Interface eth1
Virtual_router_id 51
Priority100
Advert_int 1
Authentication {
Auth_type PASS
Auth_pass 1111
}
Virtual_ipaddress {
192.168.3.3
}
}
  
--------------------------------------------------------------------------------
  
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.
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.