در سری سناریو های سیسکو امروز می خواهیم آموزش راه اندازی VRRP در روتر و سویچ سیسکو می پردازیم . ابتدا سناریو را تشریح می کنیم و روش حل مسئله را باز می کنیم و با هم این سناریو را انجام می دهیم : در ادامه سناریو قبل ، میخواهیم دقیقا" همان سناریو و همان خواسته ها را اینبار با پروتکل VRRP انجام دهیم :
مجموعه دوره آموزش سیسکو (Cisco) - مقدماتی تا پیشرفته
- کانفیگ های معمول ، مثل IP دادن به اینترفیس ها و تنظیم IP و G.W در کلاینت ها و مبحث IVR در روتر را انجام دهید.
- می خواهیم از پروتکل VRRP استفاده کنیم و بین 2 روتر LOAD-BLANCING داشته باشیم.
- همانطور که پیداست روتر 1 برای VLAN 2 و روتر 2 برای VLAN 4 نقش MASTER را پذیراست.
- در هر 2 سمت TRACK بنویسید که در صورت از کار افتادن لینک پشت روتر طرف مقابل ، روتر دیگر بلافاصله MASTER شود.
- بین روتر ها احراز هویتی از نوع MD5 استفاده کنید.
R1(config)#
R1(config)#
R1(config)#INT ETH 0/0
R1(config-if)#NO SHUT
R1(config-if)#
R1(config-if)#TRACK 1 INT ETH 0/0 LINE-PR
R1(config-track)#DELAY DOWN 5
R1(config-track)#
R1(config-track)#INT ETH 0/1
R1(config-if)#NO SHUT
R1(config-if)#
R1(config-if)#INT ETH 0/1.2
R1(config-subif)#ENCAPSULATION DOT1Q 2
R1(config-subif)#IP ADD 192.168.2.10 255.255.255.0
R1(config-subif)#
R1(config-subif)#
R1(config-subif)#INT ETH 0/1.4
R1(config-subif)#ENCAPSULATION DOT1Q 4
R1(config-subif)#IP ADD 192.168.4.10 255.255.255.0
R1(config-subif)#
R1(config-subif)#
R1#SHOW IP INT BRief
Interface IP-Address OK? Method Status Protocol
Ethernet0/1.2 192.168.2.10 YES manual up up
Ethernet0/1.4 192.168.4.10 YES manual up up
R2#
R2#
R2#!R2
R2#EN
R2#CONF T
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#
R2(config)#INT ETH 0/0
R2(config-if)#NO SHUT
R2(config-if)#
R2(config-if)#TRACK 2 INT ETH 0/0 LINE-PR
R2(config-track)#DELAY DOWN 5
R2(config-track)#
R2(config-track)#INT ETH 0/2
R2(config-if)#NO SHUT
R2(config-if)#
R2(config-if)#INT ETH 0/2.2
R2(config-subif)#ENCAPSULATION DOT1Q 2
R2(config-subif)#IP ADD 192.168.2.11 255.255.255.0
R2(config-subif)#
R2(config-subif)#INT ETH 0/2.4
R2(config-subif)#ENCAPSULATION DOT1Q 4
R2(config-subif)#IP ADD 192.168.4.11 255.255.255.0
R2(config-subif)#
R2(config-subif)#
R2#SHOW IP INT BRief
Interface IP-Address OK? Method Status Protocol
Ethernet0/2.2 192.168.2.11 YES manual up up
Ethernet0/2.4 192.168.4.11 YES manual up up
SW#SHOW RUN
!
!
!
interface Ethernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface Ethernet0/2
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface Ethernet0/3
!
interface Ethernet1/0
switchport access vlan 2
switchport mode access
!
interface Ethernet1/1
switchport access vlan 4
switchport mode access
2.کانفیگ پروتکل VRRP با قابلیت LOAD-BALANCING
- کانفیگ پروتکل VRRP در روتر R1
R1(config)#
R1(config)#!VRRP
R1(config)#
R1(config)#INT ETH 0/1.2
R1(config-subif)#VRRP 2 IP 192.168.2.1
R1(config-subif)#VRRP 2 PRIORITY 200
R1(config-subif)#
R1(config-subif)#INT ETH 0/1.4
R1(config-subif)#VRRP 4 IP 192.168.4.1
R1(config-subif)#VRRP 4 PRIORITY 150
R1(config-subif)#
- کانفیگ پروتکل VRRP در روتر R2
R2(config)#
R2(config)#!VRRP
R2(config)#
R2(config)#INT ETH 0/2.2
R2(config-subif)#VRRP 2 IP 192.168.2.1
R2(config-subif)#VRRP 2 PRIORITY 150
R2(config-subif)#
R2(config-subif)#INT ETH 0/2.4
R2(config-subif)#VRRP 4 IP 192.168.4.1
R2(config-subif)#VRRP 4 PRIORITY 200
R2(config-subif)#
R1#
R1#
R1#SHOW VRRP BR
R1#SHOW VRRP BRief
Interface Grp Pri Time Own Pre State Master addr Group addr
Et0/1.2 2 200 3218 Y Master 192.168.2.10 192.168.2.1
Et0/1.4 4 150 3414 Y Backup 192.168.4.11 192.168.4.1
R1#
R2#
R2#
R2#SHOW VRRP BR
R2#SHOW VRRP BRief
Interface Grp Pri Time Own Pre State Master addr Group addr
Et0/2.2 2 150 3414 Y Backup 192.168.2.10 192.168.2.1
Et0/2.4 4 200 3218 Y Master 192.168.4.11 192.168.4.1
R2#
R2#
3.نوشتن TRACK بدینصورت که در صورت از کار افتادن لینک پشت روتر طرف مقابل ، روتر دیگر بلافاصله MASTER شود.
R1(config)#
R1(config)#!TRACK
R1(config)#
R1(config)#TRACK 1 INT ETH 0/0 LINE-PR
R1(config-track)#DELAY DOWN 5
R1(config-track)#
R1(config-track)#INT ETH 0/1.2
R1(config-subif)#VRRP 2 TRACK 1 DECREMENT 100
R1(config-subif)#
R1(config-subif)#INT ETH 0/1.4
R1(config-subif)#VRRP 4 TRACK 1 DECREMENT 100
R1(config-subif)#
R1(config-subif)#
R1(config-subif)#EXIT
R1(config)#EXIT
R1#
R1#
*Apr 16 10:40:47.421: %SYS-5-CONFIG_I: Configured from console by console
R1#
R1#SHOW TRACK
Track 1
Interface Ethernet0/0 line-protocol
Line protocol is Up
3 changes, last change 02:27:28
Delay down 5 secs
Tracked by:
VRRP Ethernet0/1.2 2
VRRP Ethernet0/1.4 4
R1#
R1#
R2(config)#
R2(config)#!TRACK
R2(config)#
R2(config)#TRACK 2 INT ETH 0/0 LINE-PR
R2(config-track)#DELAY DOWN 5
R2(config-track)#
R2(config-track)#INT ETH 0/2.2
R2(config-subif)#VRRP 2 TRACK 2 DECREMENT 100
R2(config-subif)#
R2(config-subif)#INT ETH 0/2.4
R2(config-subif)#VRRP 4 TRACK 2 DECREMENT 100
R2(config-subif)#
R2(config-subif)#
R2(config-subif)#EXIT
R2(config)#EXIT
R2#
R2#S
*Apr 16 10:42:14.599: %SYS-5-CONFIG_I: Configured from console by console
R2#SHOW TRACK
Track 2
Interface Ethernet0/0 line-protocol
Line protocol is Up
3 changes, last change 02:23:37
Delay down 5 secs
Tracked by:
VRRP Ethernet0/2.2 2
VRRP Ethernet0/2.4 4
R2#
R2#
تست کردن مبحث TRACK
R1#
R1#SHOW STAN
R1#SHOW VRRP BR
R1#SHOW VRRP BRief
Interface Grp Pri Time Own Pre State Master addr Group addr
Et0/1.2 2 200 3218 Y Master 192.168.2.10 192.168.2.1
Et0/1.4 4 150 3414 Y Backup 192.168.4.11 192.168.4.1
R1#
R1#
R1#
R2#
R2#
R2#SHOW VRRP BR
R2#SHOW VRRP BRief
Interface Grp Pri Time Own Pre State Master addr Group addr
Et0/2.2 2 150 3414 Y Backup 192.168.2.10 192.168.2.1
Et0/2.4 4 200 3218 Y Master 192.168.4.11 192.168.4.1
R2#
R2#
R2#
R2(config)#INT ETH 0/0
R2(config-if)#SHU
R2(config-if)#SHUtdown
R2(config-if)#EXIT
R2(config)#EXI
R2(config)#EXIT
R2#
R2#
R2#
R2#SHOW VRRP BRief
Interface Grp Pri Time Own Pre State Master addr Group addr
Et0/2.2 2 50 3414 Y Backup 192.168.2.10 192.168.2.1
Et0/2.4 4 100 3218 Y Backup 192.168.4.10 192.168.4.1
R2#
R2#
R1#
R1#
R1#SHOW VRRP BRief
Interface Grp Pri Time Own Pre State Master addr Group addr
Et0/1.2 2 200 3218 Y Master 192.168.2.10 192.168.2.1
Et0/1.4 4 150 3414 Y Master 192.168.4.10 192.168.4.1
R1#
R1#
R1#
R2(config)#
R2(config)#INT ETH 0/0
R2(config-if)#NO SHU
R2(config-if)#NO SHUtdown
R2(config-if)#
R2(config-if)#
R2(config-if)#
R2#
R2#
R2#
R2#
R2#
R2#
R2#
*Apr 16 10:45:28.751: %TRACKING-5-STATE: 2 interface Et0/0 line-protocol Down->Up
*Apr 16 10:45:29.732: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Apr 16 10:45:30.746: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Apr 16 10:45:31.493: %VRRP-6-STATECHANGE: Et0/2.4 Grp 4 state Backup -> Master
R2#
R2#
*Apr 16 10:45:31.752: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
R2#
R2#
R2#
R2#SHOW VRRP BRief
Interface Grp Pri Time Own Pre State Master addr Group addr
Et0/2.2 2 150 3414 Y Backup 192.168.2.10 192.168.2.1
Et0/2.4 4 200 3218 Y Master 192.168.4.11 192.168.4.1
R2#
R2#
نهایتا" قرار شد بین روتر ها AUTHENTICATION از نوع MD5 داشته باشیم
R1(config)#
R1(config)#
R1(config)#!AUTHENTICATION
R1(config)#
R1(config)#INT ETH 0/1.2
R1(config-subif)#VRRP 2 AUTHENTICATION MD5 KEY-STRING CISCO
R1(config-subif)#
R1(config-subif)#INT ETH 0/1.4
R1(config-subif)#VRRP 4 AUTHENTICATION MD5 KEY-STRING CISCO
R1(config-subif)#
R2(config)#
R2(config)#!----------------------------------------
R2(config)#!AUTHENTICATION
R2(config)#
R2(config)#INT ETH 0/2.2
R2(config-subif)#VRRP 2 AUTHENTICATION MD5 KEY-STRING CISCO
R2(config-subif)#
R2(config-subif)#INT ETH 0/2.4
R2(config-subif)#VRRP 4 AUTHENTICATION MD5 KEY-STRING CISCO
R2(config-subif)#
R2(config-subif)#