Wednesday, February 23, 2011

Use of VRRP feature simple router backup

Sometimes in order to guarantee that our network stability and reliability, may apply for two export link, use the two routers.

In a router fails, another router to take over the work. Implementation of the principle of which is described in using RFC2338 VRRP (VirtualRouterRedundancyProtocol) Protocol. Implementation of tools is keepalived. Experiment name: use of VRRP feature simple router backup operating system: kernel RedHat7.3: used by the linux-2.4.24 experiment used module: keepalived-1.16.tar.gz (if on VRRP and Keepalived not quite understand, take a look at here) network structure as shown in the figure below: map V-Gate is the VIP VRRP. The network has two LinuxRouter: (1), Master (eth0: 192.168.1.10/24 received outside the network; the eth1: 192.168.3.1/24 add intranet) (2), Backup (eth0: 192.168.2.10/24 received outside the network; the eth1: 192.168.3.2/24 add intranet) intranet IP addresses as 192.168.3.0/24, gateway (V-Gate) 192.168.3.3/24, remember 192.168.3.3/24 this address is in effect at the time Keepalived start. First we install the LinuxRouterMaster keepalived-1.1.6.tar.gz (1), download keepalived-1.1.6.tar.gz (http://www.keepalived.org) (2), unzip: # tarzxvfkeepalived-1.1.6.tar.gz (3) compiled keepalived # cdkeepalived-1.1.6 #./configure-prefix =/usr/local/keepalived # make install (4) keepalived # makeinstall (5) configure LinuxRouterMaster of VRRP, # vi/usr/local/etc/keepalived/keepalived/keepalived.con reads as follows:--------------------------------------------------------------------------------vrrp_instanceVI_1 {stateMASTER interfaceet1 virtual_router_id51 priority100 advert_int1 authentication {auth_typePASS auth_pass1111} virtual_ipaddress {192.168.3.3}}--------------------------------------------------------------------------------keepalived in LinuxRouterBackup install is the same, except that the profile/usr/local/keepalived/etc/keepalived/keepalived.conf, as follows:--------------------------------------------------------------------------------vrrp_instanceVI_1 {stateBACKUP interfaceet1 virtual_router_id51 priority100 advert_int1 authentication {auth_typePASS auth_pass1111} virtual_ipaddress {192.168.3.3}}--------------------------------------------------------------------------------at the start of the keepalived on Master, we first look on eth1 Master:--------------------------------------------------------------# ipaddshowet1 8: eth1: mtu1500qdiscpfifo_fastqlen1000 link/ether00: e0: 4c: 3a: d7: 25brdff: ff: ff: ff: f:f inet192.168.3.1/24brd192.168.3.255scopeglobalet1Inet6fe80:: 2e0: 4cff: fe3a: d725/64scopelink--------------------------------------------------------------we see only one IP address: 192.168.3.1/24, now we start the Master of the keepalived #/usr/local/keepalived/sbin/keepalived-D-f/usr/local/etc/keepalived/keepalived/keepalived.con now let's take a look at the situation of the Master on eth1:--------------------------------------------------------------# ipaddshowet1 8: eth1: mtu1500qdiscpfifo_fastqlen1000 link/ether00: e0: 4c: 3a: d7: 25brdff: ff: ff: ff: f:f inet192.168.3.1/24brd192.168.3.255scopeglobalet1 inet192.168.3.3/32scopeglobalet1 inet6fe80:: 2e0: 4cff: fe3a: d725/64scopelink---------------------------------------------------------------we saw two IP addresses, one of which is V-Gate: 192.168.3.3/32 using the same method to start the Backup of the keepalived #/usr/local/keepalived/sbin/keepalived-D-f/usr/local/etc/keepalived/keepalived/keepalived.con so that when the Master fails, the Backup will pass the MultiCast address: 224.0.0.18 this multicast address, get the news, and will take over the address 192.168.3.3. Summing up, draw your attention to our title of this experiment "use of VRRP Keepalived implements simple router function backup", instead of routing the backup. The purpose of this experiment is to let everyone familiar with VRRP Protocol and how to use Keepalived implements VRRP Protocol.

No comments:

Post a Comment