4 1 2 VRRP l 4 VRRP p

  • Slides: 63
Download presentation

4. 1. 2 VRRP 作原理 l 第 4页 VRRP相关术语 p VRRP组 p 虚拟IP地址 p

4. 1. 2 VRRP 作原理 l 第 4页 VRRP相关术语 p VRRP组 p 虚拟IP地址 p 虚拟MAC地址 p VRID p Master与Backup p 优先级 p 抢占

4. 1. 3 VRRP配置 p 案例配置过程 n 在路由器接口添加VRRP配置 指定了VRRP备 份组为VRID 10 指定虚拟IP地址 为 10.

4. 1. 3 VRRP配置 p 案例配置过程 n 在路由器接口添加VRRP配置 指定了VRRP备 份组为VRID 10 指定虚拟IP地址 为 10. 1. 1. 254 [R 1]interface g 0/0/0 [R 1 -Gigabit. Ethernet 0/0/0]vrrp vrid 10 virtual-ip 10. 1. 1. 254 [R 1 -Gignbit. Ethernet 0/0/0]vrrp vrid 10 priority 150 [R 2]interface g 0/0/0 [R 2 -Gigahit. Ethernet 0/0/0]vrrp vrid 10 virtual-ip 10. 1. 1. 254 第 11页 调整接口在VRID 10中的优先级为 150 设置备份组VRID 10 的虚拟IP地址

4. 1. 3 VRRP配置 n 检查VRRP状态 VRRP主用路由器 用来传输数据流量 VRRP备用路由器 第 12页 [R 1]display vrrp

4. 1. 3 VRRP配置 n 检查VRRP状态 VRRP主用路由器 用来传输数据流量 VRRP备用路由器 第 12页 [R 1]display vrrp brief Total: 1 Master: 1 Backup: 0 VRID State Interface Non-active: 0 Type Virtual IP 10 Normal Master GE 0/0/0 10. 1. 1. 254 [R 2]display vrrp brief Total: 1 Master: 0 Backup: 1 VRID State Interface Non-active: 0 Type Virtual IP 10 Normal Backup GE 0/0/0 10. 1. 1. 254

4. 1. 3 VRRP配置 查看VRRP版本 [R 1]display vrrp protocol-information VRRP protocol information is shown

4. 1. 3 VRRP配置 查看VRRP版本 [R 1]display vrrp protocol-information VRRP protocol information is shown as below VRRP协议版本 为version 2 VRRP protocol version: v 2 Send advertisement packet node send v 2 only n 检测VRRP连通性及路径 PC 10>ping 172. 16. 1. 1 PING 172. 16. 1. 1: 32 data bytes, press CTRL_C to break Reply from 172. 16. 1. 1: bytes=32 Sequence=1 ttl=254 time=57 ms Reply from 172. 16. 1. 1: bytes=32 Sequence=2 ttl=254 time=45 ms PC 10能够成功 Reply from 172. 16. 1. 1: bytes=32 Sequence=3 ttl=254 time=47 ms 访问Internet设 Reply from 172. 16. 1. 1: bytes=32 Sequence=4 ttl=254 time=42 ms 备 Reply from 172. 16. 1. 1: bytes=32 Sequence=5 ttl=254 time=46 ms n 传输的路径是 PC 10→R 1→GW 第 13页 PC 10>tracert 172. 16. 1. 1 traceroute to 172. 16. 1. 1 , 8 hops max (ICMP), press Ctrl+C to stop 1 10. 1. 1. 251 32 ms 43 ms 32 ms 2 172. 16. 1. 1 56 ms 48 ms 42 ms

4. 1. 3 VRRP配置 n 配置VRRP追踪上行接口状态 在VRRP VRID 10中追 踪接口G 0/0/1的状态 把VRRP VRID 10

4. 1. 3 VRRP配置 n 配置VRRP追踪上行接口状态 在VRRP VRID 10中追 踪接口G 0/0/1的状态 把VRRP VRID 10 的优先级减少 100 [R 1]interface g 0/0/0 [R 1 -Gigabit. Ethernet 0/0/0]vrrp vrid 10 track interface G 0/0/1 reduced 100 n VRRP状态 从主用变 为被用 原因是 G 0/0/1接 口状态变 为 “DOWN” 第 14页 手动关闭路由器R 1的接口G 0/0/1来模拟上行链路故障 [R 1]interface g 0/0/1 [R 1 -Gigabit. Ethernet 0/0/1]shutdown Jan 20 2020 05: 50: 09 -08: 00 R 1 %%01 IFNET/4/LINK_STATE(l)[1]: The line protocol IP on the interface Gigabit. Ethernet 0/0/1 has entered the DOWN state. Jan 20 2020 05: 50: 09 -08: 00 R 1 %%01 VRRP/4/STATEWARNINGEXTEND(l)[2]: Virtual Route r state MASTER changed to BACKUP, because of priority calculation. (Interface=Giga bit. Ethernet 0/0/0, Vr. Id=167772160, Inet. Type=IPv 4) [R 1 -Gigabit. Ethernet 0/0/1] Jan 20 2020 05: 50: 09 -08: 00 R 1 VRRP/2/ VRRPMASTERDOWN: OID 16777216. 50331648. 10066 3296. 16777216. 67108864. 16777216. 3674669056. 83886080. 419430400. 2130706432. 3355443 2. 503316480. 16777216 The state of VRRP changed from master to other state. (Vrrp If. Index=50331648, Vr. Id=167772160, If. Index=50331648, IPAddress=251. 10, Node. Na me=R 1, If. Name=Gigabit. Ethernet 0/0/0, Current. State=Backup, Change. Reason=priority Calculation(GE 0/0/1 down))

4. 1. 3 VRRP配置 n 第 15页 执行【tracert】命令进行路径跟踪测试 PC 10>tracert 172. 16. 1. 1

4. 1. 3 VRRP配置 n 第 15页 执行【tracert】命令进行路径跟踪测试 PC 10>tracert 172. 16. 1. 1 traceroute to 172. 16. 1. 1 , 8 hops max 传输的路径是 (ICMP), press Ctrl+C to stop PC 10→R 2→G 1 10. 1. 1. 252 92 ms 45 ms 30 ms W 2 172. 16. 1. 1 46 ms 42 ms 46 ms n VRRP的抢占 [R 1]interface g 0/0/1 [R 1 -Gigabit. Ethernet 0/0/1]undo shutdown [R 1 -Gigabit. Ethernet 0/0/1] Jan 20 2020 07: 41: 17 -08: 00 R 1 %%01 IFPDT/4/IF_STATE(l)[4]: Interface Gigabit. Ethernet 0/0/1 has turned into UP state. [R 1 -Gigabit. Ethernet 0/0/1] Jan 20 2020 07: 41: 17 -08: 00 R 1%%01 IFNET/4/LINK_STATE(l)[5]: The line protocol IP on the interface Gigabit. Ethernet 0/0/1 has entered the UP state. 路由器R 1重新夺回 [R 1 -Gigabit. Ethernet 0/0/1] 了主用路由器的角色 Jan 20 2020 07: 41: 17 -08: 00 R 1 %%01 VRRP/4/STATEWARNINGEXTEND(1)[6]: Virtual Router state BACKUP changed to MASTER, because of priority calculation. (Interface=Gigabit. Ethernet 0/0/0, Vr. Id=167772160, Inet. Type=IPv 4)

4. 1. 3 VRRP配置 n 查看路由器R 1上VRRP的抢占状态 [R 1]interface g 0/0/1 [R 1]display vrrp

4. 1. 3 VRRP配置 n 查看路由器R 1上VRRP的抢占状态 [R 1]interface g 0/0/1 [R 1]display vrrp 10 Gigabit. Ethernet 0/0/0 |Virtual Router 10 State : master Virtual IP : 10. 1. 1. 254 Master IP : 10. 1. 1. 251 Priority. Run: 150 Priority. Config : 150 Master. Priority: 150 开启了抢占功能, 延迟时间为 0 s Preempt: YES Delay Time: 0 s Timer. Run: 1 s Timer Config: 1 s 第 16页

4. 1. 3 VRRP配置 n 查看路由器R 1的VRRP状态变化情况 [R 1]display vrrp state-change interface Gigabit. Ethernet

4. 1. 3 VRRP配置 n 查看路由器R 1的VRRP状态变化情况 [R 1]display vrrp state-change interface Gigabit. Ethernet 0/0/0 vrid 10 Time 2020 -01 -20 05: 42: 00 05: 42: 03 06: 32: 00 07: 42: 08 UTC-08: 00 Sourcestate Iinitialist Backup Master Backup 关闭和启用路由器R 1接口G 0/0/1 导致的VRRP状态切换事件 第 17页 Dest. State Backup Master Reason Interface up Protocol timer expired Priority calculation

4. 1. 3 VRRP配置 p 案例配置过程 n 在路由器R 1和R 2上配置VRRP VRID 20并启用认证功能 启用VRRP认证, 密钥为Huawei

4. 1. 3 VRRP配置 p 案例配置过程 n 在路由器R 1和R 2上配置VRRP VRID 20并启用认证功能 启用VRRP认证, 密钥为Huawei [R 1]interface g 0/0/0 [R 1 -Gigabit. Ethernet 0/0/0]vrrp vrid 20 virtual-ip 10. 1. 1. 253 [R 1 -Gigabit. Ethernet 0/0/0]vrrp vrid 20 authentication-mode simple plain huawei [R 2]interface g 0/0/0 [R 2 -Gigabit. Ethernet 0/0/0]vrrp vrid 20 virtual-ip 10. 1. 1. 253 [R 2 -Gigabit. Ethernet 0/0/0]vrrp vrid 20 priority 150 [R 2 -Gigabit. Ethernet 0/0/0]vrrp vrid 20 authentication-mode simple plain huawei 第 19页

4. 1. 3 VRRP配置 n VRRP认证验证结果 [R 1]display vrrp 20 Gigabit. Ethernet 0/0/0 |

4. 1. 3 VRRP配置 n VRRP认证验证结果 [R 1]display vrrp 20 Gigabit. Ethernet 0/0/0 | Virtual Router 20 State : Backup Virtual IP: 10. 1. 1. 253 Master ip: 10. 1. 1. 252 Priority. Run : 100 Priority. Config : 100 Master. Priority : 150 Preempt : YES Delay Time : 0 s Timer. Run : 1 s Timer. Config : 1 s Auth type : SIMPLE Auth key : huawei 第 20页 认证模式为“SIMPLE”, 认证密钥为“huawei”

4. 1. 3 VRRP配置 p VRRP负载均衡验证:通过分别在PC 10和PC 20上执行【tracert】命令验证负载均衡的结果。 传输的路径是 PC 10→R 1→G W 传输的路径是

4. 1. 3 VRRP配置 p VRRP负载均衡验证:通过分别在PC 10和PC 20上执行【tracert】命令验证负载均衡的结果。 传输的路径是 PC 10→R 1→G W 传输的路径是 PC 20→R 2→G W 第 22页 PC 10>tracert 172. 16. 1. 1 traceroute to 172. 16. 1. 1 , 8 hops max (ICMP), press Ctrl+C to stop 1 10. 1. 1. 251 95 ms 47 ms 43 ms 2 172. 16. 1. 1 46 ms 48 ms 40 ms PC 20>tracert 172. 16. 1. 1 traceroute to 172. 16. 1. 1 , 8 hops max (ICMP), press Ctrl+C to stop 1 10. 1. 1. 252 75 ms 64 ms 46 ms 2 172. 16. 1. 1 64 ms 72 ms 67 ms

4. 1. 3 VRRP配置 p VRRP负载均衡的验证:通过分别在R 1和R 2上执行【display vrrp brief】命令查看VRRP的状 态信息。 第 23页 [R

4. 1. 3 VRRP配置 p VRRP负载均衡的验证:通过分别在R 1和R 2上执行【display vrrp brief】命令查看VRRP的状 态信息。 第 23页 [R 1]display vrrp brief Total: 2 Master: 1 Backup: 1 VRID State Interface Non-active: 0 Type Virtual IP 10 20 Normal Master Backup GE 0/0/0 10. 1. 1. 254 10. 1. 1. 253 [R 2]display vrrp brief Total: 2 Master: 1 Backup: 1 VRID State Interface Non-active: 0 Type Virtual IP 10 20 Normal Backup Master GE 0/0/0 10. 1. 1. 254 10. 1. 1. 253

4. 2. 3 链路聚合配置 l 案例4 -3 手动配置链路聚合 p 案例要求:通过手动方式配置交换机SW 1和SW 2的GE 0/0/1和GE 0/0/2的端口进行链路聚合。

4. 2. 3 链路聚合配置 l 案例4 -3 手动配置链路聚合 p 案例要求:通过手动方式配置交换机SW 1和SW 2的GE 0/0/1和GE 0/0/2的端口进行链路聚合。 p 配置过程 创建并进入Eth. Trunk接口,编号为 1 向Eth-Trunk接口中 添加成员接口 第 32页 [SW 1]interface eth-trunk 1 [SW 1 -Eth-Trunk 1]trunkport Gigabit. Ethernet 0/0/1 to 0/0/2 [SW 1 -Eth-Trunk 1]port link-type trunk [SW 1 -Eth-Trunk 1]port trunk allow-pass vlan all [SW 2]interface eth-trunk 1 [SW 2 -Eth-Trunk 1]trunkport Gigabit. Ethernet 0/0/1 to 0/0/2 [SW 2 -Eth-Trunk 1]port link-type trunk [SW 2 -Eth-Trunk 1]port trunk allow-pass vlan all

4. 2. 3 链路聚合配置 l 案例4 -4 LACP配置链路聚合 p 案例要求:通过LACP方式配置交换机SW 1和SW 2的GE 0/0/1和GE 0/0/2的端口进行链路聚合。

4. 2. 3 链路聚合配置 l 案例4 -4 LACP配置链路聚合 p 案例要求:通过LACP方式配置交换机SW 1和SW 2的GE 0/0/1和GE 0/0/2的端口进行链路聚合。 p 配置过程 [SW 1]interface Eth-Trunk 2 启用LACP 作模式 [SW 1 -Eth-Trunk 2]mode lacp-static [SW 1 -Eth-Trunk 2]trunkport Gigabit. Ethernet 0/0/1 to 0/0/2 [SW 2]interface Eth-Trunk 2 [SW 2 -Eth-Trunk 2]mode lacp-static [SW 2 -Eth-Trunk 2]trunkport Gigabit. Ethernet 0/0/1 to 0/0/2 第 33页

4. 2. 3 链路聚合配置 p p 第 34页 案例验证:使用【display Eth-trunk 2】命令来检查这个Eth-Trunk以及成员接口的状态 [SW 1]display eth-trunk

4. 2. 3 链路聚合配置 p p 第 34页 案例验证:使用【display Eth-trunk 2】命令来检查这个Eth-Trunk以及成员接口的状态 [SW 1]display eth-trunk 2 Eth-Trunk 2’s state information is: ………… 在LACP模式下, 本地 Operate status:up Number of Up Port In Trunk: 2 成员接口的状态 ----------------------------------------Actor. Port. Name Status Port. Type Port. Pri Port. No Port. Key Port. State Weight Gigabit. Ethernet 0/0/1 Selected 1 GE 32768 2 7729 10111100 1 Gigabit. Ethernet 0/0/2 Selected 1 GE 32768 3 7729 10111100 1 Partner: 对端成员接口的状态 ----------------------------------------Actor. Port. Name Sys. Pri System. ID Port. Pri Port. No Port. Key Port. State Gigabit. Ethernet 0/0/1 32768 4 c 1 f-cc 75 -3550 32768 2 7729 10111100 Gigabit. Ethernet 0/0/2 32768 4 c 1 f-cc 75 -3550 32768 3 7729 10111100

4. 2. 3 链路聚合配置 l LACP系统优先级 p p 示例:配置SW 1成为主动端,将它的LACP系统优先级设置为 3000。 [SW 1]lacp priority

4. 2. 3 链路聚合配置 l LACP系统优先级 p p 示例:配置SW 1成为主动端,将它的LACP系统优先级设置为 3000。 [SW 1]lacp priority 3000 [SW 1]display eth-trunk 2 Eth-Trunk 2’s state information is: Local: 交换机SW 1的LACP 系统优先级值为 3000 LAG ID: 2 Working. Mode: STATIC Preempt Delay: Disabled Hash arithetic:According to SIP-XOR-DIP System Priority: 3000 System ID: 4 cbf-ecc 1 -344 a Least Active-linknumber: 1 Max Active-linknumber: 8 Operate status:up Number of Up Port In Trunk: 2 Actor. Port. Name Gigabit. Ethernet 0/0/1 Gigabit. Ethernet 0/0/2 第 35页 Status Port. Type Port. Pri Port. No Port. Key Port. State Weight Selected 1 GE 32768 2 7729 10111100 1 Selected 1 GE 32768 3 7729 10111100 1

4. 2. 3 链路聚合配置 l LACP接口优先级 [SW 1]interface Gigabit. Ethernet 0/0/1 [SW 1 -Gigabit.

4. 2. 3 链路聚合配置 l LACP接口优先级 [SW 1]interface Gigabit. Ethernet 0/0/1 [SW 1 -Gigabit. Ethernet 0/0/1]lacp priority 1000 [SW 1 -Gigabit. Ethernet 0/0/1]interface Gigabit. Ethernet 0/0/2 [SW 1 -Gigabit. Ethernet 0/0/2]lacp priority 2000 [SW 1 -Gigabit. Ethernet 0/0/2]quit [SW 1]display eth-Trunk 2 Eth-Trunk 2’s state information is: Local: LAG ID: 2 Working. Mode: STATIC Preempt Delay: Disabled Hash arithetic:According to SIP-XOR-DIP System Priority: 2000 System ID: 4 cbf-ecc 1 -344 a SW 1接口的LACP系 Least Active-linknumber: 1 Max Active-linknumber: 8 统优先级值的变化 Operate status:up Number of Up Port In Trunk: 2 Actor. Port. Name Gigabit. Ethernet 0/0/1 Gigabit. Ethernet 0/0/2 第 36页 Status Selected Port. Type Port. Pri Port. No Port. Key Port. State Weight 1 GE 1000 2 7729 10111100 1 1 GE 2000 3 7729 10111100 1

4. 2. 3 链路聚合配置 l Eth-Trunk中活动接口的数量 [SW 1]interface eth-trunk 2 [SWI-Eth-Trunk 2]max active-linknumber 1

4. 2. 3 链路聚合配置 l Eth-Trunk中活动接口的数量 [SW 1]interface eth-trunk 2 [SWI-Eth-Trunk 2]max active-linknumber 1 配置活动接口的数量为 1 [SWI-Eth-Trunk 2]quit [SWI]display eth-trunk 2 Eth-Trunk 2’s state information is: Local: LAG ID: 2 Working. Mode: STATIC Preempt Delay: Disabled Hash arithetic:According to SIP-XOR-DIP System Priority: 2000 System ID: 4 cbf-ecc 1 -344 a 验证活动接口的数量 Least Active-linknumber: 1 Max Active-link number: 1 Operate status:up Number of Up Port In Trunk: 1 LACP接口优先级最低 的接口成为备用接口 Actor. Port. Name Gigabit. Ethernet 0/0/1 Gigabit. Ethernet 0/0/2 第 37页 Status Selected Unselect Port. Type Port. Pri 1 GE 1000 1 GE 2000 Port. No Port. Key Port. State 2 7729 10111100 3 7729 10111100 Weight 1 1

4. 2. 3 链路聚合配置 l 使用【shutdown】命令在SW 1上关闭G 0/0/1接口模拟接口物理故障,查看抢占结果。 [SW 1]interface Gigabit. Ethernet 0/0/1 [SW

4. 2. 3 链路聚合配置 l 使用【shutdown】命令在SW 1上关闭G 0/0/1接口模拟接口物理故障,查看抢占结果。 [SW 1]interface Gigabit. Ethernet 0/0/1 [SW 1 -Gigabit. Ethernet 0/0/1]shutdown [SW 1 -Gigabit. Ethernet 0/0/1]quit [SW 1]display eth-Trunk 2 Eth-Trunk 2’s state information is: Local: LAG ID: 2 Working. Mode: STATIC Preempt Delay: Disabled Hash arithetic:According to SIP-XOR-DIP System Priority: 2000 System ID: 4 cbf-ecc 1 -344 a Least Active-linknumber: 1 Max Active-linknumber: 1 备用接口变为活动接 Operate status:up Number of Up Port In Trunk: 1 口, 状态为Selected Actor. Port. Name Gigabit. Ethernet 0/0/1 Gigabit. Ethernet 0/0/2 第 38页 Status Unselect Selected Port. Type Port. Pri 1 GE 1000 1 GE 2000 Port. No Port. Key Port. State 2 7729 10111100 3 7729 10111100 Weight 1 1

4. 2. 3 链路聚合配置 l LACP的抢占功能 [SW 1]interface Gigabit. Ethernet 0/0/1 [SW 1]interface Eth-Trunk

4. 2. 3 链路聚合配置 l LACP的抢占功能 [SW 1]interface Gigabit. Ethernet 0/0/1 [SW 1]interface Eth-Trunk 2 [SW 1 -Eth-Trunk 2]lacp preempt enable 启用抢占功能 [SW 1 -Eth-Trunk 2]lacp preempt delay 10 [SW 1 -Gagibit. Ethernet 0/0/1]undo shutdown [SW 1]display eth-trunk 2 Eth-Trunk 2’s state information is: Local: 抢占延迟时间为 10 s LAG ID: 2 Working. Mode: STATIC Preempt Delay Time: 10 Hash arithetic:According to SIP-XOR-DIP System Priority: 2000 System ID: 4 cbf-ecc 1 -344 a Least Active-linknumber: 1 Max Active-link number: 1 Operate status:up Number of Up Port In Trunk: 1 成功抢占成为活动接口 Actor. Port. Name Gigabit. Ethernet 0/0/1 Gigabit. Ethernet 0/0/2 第 39页 Status Port. Type Port. Pri Selected 1 GE 1000 Unselect 1 GE 2000 Port. No Port. Key Port. State 2 7729 10111100 3 7729 10111100 Weight 1 1

思考题 4. 关于以下配置说法正确的是( ) [R 1]interface g 0/0/0 [R 1 -Gigabit. Ethernet 0/0/0]vrrp vrid

思考题 4. 关于以下配置说法正确的是( ) [R 1]interface g 0/0/0 [R 1 -Gigabit. Ethernet 0/0/0]vrrp vrid 10 virtual-ip 10. 1. 1. 254 [R 1 -Gignbit. Ethernet 0/0/0]vrrp vrid 10 priority 150 [R 2]interface g 0/0/0 [R 2 -Gigahit. Ethernet 0/0/0]vrrp vrid 10 virtual-ip 10. 1. 1. 254 A. VRRP的组号为 150 B. 路由器R 2在VRRP组中的优先级为 150 C. 路由器R 2在VRRP组中的优先级为 100 D. 路由器R 1在VRRP组中的优先级和组号都为 150 第 50页

思考题 7. VRRP报文的组播地址是多少?( ) A. 224. 0. 0. 5 B. 224. 0. 0. 9

思考题 7. VRRP报文的组播地址是多少?( ) A. 224. 0. 0. 5 B. 224. 0. 0. 9 C. 224. 0. 0. 18 D. 224. 0. 0. 20 8. 以下哪个MAC地址是华为VRRP组的虚拟MAC地址?( ) A. 00 -00 -E 5 -00 -01 -11 B. 00 -00 -5 E-00 -01 -11 C. 00 -E 5 -00 -00 -01 -11 D. 00 -00 -00 -5 E-01 -11 9. 以下哪个属于华为的链路聚合?( ) A. Aggregate-port B. Eth-trunk C. Port-Group D. Group-Port 10. 以下哪个不是堆叠交换机的角色?( ) A. Master 第 52页 B. Backup C. Standby D. Slave

Thank you. 把数字世界带入每个人、每个家庭、每个组织,构建万物互联的智能世界。 Bring digital to every person, home, and organization for a fully

Thank you. 把数字世界带入每个人、每个家庭、每个组织,构建万物互联的智能世界。 Bring digital to every person, home, and organization for a fully connected, intelligent world.