赞
踩
为了实现网络出口一方出现故障,网络能够自动切换到正常线路进行通信,不影响客户机上网.-----------HSRP(vrrp)
HSRP:私有标准(思科设备上才能配置这个)
VRRP:公有标准
Hsrp和vrrp都是做硬件设备的备份.
规划网段。
2.基础配置
Switch0(接入层)
enable
conf t
vlan 10
exit
interface f0/3
switchport access vlan 10
exit
interface range f0/1-2
switchport mode trunk
exit
exit
Write
Switch1三层交换机 enable conf t vlan 10 exit interface f0/2 switchport tr en do switchport mode trunk exit interface vlan 10 ip address 192.168.10.1 255.255.255.0 exit ip routing end Write Switch2三层交换机 enable conf t vlan 10 exit interface f0/2 switchport tr en do switchport mode trunk exit interface vlan 10 ip address 192.168.10.2 255.255.255.0 exit ip routing end Write Switch1三层交换机配置节点IP Switch(config)#interface f0/1 Switch(config-if)#no switchport Switch(config-if)#ip address 192.168.20.1 255.255.255.0 Switch2三层交换机配置节点IP Switch(config)#interface f0/1 Switch(config-if)#no switchport Switch(config-if)#ip address 192.168.30.1 255.255.255.0
3.路由器配置IP地址
Router(config)#interface f0/1
Router(config-if)#no shutdown
Router(config-if)#ip address 192.168.20.2 255.255.255.0
Router(config-if)#exit
Router(config)#interface e1/0
Router(config-if)#no shutdown
Router(config-if)#ip address 192.168.30.2 255.255.255.0
Router(config-if)#exit
Router(config)#interface f0/0
Router(config-if)#no shutdown
Router(config-if)#ip address 192.168.40.1 255.255.255.0
检查路由器的路由表(看是否所有三层设备有所有的网段) 配置rip路由协议 Switch1三层交换 Switch(config)#router rip Switch(config-router)#network 192.168.10.0 Switch(config-router)#network 192.168.20.0 Switch2三层交换 Switch(config)#router rip Switch(config-router)#network 192.168.10.0 Switch(config-router)#network 192.168.30.0 路由器 Router(config)#router rip Router(config-router)#network 192.168.20.0 Router(config-router)#network 192.168.30.0 Router(config-router)#network 192.168.40.0 测试线路走哪条路径 C:\>tracert 192.168.40.2 Tracing route to 192.168.40.2 over a maximum of 30 hops: 1 1 ms 1 ms 0 ms 192.168.10.1 2 1 ms 0 ms 0 ms 192.168.20.2 3 0 ms 1 ms 0 ms 192.168.40.2
HSRP功能配置:
4.配置的位置:
例子:我们要对vlan 10这个网络要做备份,我们配置HSRP应该在vlan10的网关接口下进行配置.
Switch1三层交换机
Switch(config)#interface vlan 10
Switch(config-if)#standby 1 ip 192.168.10.254
(vrrp 1 ip 192.168.10.254)
Switch2三层交换机
Switch(config)#interface vlan 10
Switch(config-if)#standby 1 ip 192.168.10.254
(vrrp 1 ip 192.168.10.254)
注意:192.168.10.254 就做vlan10的pc机的网关
C:\>ping 192.168.10.254
Pinging 192.168.10.254 with 32 bytes of data:
Reply from 192.168.10.254: bytes=32 time=1ms TTL=255
Reply from 192.168.10.254: bytes=32 time=1ms TTL=255
Reply from 192.168.10.254: bytes=32 time<1ms TTL=255
Reply from 192.168.10.254: bytes=32 time<1ms TTL=255
HSRP优先级
Switch#show standby brief (show vrrp brief)
P indicates configured to preempt.
Interface Grp Pri P State Active Standby Virtual IP
Vl10 1 100 Standby 192.168.10.2 local 192.168.10.254
优先级两边默认都是100,优先级越大越优先.
修改优先级:
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)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。