Technical documentation
发布日期:2023-10-27 浏览次数:1707 来源:杨广成
思科CCNP EI方向培训笔记实验-HSRP协议详细配置案例演示
关注【WOLF-LAB实验室】思科认证EI CCNP循环开班,连续网站客服咨询考试、学习事宜
如图所示,配置对应的接口地址,并在R1 R2 R3上运行OSPF,宣告进Area 0。
R1: router ospf 1 router-id 1.1.1.1 network 1.1.12.1 0.0.0.0 area 0 network 1.1.13.1 0.0.0.0 area 0 network 1.1.1.1 0.0.0.0 area 0 | |
R2: router ospf 1 router-id 2.2.2.2 network 1.1.12.0 0.0.0.255 area 0 network 1.1.234.0 0.0.0.255 area 0 | R3: router ospf 1 router-id 3.3.3.3 network 1.1.13.0 0.0.0.255 area 0 network 1.1.234.0 0.0.0.255 area 0 |
2. 在R2和R3之间配置HSRP,虚拟ip地址为1.1.234.254。在R2和R3上show standby观察HSRP的状态信息。
R2 R3: interface FastEthernet0/0 standby 1 ip 1.1.234.254 //先在R2上配置,再在R3上配置。 |
R2#show standby FastEthernet0/0 - Group 1 State is Active //R2的状态为Active,Active/Standby默认是关抢占的,先在R2上做的配置。 2 state changes, last state change 00:00:40 Virtual IP address is 1.1.234.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (default) Hello time 3 sec, hold time 10 sec Next hello sent in 1.200 secs Preemption disabled Active router is local Standby router is 1.1.234.3, priority 100 (expires in 8.812 sec) Priority 100 (default 100) IP redundancy name is "hsrp-Fa0/0-1" (default)
R3#show standby FastEthernet0/0 - Group 1 State is Standby //R3的状态为Standby 1 state change, last state change 00:01:38 Virtual IP address is 1.1.234.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (default) Hello time 3 sec, hold time 10 sec Next hello sent in 0.556 secs Preemption disabled Active router is 1.1.234.2, priority 100 (expires in 6.952 sec) Standby router is local Priority 100 (default 100) IP redundancy name is "hsrp-Fa0/0-1" (default) |
3. 在R2和R3上开启HSRP的抢占,并配置R3接口的优先级为103,R3的状态应该是Active。关闭R4的路由功能,让其模拟主机,配置R4的默认网关为1.1.234.254。此时在R4上traceroute 1.1.1.1。
R2: interface FastEthernet0/0 standby 1 preempt |
R3: interface FastEthernet0/0 standby 1 priority 103 standby 1 preempt |
R3: FastEthernet0/0 - Group 1 State is Active 2 state changes, last state change 00:00:19 Virtual IP address is 1.1.234.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (default) Hello time 3 sec, hold time 10 sec Next hello sent in 1.340 secs Preemption enabled Active router is local Standby router is 1.1.234.2, priority 100 (expires in 9.356 sec) Priority 103 (configured 103) IP redundancy name is "hsrp-Fa0/0-1" (default) |
R4: R4#traceroute 1.1.1.1 Tracing the route to 1.1.1.1 1 1.1.234.3 56 msec 36 msec 20 msec 2 1.1.13.1 16 msec * 32 msec |
4. 在R3上开启针对上行接口的跟踪,若是上行接口down掉,让R2成为Acitve状态。此时在R4上traceroute 1.1.1.1,观察现象。
R3: interface FastEthernet0/0 standby 1 track Serial1/1 15 //R3的上行接口S1/1down掉,R3的priority减15。
interface Serial1/1 shutdown
R3: show standby FastEthernet0/0 - Group 1 State is Standby 4 state changes, last state change 00:00:07 Virtual IP address is 1.1.234.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (default) Hello time 3 sec, hold time 10 sec Next hello sent in 1.592 secs Preemption enabled Active router is 1.1.234.2, priority 100 (expires in 7.620 sec) Standby router is local Priority 88 (configured 103) Track interface Serial1/1 state Down decrement 15 IP redundancy name is "hsrp-Fa0/0-1" (default) |
R4: R4#traceroute 1.1.1.1 Tracing the route to 1.1.1.1 1 1.1.234.2 56 msec 36 msec 20 msec 2 1.1.13.1 16 msec * 32 msec |
5. 删除第4题针对上行接口的跟踪。在R3上开启针对1.1.1.1/32路由metric的跟踪,若是R3路由表中看到此路由下一跳为R2,让R2成为Active状态。在R3上将S1/1接口shutdown,在R4上traceroute 1.1.1.1,观察现象。
R3: interface FastEthernet0/0 no standby 1 track Serial1/1 15
track 1 ip route 1.1.1.1 255.255.255.255 metric threshold //定义track事件 threshold metric up 65 down 66
interface FastEthernet0/0 standby 1 track 1 decrement 15 //调用track事件
interface Serial1/1 shutdown |
R2: show standby FastEthernet0/0 - Group 1 State is Active 8 state changes, last state change 00:02:08 Virtual IP address is 1.1.234.254 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (default) Hello time 3 sec, hold time 10 sec Next hello sent in 1.004 secs Preemption enabled Active router is local Standby router is 1.1.234.3, priority 88 (expires in 8.996 sec) Priority 100 (default 100) IP redundancy name is "hsrp-Fa0/0-1" (default)
R4#traceroute 1.1.1.1 Tracing the route to 1.1.1.1 1 1.1.234.2 56 msec 36 msec 20 msec 2 1.1.13.1 16 msec * 32 msec |
6. 在R2和R3上删除HSRP的配置。在R2和R3上分别配置Group1和Group2的HSRP,虚拟IP地址分别为1.1.234.253,1.1.234.254。确保R2成为Group1的Active状态,R3成为Group2的Active状态。将R4的默认网关配置为1.1.234.253,关闭R5的路由功能,让其模拟主机,配置默认网关为1.1.234.254。在R4和R5上traceroute 1.1.1.1,观察现象。
R2 R3: interface FastEthernet0/0 no standby 1 | ||
R2: interface FastEthernet0/0 standby 1 ip 1.1.234.253 standby 1 priority 101 standby 1 preempt standby 2 ip 1.1.234.254 | R3: interface FastEthernet0/0 standby 1 ip 1.1.234.253 standby 2 ip 1.1.234.254 standby 2 priority 101 standby 2 preempt | |
R2: show standby FastEthernet0/0 - Group 1 State is Active 1 state change, last state change 00:01:53 Virtual IP address is 1.1.234.253 Active virtual MAC address is 0000.0c07.ac01 Local virtual MAC address is 0000.0c07.ac01 (default) Hello time 3 sec, hold time 10 sec Next hello sent in 0.456 secs Preemption enabled Active router is local Standby router is 1.1.234.3, priority 100 (expires in 9.296 sec) Priority 101 (configured 101) IP redundancy name is "hsrp-Fa0/0-1" (default)
FastEthernet0/0 - Group 2 State is Standby 4 state changes, last state change 00:01:15 Virtual IP address is 1.1.234.254 Active virtual MAC address is 0000.0c07.ac02 Local virtual MAC address is 0000.0c07.ac02 (default) Hello time 3 sec, hold time 10 sec Next hello sent in 2.036 secs Preemption disabled Active router is 1.1.234.3, priority 101 (expires in 8.016 sec) Standby router is local Priority 100 (default 100) IP redundancy name is "hsrp-Fa0/0-2" (default) | ||
R4: traceroute 1.1.1.1 Tracing the route to 1.1.1.1 1 1.1.234.2 56 msec 36 msec 20 msec 2 1.1.13.1 16 msec * 32 msec | R5: traceroute 1.1.1.1 Tracing the route to 1.1.1.1 1 1.1.234.3 56 msec 36 msec 20 msec 2 1.1.13.1 16 msec * 32 msec |
7. 删除第6题的配置。在R2和R3上配置VRRP,虚拟ip地址为1.1.234.254。观察现象,并比较VRRP与HSRP的不同之处。
R2 R3: interface FastEthernet0/0 no standby 1 no standby 2
interface FastEthernet0/0 vrrp 1 ip 1.1.234.254 |
R2: show vrrp FastEthernet0/0 - Group 1 State is Backup Virtual IP address is 1.1.234.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1.000 sec Preemption enabled //VRRP默认开启抢占 Priority is 100 Master Router is 1.1.234.3, priority is 100 Master Advertisement interval is 1.000 sec Master Down interval is 3.609 sec (expires in 3.297 sec)
R3: show vrrp FastEthernet0/0 - Group 1 State is Master Virtual IP address is 1.1.234.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1.000 sec Preemption enabled //VRRP默认开启抢占 Priority is 100 Master Router is 1.1.234.3 (local), priority is 100 Master Advertisement interval is 1.000 sec //Master每1秒发通告消息,Hold时间为3秒 Master Down interval is 3.609 sec |
R4: traceroute 1.1.1.1 Tracing the route to 1.1.1.1 1 1.1.234.3 40 msec 32 msec 20 msec 2 1.1.13.1 20 msec * 20 msec |
8. 删除第7题的配置。在R2和R3上配置GLBP,虚拟ip地址为1.1.234.254,确保R2成为AVG Active,将R4和R5的默认网关均配置为1.1.234.254,在R4和R5上traceroute 1.1.1.1,观察现象。
R2 R3: interface FastEthernet0/0 no vrrp 1 | ||
R2: interface FastEthernet0/0 glbp 1 ip 1.1.234.254 glbp 1 priority 101 glbp 1 preempt | R3: interface FastEthernet0/0 glbp 1 ip 1.1.234.254
| |
R2: show glbp FastEthernet0/0 - Group 1 State is Active //AVG的状态Active 2 state changes, last state change 00:01:25 Virtual IP address is 1.1.234.254 Hello time 3 sec, hold time 10 sec Next hello sent in 1.180 secs Redirect time 600 sec, forwarder time-out 14400 sec Preemption enabled, min delay 0 sec Active is local Standby is 1.1.234.3, priority 100 (expires in 7.204 sec) Priority 101 (configured) Weighting 100 (default 100), thresholds: lower 1, upper 100 Load balancing: round-robin There are 2 forwarders (1 active) Forwarder 1 State is Active //AVF1的状态Active 1 state change, last state change 00:01:15 MAC address is 0007.b400.0101 (default) Owner ID is ca02.0544.0000 Redirection enabled Preemption enabled, min delay 30 sec Active is local, weighting 100 Forwarder 2 State is Listen MAC address is 0007.b400.0102 (learnt) Owner ID is ca04.37d8.0000 Redirection enabled, 599.948 sec remaining (maximum 600 sec) Time to live: 14399.944 sec (maximum 14400 sec) Preemption enabled, min delay 30 sec Active is 1.1.234.3 (primary), weighting 100 (expires in 9.936 sec) R3: show glbp FastEthernet0/0 - Group 1 State is Standby //AVG的状态Standby 1 state change, last state change 00:02:34 Virtual IP address is 1.1.234.254 Hello time 3 sec, hold time 10 sec Next hello sent in 1.352 secs Redirect time 600 sec, forwarder time-out 14400 sec Preemption disabled Active is 1.1.234.2, priority 101 (expires in 9.352 sec) Standby is local Priority 100 (default) Weighting 100 (default 100), thresholds: lower 1, upper 100 Load balancing: round-robin There are 2 forwarders (1 active) Forwarder 1 State is Listen MAC address is 0007.b400.0101 (learnt) Owner ID is ca02.0544.0000 Time to live: 14399.352 sec (maximum 14400 sec) Preemption enabled, min delay 30 sec Active is 1.1.234.2 (primary), weighting 100 (expires in 9.352 sec) Forwarder 2 State is Active 1 state change, last state change 00:02:44 MAC address is 0007.b400.0102 (default) Owner ID is ca04.37d8.0000 Preemption enabled, min delay 30 sec Active is local, weighting 100 | ||
R4: traceroute 1.1.1.1 Tracing the route to 1.1.1.1 1 1.1.234.2 40 msec 32 msec 20 msec 2 1.1.13.1 20 msec * 20 msec | R5: traceroute 1.1.1.1 Tracing the route to 1.1.1.1 1 1.1.234.3 40 msec 32 msec 20 msec 2 1.1.13.1 20 msec * 20 msec |
WOLFLAB官方微信:17316362402
WOLFLAB官方QQ:2569790740
思科认证EI CCNP培训课程0基础可入门学习,考试咨询联系WOLF-LAB网络技术实验室网站客服