DynagenでCCIEを目指す
20100826 VRRP
最終更新:
it_certification
-
view
1. 目的
- VRRPを設定する方法を確認します。
2. 構成
2.1. 設定概要
- 初期設定はIPアドレスのみです。
2.2. 構成図

2.3. netファイル
model = 3660 [localhost] [[3660]] image = C:\Program Files\Dynamips\images\c3660-ik9o3s-mz.124-6.T.bin ram = 128 [[ROUTER R1]] f0/0 = LAN 1 [[ROUTER R2]] f0/0 = LAN 1 f0/1 = LAN 2 [[ROUTER R3]] f0/0 = LAN 1 f0/1 = LAN 2 [[ROUTER R4]] f0/1 = LAN 2
2.4. 初期設定
- R1
! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ! ! ip cef no ip domain lookup ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 ip address 192.168.1.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- R2
! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ! ! ip cef no ip domain lookup ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 ip address 192.168.1.2 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.2.2 255.255.255.0 duplex auto speed auto ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- R3
! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R3 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ! ! ip cef no ip domain lookup ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 ip address 192.168.1.3 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.2.3 255.255.255.0 duplex auto speed auto ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- R4
! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R4 ! boot-start-marker boot-end-marker ! ! no aaa new-model ! resource policy ! memory-size iomem 5 ! ! ip cef no ip domain lookup ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.2.4 255.255.255.0 duplex auto speed auto ! ip http server no ip http secure-server ! ! ! no cdp run ! ! ! control-plane ! ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
3. [検証] VRRP 仮想IPと実IPが異なる場合
3.1. VRRP 設定
VRRPの設定は、HSRPと殆ど同じです。異なる点と言えば、trackingを設定する際にobject trackingの定義が必要になる事くらいです(HSPRのように「standby <num> track <I/F> <priority>」と指定することはできません)。
R2(config)#track 1 interface FastEthernet 0/1 line-protocol R2(config-track)#exit R2(config)# R2(config)# R2(config)#interface FastEthernet 0/0 R2(config-if)#vrrp 1 ip 192.168.1.254 R2(config-if)# *Mar 1 00:14:02.803: %VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Init -> Backup *Mar 1 00:14:06.415: %VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Backup -> Master R2(config-if)#vrrp 1 priority 200 R2(config-if)#vrrp 1 preempt delay minimum 30 R2(config-if)#vrrp 1 track 1 decrement 60 R2(config-if)#vrrp 1 authentication text HOGE R2(config-if)#vrrp 1 timers advertise 1 R3(config)#track 1 interface FastEthernet 0/1 line-protocol R3(config-track)#exit R3(config)# R3(config)# R3(config)#interface FastEthernet 0/0 R3(config-if)#vrrp 1 ip 192.168.1.254 R3(config-if)# *Mar 1 00:15:56.435: %VRRP-6-STATECHANGE: Fa0/0 Grp 1 state Init -> Backup R3(config-if)#vrrp 1 priority 150 R3(config-if)#vrrp 1 preempt delay minimum 30 R3(config-if)#vrrp 1 track 1 decrement 60 R3(config-if)#vrrp 1 authentication text HOGE R3(config-if)#vrrp 1 timers advertise 1
3.2. VRRP 確認
show vrrpコマンドで設定を確認する事ができます。
R3#show vrrp FastEthernet0/0 - Group 1 State is Backup Virtual IP address is 192.168.1.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1.000 sec Preemption enabled, delay min 30 secs Priority is 150 Track object 1 state Up decrement 60 Authentication text "HOGE" Master Router is 192.168.1.2, priority is 200 Master Advertisement interval is 1.000 sec Master Down interval is 3.414 sec (expires in 2.926 sec) R3#
4. [検証] VRRP 仮想IPと実IPが同じ場合
4.1. VRRP 設定
VRRPは、HSRP, GLBPと異なり、仮想IPと実IPに同じアドレスを使用する事もできます。その場合は、priorityという概念はなく(priorityを設定すると、「設定しても意味ないよ」と警告のメッセージを表示してくれます)、仮想IPと実IPが同じルータがmasterになります。
R2(config)#interface FastEthernet 0/1 R2(config-if)#vrrp 2 ip 192.168.2.2 R2(config-if)# *Mar 1 00:23:52.151: %VRRP-6-STATECHANGE: Fa0/1 Grp 2 state Init -> Master R2(config-if)#vrrp 2 priority 200 % Priority change will have no effect whilst interface is VRRP address owner R2(config-if)# R3(config)#interface FastEthernet 0/1 R3(config-if)#vrrp 2 ip 192.168.2.2 R3(config-if)# *Mar 1 00:21:22.619: %VRRP-6-STATECHANGE: Fa0/1 Grp 2 state Init -> Backup R3(config-if)#vrrp 2 priority 150
4.2. VRRP 確認
show vrrpコマンドで設定を確認する事ができます。
R2#show vrrp FastEthernet0/0 - Group 1 State is Master Virtual IP address is 192.168.1.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1.000 sec Preemption enabled, delay min 30 secs Priority is 200 Track object 1 state Up decrement 60 Authentication text "HOGE" Master Router is 192.168.1.2 (local), priority is 200 Master Advertisement interval is 1.000 sec Master Down interval is 3.218 sec FastEthernet0/1 - Group 2 State is Master Virtual IP address is 192.168.2.2 Virtual MAC address is 0000.5e00.0102 Advertisement interval is 1.000 sec Preemption enabled Priority is 255 (cfgd 200) Master Router is 192.168.2.2 (local), priority is 255 Master Advertisement interval is 1.000 sec Master Down interval is 3.003 sec R2#
添付ファイル