概述
HSRP(Vrrp)
- 背景:
- 为了实现网络出口一方出现故障,网络能够自动切换到正常线路进行通信,不影响客户机上网
- HSRP:私有标准(思科设备上才能配置这个)
- VRRP:公有标准
- Hsrp和Vrrp都是做硬件设备的备份
- 思科HSRP的配置
- 位置:我们要对vlan 10这个网络要做备份,我们配置HSRP应该在vlan10的网关接口下进行配置.
- 拓扑图:
- 接入层 S0:
- 创建VLAN
- Switch(config)#vlan10
- 将连接PC的端口加入VLAN
- Switch(config)#interfacef0/1
- Switch(config-if)#switchportaccess vlan 10
- 连接交换机的端口配置TRUNK
- Switch(config)#interfacef0/2
- Switch(config-if)#switchportmode trunk
- Switch(config)#interfacef0/3
- Switch(config-if)#switchportmode trunk
- 创建VLAN
- MS0
- 创建VLAN
- Switch(config)#vlan10
- 交换机与交换机之间配置TRUNK
- Switch(config)#interfacegigabitEthernet 1/0/1
- Switch(config-if)#switchporttrunk encapsulation dot1q
- Switch(config-if)#switchportmode trunk
- 配置网关
- Switch(config)#interfacevlan 10
- Switch(config-if)#ip address 192.168.10.1 255.255.255.0
- 打开路由表
- Switch(config)#iprouting
- 配置节点IP
- Switch(config)#interfacegigabitEthernet 1/0/2
- Switch(config-if)#noswitchport
- Switch(config-if)#ip address 192.168.20.1 255.255.255.0
- 创建VLAN
- MS1
- 创建VLAN
- Switch(config)#vlan 10
- 交换机与交换机之间配置TRUNK
- Switch(config)#interfacegigabitEthernet 1/0/1
- Switch(config-if)#switchport trunk encapsulation dot1q
- Switch(config-if)#switchport mode trunk
- 配置网关
- Switch(config)#interfacevlan 10
- Switch(config-if)#ipaddress192.168.10.2 255.255.255.0
- 打开路由表
- Switch(config)#ip routing
- 配置节点IP
- Switch(config)#interfacegigabitEthernet 1/0/2
- Switch(config-if)#noswitchport
- Switch(config-if)#ip address 192.168.30.1 255.255.255.0
- 创建VLAN
- R0:
- 配置节点IP
- Router(config)#interfacef0/0
- Router(config-if)#noshutdown
- Router(config-if)#ip address 192.168.20.2 255.255.255.0
- Router(config)#interface f0/1
- Router(config-if)#no shutdown
- Router(config-if)#ip address 192.168.30.2 255.255.255.0
- Router(config)#interface ethernet 1/0
- Router(config-if)#no shutdown
- Router(config-if)#ip address 192.168.40.1 255.255.255.0
- 配置节点IP
- 根据路由表配置动态路由
- 查看路由表命令: show ip route
- MS0
- Switch(config)#routerrip
- Switch(config-router)#network 192.168.10.0
- Switch(config-router)#network 192.168.20.0
- MS1
- Switch(config)#routerrip
- Switch(config-router)#network 192.168.10.0
- Switch(config-router)#network 192.168.30.0
- R0
- Router(config)#routerrip
- Router(config-router)#network 192.168.20.0
- Router(config-router)#network 192.168.30.0
- Router(config-router)#network 192.168.40.0
- PC端测试数据走向: C:> tracert 192.168.40.2
- 添加HSRP功能
- MS0
- Switch(config)#interfacevlan 10
- Switch(config-if)#standby 1 ip 192.168.10.254
- vrrp:vrrp 1 ip 192.168.10.254
- MS1
- Switch(config)#interfacevlan 10
- Switch(config-if)#standby 1 ip 192.168.10.254
- vrrp: vrrp 1 ip 192.168.10.254
- 192.168.10.254 作为VLAN 10 pc机的网关
- MS0
- HSRP优先级
- 默认都是100 优先级越大越优先
- 查看优先级
- show standby brief
- 修改优先级
- Switch(config)#interface vlan 10
- Switch(config-if)#standby 1 priority 200
- vrrp 1 priority 200
- Switch(config-if)#standby 1 preempt ( 抢占 )
- vrrp 1 preempt
- 华为Vrrp的配置
- 拓扑图:
- 配置
- 1、规划网段
- 2、应用324模板
- LSW4:
- <Huawei>sys
- [Huawei]vlan 10
- [Huawei-vlan10]quit
- [Huawei]interface e0/0/1
- [Huawei-Ethernet0/0/1]port link-type access
- [Huawei-Ethernet0/0/1]port default vlan 10
- [Huawei-Ethernet0/0/1]quit
- [Huawei]interface e0/0/2
- [Huawei-Ethernet0/0/2]port link-type trunk
- [Huawei-Ethernet0/0/2]port trunk allow-pass vlan all
- LSW2:
- [Huawei]vlan 10
- [Huawei-vlan10]quit
- [Huawei]interface vlan 10
- [Huawei-Vlanif10]ip address 192.168.10.1 255.255.255.0
- [Huawei]vlan 20
- [Huawei-vlan20]quit
- [Huawei]interface vlan 20
- [Huawei-Vlanif20]ip address 192.168.20.1 255.255.255.0
- [Huawei]interface g0/0/2
- [Huawei-GigabitEthernet0/0/2]port link-type access
- [Huawei-GigabitEthernet0/0/2]port default vlan 20
- [Huawei]interface g0/0/1
- [Huawei-GigabitEthernet0/0/1]port link-type trunk
- [Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
- LSW3:
- [Huawei]vlan 10
- [Huawei-vlan10]quit
- [Huawei]interface vlan 10
- [Huawei-Vlanif10]ip address 192.168.10.2 255.255.255.0
- [Huawei]vlan 30
- [Huawei-vlan30]quit
- [Huawei]interface vlan 30
- [Huawei-Vlanif20]ip address 192.168.30.1 255.255.255.0
- [Huawei]interface g0/0/2
- [Huawei-GigabitEthernet0/0/2]port link-type access
- [Huawei-GigabitEthernet0/0/2]port default vlan 30
- [Huawei]interface g0/0/1
- [Huawei-GigabitEthernet0/0/1]port link-type trunk
- [Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
- R1:
- [Huawei]interface e0/0/1
- [Huawei-GigabitEthernet0/0/1]undo shutdown
- [Huawei-GigabitEthernet0/0/1]ip address 192.168.20.2 255.255.255.0
- [Huawei]interface e0/0/0
- [Huawei-Ethernet0/0/0]undo shutdown
- [Huawei-Ethernet0/0/0]ip address 192.168.30.2 255.255.255.0
- [Huawei]interface GigabitEthernet0/0/0
- [Huawei-GigabitEthernet0/0/0]undo shutdown
- [Huawei-GigabitEthernet0/0/0]ip address 192.168.40.1 255.255.255.0
- LSW4:
- 3、节点配置IP
- LSW2:
- [Huawei]rip
- [Huawei-rip-1]network 192.168.10.0
- [Huawei-rip-1]network 192.168.20.0
- LSW3:
- [Huawei]rip
- [Huawei-rip-1]network 192.168.10.0
- [Huawei-rip-1]network 192.168.30.0
- R2:
- [Huawei]rip
- [Huawei-rip-1]network 192.168.30.0
- [Huawei-rip-1]network 192.168.40.0
- LSW2:
- 4、添加vrrp 配置路由表
- LSW2:
- [Huawei]interface vlan 10
- [Huawei-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.254
- LSW3:
- [Huawei]int vlan 10
- [Huawei-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.254
- LSW2:
- 5、验证是否能ping通
- 拓扑图:
最后
以上就是精明棒球为你收集整理的网络知识——HSRP的全部内容,希望文章能够帮你解决网络知识——HSRP所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复