CiscoHSRP的配置实例
Cisco路由器NAT+DHCP+HSRP+ACL+NTP配置方法

NAT+DHCP+HSRP+ACL+NTP配置实例sh runBuilding configuration...Current configuration : 1664 bytes!! Last configuration change at 10:58:23 UTC Wed Dec 22 2004 ! NVRAM config last updated at 10:58:53 UTC Wed Dec 22 2004 !version 12.2service timestamps debug uptimeservice timestamps log uptimeno service password-encryption!hostname Router!enable secret 5 $1$FOJx$EaWLKlAfIHWh/JpXKMIaO/!ip subnet-zero!!ip dhcp excluded-address 1.1.1.1ip dhcp excluded-address 1.1.1.10ip dhcp excluded-address 1.1.1.254!ip dhcp pool wuyou--More-- network 1.1.1.0 255.255.255.0 dns-server 211.90.88.129 212.102.4.141default-router 1.1.1.10!!!!!!!!!!!interface Loopback0ip address 2.2.2.2 255.255.255.0ip broadcast-address 2.2.2.255!interface FastEthernet0/0ip address 222.1.8.200 255.255.0.0ip broadcast-address 222.1.255.255ip nat outsideduplex auto--More-- speed auto!interface FastEthernet0/1ip address 1.1.1.1 255.255.255.0ip broadcast-address 1.1.1.255ip nat insideduplex autospeed autostandby timers 100 101 advertise 100standby priority 200standby preemptstandby track Loopback0 100standby 1 ip 1.1.1.10!ip nat pool abc 222.1.8.200 222.1.8.250 netmask 255.255.0.0 ip nat inside source list 10 pool abc overloadip classlessip route 0.0.0.0 0.0.0.0 222.1.5.101ip route 1.1.1.0 255.255.255.0 FastEthernet0/1no ip http serverip pim bidir-enable!!--More-- access-list 10 permit 1.1.1.0 0.0.0.255 access-list 101 deny ip 222.1.0.0 0.0.255.255 1.1.1.0 0.0.0.255 log access-list 101 permit ip any any!dial-peer cor custom!!!!gatekeepershutdown!!line con 0line aux 0line vty 0 4password ciscologin!ntp authentication-key 1 md5 00071A150754 7ntp authenticatentp trusted-key 1ntp master 1--More-- !endRouter#telnet 1.1.1.254Trying 1.1.1.254 ... OpenUser Access VerificationPassword:Switch>enPassword:Switch#sh runBuilding configuration...Current configuration:!! Last configuration change at 09:04:49 UTC Wed Dec 22 2004 ! NVRAM config last updated at 15:37:59 UTC Tue Dec 21 2004 !version 12.0no service padservice timestamps debug uptimeservice timestamps log uptimeno service password-encryption!hostname Switch!enable password cisco!!!!!!ip subnet-zero!--More-- !!interface FastEthernet0/1port securityspanning-tree portfast!interface FastEthernet0/2 spanning-tree portfast!interface FastEthernet0/3 spanning-tree portfast!interface FastEthe rnet0/4 spanning-tree portfast!interface FastEthernet0/5 spanning-tree portfast!interface FastEthernet0/6 spanning-tree portfast!interface FastEthernet0/7 spanning-tree portfast--More-- ! interface FastEthernet0/8 spanning-tree portfast!interface FastEthernet0/9 spanning-tree portfast!interface FastEthernet0/10 spanning-tree portfast!interface FastEthernet0/11 spanning-tree portfast!interface FastEthernet0/12spanning-tree portfast!interface FastEthernet0/13spanning-tree portfast!interface FastEthernet0/14spanning-tree portfast!interface FastEthernet0/15--More-- spanning-tree portfast!interface FastEthernet0/16spanning-tree portfast!interface FastEthernet0/17spanning-tree portfast!interface FastEthernet0/18spanning-tree portfast!interface FastEthernet0/19spanning-tree portfast!interface FastEthernet0/20spanning-tree portfast!interface FastEthernet0/21spanning-tree portfast!interface FastEthernet0/22spanning-tree portfast!--More-- interface FastEthernet0/23 spanning-tree portfast!interface FastEthernet0/24spanning-tree portfast!interface GigabitEthernet0/1!interface GigabitEthernet0/2!interface VLAN1ip address 1.1.1.254 255.255.255.0ip access-group 101 inip helper-address 1.1.1.10ip directed-broadcastno ip route-cache!interface VLAN2no ip directed-broadcastno ip route-cacheshutdown!mac-address-table secure 0000.e8af.67f8 FastEthernet0/1 vlan 1 --More-- !line con 0transport input nonestopbits 1line vty 0 4password ciscologinline vty 5 15login!ntp authentication-key 1 md5 13061E010803 7ntp authenticatentp trusted-key 1ntp clock-period 11259402 ntp server 1.1.1.10 key 1 end。
Cisco HSRP 路由器的配置

Cisco 路由器 HSRP的配置热备份路由协议是HSRP(Hot standby router protocol)是cisco平台所特有的一种技术,它确保了当网络边缘设备或接入链路出现故障时,用户通信迅速并透明地恢复,并以此为IP网络提供冗余性,通过应用HSRP,可使网络的正常运行时间接近100%,从而满足用户对网络可靠性的要求。
热备份路由协议为IP我网络提供了容错和增强的路由选择功能。
通过使用同一个虚拟IP 地址和虚拟MAC地址, LAN网络上的两台或多台路由器可以作为一台“虚拟”路由器而对外提供服务。
HSRP使组内cisco路由器能互相监视对方的运行状态:(1) 虚拟路由器组的成员通过HSRP消息不断地交换状态信息。
(2) 如果其中一台出现故障,另一台就能接替它,继续完成路由功能。
LAN 网段上的主机都配置只用同一个虚拟路由器作为默认网关,并不断将IP包发往同一个IP和MAC地址。
因此,理由设备的切换对主机就是透明的。
绝大多数主机路由表相对简单,并且以默认网关作为唯一的吓一跳IP和MAC地址。
HSRP向主机提供了默认网关的冗余性,减少了主机维护路由表的任务。
另外通过多个热备份组,路由器可以提供冗余备份,并在不同的IP子网实现负载分担。
具体配置:RA:Router>enableRouter#config tRouter(config)#hostname RARA(config)#no ip domain-lookupRA(config)#line con 0RA(config-line)#no exec-tRA(config-line)#exitRA(config)#interface e0/2RA(config-if)#ip address 10.10.10.1 255.255.255.0 RA(config-if)#no shRA(config-if)#du fuRA(config-if)#standby 10 ip 10.10.10.254RA(config-if)#standby 10 priority 110RA(config-if)#standby 10 preemptRA(config-if)#exitRA(config)#interface e0/1RA(config-if)#ip address 172.16.10.1 255.255.255.0 RA(config-if)#no shRA(config-if)#du fuRA(config-if)#standby 172 ip 172.16.10.254RA(config-if)#standby 172 priority 120RA(config-if)#standby 172 preemptRA(config-if)#no shRA(config-if)#endRA#RB:Router>enableRouter#config terRouter(config)#hostname RBRB(config)#no ip domain-lookupRB(config)#line con 0RB(config-line)#no exec-tRB(config-line)#exitRB(config)#interface e0/2RB(config-if)#ip address 10.10.10.2 255.255.255.0 RB(config-if)#no shRB(config-if)#du fuRB(config-if)#standby 10 track ethernet 0/1 100 RB(config-if)#standby 10 ip 10.10.10.254RB(config-if)#standby 10 priority 120RB(config-if)#standby 10 preemptRB(config-if)#no shRB(config-if)#exitRB(config)#interface e0/1RB(config-if)#ip address 172.16.10.2 255.255.255.0 RB(config-if)#no shRB(config-if)#du fuRB(config-if)#standby 172 ip 172.16.10.254RB(config-if)#standby 172 priority 110RB(config-if)#standby 172 preempt。
CISCO实战案例

CISCO实战案例:HSRP的配置标签CISCO HSRP实验题目:HSRP的配置场景描述:公司对互联网的访问要求越来越高,决定采用冗余的路由器并申请了2条连接到互联网上,以保证互联网的访问实时畅通实验使用到的相关知识点总结1:standby zuhao ip ip –add 配置HSRP2:standby zuhao priority youxianjishuzhi 设置优先级3:standby zuhao preempt 设置占先权4:standby zuhao track genzongdeduankou jianqudezhi5: sh standby brief 查看HSRP配置注意所有配置都是再接口模式下配置的实验步骤:1.1:r1的配置:enaconf thost r1int e0/0ip add 100.0.0.1 255.0.0.0no shexitint e0/1ip add 192.168.10.1 255.255.255.0no shstandby 1 ip 192.168.10.3standby 1 priority 150standby 1 track e0/0 60standby 1 preemptstandby 2 ip 192.168.10.4standby 2 preemptexitexitwri2.1:r2的配置:enaconf thost r2int e0/0ip add 100.0.0.2 255.0.0.0no shexitint e0/1ip add 192.168.10.2 255.255.255.0no shstandby 1 ip 192.168.10.3standby 1 preemptstandby 2 ip 192.168.10.4standby 2 priority 150standby 2 track e0/0 60standby 2 preemptexitexit实验中遇到的问题及相应解决方法验证结果:r1#sh standby briP indicates configured to preempt.Interface Grp Prio P State Active Standby Virtual IPEt0/1 1 150 P Active local 192.168.10.2 192.168.10.3Et0/1 2 100 P Standby 192.168.10.2 local 192.168.10.4**************************************************************************** r2#sh standby e0/1 briInterface Grp Prio P State Active Standby Virtual IPEt0/1 1 100 P Standby 192.168.10.1 local 192.168.10.3Et0/1 2 150 P Active local 192.168.10.1 192.168.10.4**************************************************************************** sh r1的e0/0后:***************************************************r1#sh standby briP indicates configured to preempt.|Interface Grp Prio P State Active Standby Virtual IPEt0/1 1 90 P Speak 192.168.10.2 unknown 192.168.10.3 Et0/1 2 100 P Standby 192.168.10.2 local 192.168.10.4********************************************r1#sh standby briP indicates configured to preempt.|Interface Grp Prio P State Active Standby Virtual IPEt0/1 1 90 P Standby 192.168.10.2 local 192.168.10.3Et0/1 2 100 P Standby 192.168.10.2 local 192.168.10.4***********************************************r2#sh standby e0/1 bP indicates configured to preempt.|Interface Grp Prio P State Active Standby Virtual IPEt0/1 1 100 P Active local 192.168.10.1 192.168.10.3Et0/1 2 150 P Active local 192.168.10.1 192.168.10.4***********************************************。
HSRP的配置

HSRP的配置1:将路由器配置为一个HSRP的成员,可以在端口模式下输入:Standby {group-number} ip {virtual-ip-address}{group-number} 该端口所属的HSRP组,默认是0.{virtual-ip-address} 指定的的虚拟ip地址,如果没有制定,路由器就会通过HSRP HELLO 消息学到虚拟ip地址。
在选择活跃路由器时候,线路上至少有一台路由器被配置。
从HSRP组中取消一个端口:No standby group ip2:关掉端口重定向功能:No ip redirects3:配置HSRP的优先级优先级越大,就越优先成为活跃路由器。
Standby {group-number} priority4:配置HSRP的占先权:当活跃路由器失效后,备份的路由器就自动承担了活跃路由器的角色,即使当较高优先级的原路由器又重新开始在网上工作时,这台备份路由器仍然继续作为转发路由器。
要想原来的较高优先级的路由器从优先级较低的新活跃路由器那里重新取回转发权使用命令:standby {group-number} preempt5:配置HELLO消息的计时器:默认计时器一般是不需要修改。
同一个HSRP组中的HELLO时间和保持时间应该配置的相同。
HELLO间隔时间默认为3秒,可以在1到255之间变化。
保持时间最少应该是HELLO 时间的3倍。
默认的保持时间为10秒。
Standby group-number times hellotime holdtime6:配置HSRP的端口跟踪:检测路由器的另外端口状态,如果被跟踪端口变为Down,其他路由器就接替成为活跃路由器。
这一过程是通过在被跟踪端口的链路状态变为down时减小路由器的优先级实现的。
默认的减小值为10.Standby group-number track type nember interface-priorityType :说明跟踪端口的类型Number:说明跟踪端口号。
Cisco、H3C相关HSRP、VRRP的配置命令

Cisco/H3C相关HSRP/VRRP的配置命令一、网络拓扑结构图二、IP地址和VLan的规划SW1Vlan ID IP Address HSRP Address10 192.168.10.252 /24 192.168.10.25420 192.168.20.252 /24 192.168.20.25430 192.168.30.252 /24 192.168.30.25440 192.168.40.252 /24 192.168.40.25450 192.168.50.252 /2460 192.168.60.252 /24Vlan ID IP Address HSRP Address10 192.168.10.253 /24 192.168.10.25420 192.168.20. 253 /24 192.168.20.25430 192.168.30. 253 /24 192.168.30.25440 192.168.40. 253 /24 192.168.40.25450 192.168.50. 253 /2460 192.168.60. 253 /24HSRPBBR:Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host BBRBBR(config)#int f0/0BBR(config-if)#ip add 10.10.50.1 255.255.255.0BBR(config-if)#no shBBR(config-if)#int fBBR(config-if)#ip add 10.10.60.1 255.255.255.0BBR(config-if)#no shBBR(config-if)#exitBBR(config)#ip route 0.0.0.0 0.0.0.0 10.10.50.252BBR(config)#ip route 0.0.0.0 0.0.0.0 10.10.60.253BBR(config)#endBBR#SW1:Router>enRouter#conf tRouter(config)#host SW1SW1(config)#vlan 10SW1(config)#vlan 20SW1(config)#vlan 30SW1(config)#vlan 40SW1(config)#vlan 50SW1(config)#vlan 60SW1(config-vlan)#exitSW1(config)#vtp domain HSRPSW1(config)#vtp mode serverSW1(config)#int port-channel 1SW1(config-if)#switchport mode trunkSW1(config-if)#exitSW1(config)#int range f1/11 - 12SW1(config-if-range)#switchport mode trunkSW1(config-if-range)#switchport trunk allowed vlan allSW1(config-if-range)#channel-group 1 mode onSW1(config-if-range)#endSW1#conf tSW1(config)#int vlan 10SW1(config-if)#ip address 10.10.10.252 255.255.255.0SW1(config-if)#no shSW1(config-if)#standby 10 ip 10.10.10.254SW1(config-if)#standby 10 priority 120SW1(config-if)#standby 10 preemptSW1(config-if)#standby 10 track f0/0 50SW1(config-if)#exitSW1(config)#int vlan 20SW1(config-if)#ip add 10.10.20.252 255.255.255.0 SW1(config-if)#no shSW1(config-if)#standby 20 ip add 10.10.20.254 SW1(config-if)#standby 20 preemptSW1(config-if)#exitSW1(config)#int vlan 30SW1(config-if)#ip add 10.10.30.252 255.255.255.0 SW1(config-if)#no shSW1(config-if)#standby 30 ip 10.10.30.254SW1(config-if)#standby 30 priority 120SW1(config-if)#standby 30 preemptSW1(config-if)#standby 30 track f0/0 50SW1(config-if)#exitSW1(config)#int vlan 40SW1(config-if)#ip add 10.10.40.252 255.255.255.0 SW1(config-if)#no shSW1(config-if)#standby 40 ip 10.10.40.254SW1(config-if)#standby 40 preemptSW1(config-if)#endSW1(config)#int vlan 50SW1(config-if)#ip add 10.10.50.252 255.255.255.0 SW1(config-if)#int vlan 60SW1(config-if)#ip add 10.10.60.252 255.255.255.0 SW1(config-if)#no shSW1(config-if)#endSW1#SW1#conf tSW1(config)#int f1/10SW1(config-if)#switchport mode accessSW1(config-if)#switchport access vlan 50SW1(config-if)#exitSW1(config)#ip route 0.0.0.0 0.0.0.0 10.10.50.1 SW1(config)#endSW1#SW2:Router>enRouter#conf tRouter(config)#host SW2SW2(config)#vtp domain HSRPSW2(config)#vtp mode clientSW2(config)#int port-channel 1SW2(config-if)#switchport mode trunkSW2(config)#int range f1/11 - 12SW2(config-if-range)#switchport mode trunkSW2(config-if-range)#switchport trunk allowed vlan all SW2(config-if-range)#channel-group 1 mode onSW2(config-if-range)#endSW2#conf tSW2(config)#int vlan 10SW2(config-if)#ip add 10.10.10.253 255.255.255.0 SW2(config-if)#no shSW2(config-if)#standby 10 ip 10.10.10.254SW2(config-if)#standby 10 preemptSW2(config-if)#exitSW2(config)#int vlan 20SW2(config-if)#ip add 10.10.20.253 255.255.255.0 SW2(config-if)#no shSW2(config-if)#standby 20 ip 10.10.20.254SW2(config-if)#standby 20 priority 120SW2(config-if)#standby 20 preemptSW2(config-if)#standby 20 track f0/1 50SW2(config-if)#exitSW2(config)#int vlan 30SW2(config-if)#ip add 10.10.30.253 255.255.255.0 SW2(config-if)#no shSW2(config-if)#standby 30 preemptSW2(config-if)#exitSW2(config)#int vlan 40SW2(config-if)#ip add 10.10.40.253 255.255.255.0 SW2(config-if)#standby 40 ip 10.10.40.254SW2(config-if)#standby 40 priority 120SW2(config-if)#standby 40 preemptSW2(config-if)#standby 40 track f0/1 50SW2(config-if)#endSW2#conf tSW2(config)#int vlan 50SW2(config-if)#ip add 10.10.50.252 255.255.255.0 SW2(config-if)#no shSW2(config-if)#int vlan 60SW2(config-if)#ip add 10.10.60.253 255.255.255.0 SW2(config-if)#no shSW2(config-if)#endSW2#conf tSW2(config)#int f1/10SW2(config-if)#switchport mode accessSW2(config-if)#switchport access vlan 60SW2(config-if)#exitSW2(config)#ip route 0.0.0.0 0.0.0.0 10.10.60.1 SW2(config)#endSW2#VRRP SW1<SW1>sys[SW1]vlan 10[SW1-vlan10]vlan 20[SW1-vlan20]valn 50[SW1-vlan50]vlan 60[SW1-vlan60]int vlan 50[SW1-Vlan-interface50]ip add 192.168.50.1 24 [SW1-Vlan-interface50]int vlan 60[SW1-Vlan-interface60]ip add 192.168.60.1 24 [SW1-Vlan-interface60]quit[SW1]ip route-static 0.0.0.0 0.0.0.0 192.168.50.252 [SW1]ip route-static 0.0.0.0 0.0.0.0 192.168.60.253 [SW1]int e0/4/3[SW1-Ethernet0/4/3]port link-type access[SW1-Ethernet0/4/3]port access vlan 50[SW1-Ethernet0/4/3]int e0/4/2[SW1-Ethernet0/4/2]port link-type access[SW1-Ethernet0/4/2]port access vlan 60[SW1-Ethernet0/4/2]quit[SW1]SW2<SW2>sys[SW2]vlan 10[SW2-vlan10]vlan 20[SW2-vlan20]vlan 50[SW2-vlan50]vlan 60[SW2-vlan60]int e0/4/3[SW2-Ethernet0/4/3]port link-type trunk[SW2-Ethernet0/4/3]port trunk permit vlan all [SW2-Ethernet0/4/3]int vlan 10[SW2-Vlan-interface10]ip add 192.168.10.252 24[SW2-Vlan-interface10]int vlan 20[SW2-Vlan-interface20]ip add 192.168.20.252 24[SW2-Vlan-interface20]int vlan 50[SW2-Vlan-interface50]ip add 192.168.50.252 24[SW2-Vlan-interface50]quit[SW2]int vlan 10[SW2-Vlan-interface10]vrrp vrid 10 virtual-ip 192.168.10.254[SW2-Vlan-interface10]vrrp vrid 10 priority 120[SW2-Vlan-interface10]vrrp vrid 10 preempt-mode[SW2-Vlan-interface10]vrrp vrid 10 track interface Vlan-interface 50 reduced 50 [SW2-Vlan-interface10]int vlan 20[SW2-Vlan-interface20]vrrp vrid 20 virtual-ip 192.168.20.254[SW2-Vlan-interface20]vrrp vrid 20 preempt-mode[SW2-Vlan-interface20]int e0/4/2[SW2-Ethernet0/4/2]port link-type access[SW2-Ethernet0/4/2]port access vlan 50[SW2-Ethernet0/4/2]quit[SW2]ip route-static 0.0.0.0 0.0.0.0 192.168.50.1SW3<SW3>sys[SW3]int e0/4/4[SW3]vlan 10[SW3-vlan10]vlan 20[SW3-vlan20]vlan 50[SW3-vlan50]vlan 60[SW3-vlan60]int e0/4/3[SW3-Ethernet0/4/3]port link-type trunk[SW3-Ethernet0/4/3]port trunk permit vlan all[SW3-Ethernet0/4/3]int vlan 10[SW3-Vlan-interface10]ip add 192.168.10.253 24[SW3-Vlan-interface10]int vlan 20[SW3-Vlan-interface20]ip add 192.168.20.253 24[SW3-Vlan-interface20]int vlan 60[SW3-Vlan-interface60]ip add 192.168.60.253 24[SW3-Vlan-interface60]int vlan 10[SW3-Vlan-interface10]vrrp vrid 10 virtual-ip 192.168.10.254[SW3-Vlan-interface10]vrrp vrid 10 preempt-mode[SW3-Vlan-interface10] int vlan 20[SW3-Vlan-interface20]vrrp vrid 20 virtual-ip 192.168.20.254[SW3-Vlan-interface20]vrrp vrid 20 priority 120[SW3-Vlan-interface20]vrrp vrid 20 preempt-mode[SW3-Vlan-interface20]vrrp vrid 20 track interface Vlan-interface 60 reduced 50 [SW3-Vlan-interface20]int e0/4/2[SW3-Ethernet0/4/2]port link-type access[SW3-Ethernet0/4/2]port access vlan 60[SW3-Ethernet0/4/2]quit[SW3]ip route-static 0.0.0.0 0.0.0.0 192.168.60.1。
CISCO HSRP工程实例

CISCO HSRP工程实例CISCO, HSRP, 实例, 工程下载 (100.5 KB)2007-6-9 19:57标记:接入层交换机我们标记为sw1,做热备的两台交换机,左边的我们标记为sw2,右边的标记为sw3。
说明:我这里的连线方式和拓扑上的不一样,具体方式如下:Switch1 F0/1 <----> Switch2 F0/1Switch1 F0/2 <----> Switch3 F0/2Switch2 F0/10 <----> Switch3 F0/10Switch2 F0/2 <----> Switch4 F0/2Switch3 F0/1 <----> Switch4 F0/1Router1 F0/0 <----> Switch4 F0/0本帖隐藏的内容需要回复才可以浏览router配置:Router#show runBuilding configuration...Current configuration : 1023 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname Router!boot-start-markerboot-end-marker!!no aaa new-modelmemory-size iomem 5!!ip cef!!!!!!!!!!!!!!!!!!!!!!interface FastEthernet0/0ip address 172.16.1.1 255.255.255.0 duplex autospeed auto!interface Serial1/0ip address 10.250.34.51 255.255.255.0 serial restart-delay 0!interface Serial1/1no ip addressshutdownserial restart-delay 0!interface Serial1/2no ip addressshutdownserial restart-delay 0!interface Serial1/3no ip addressshutdownserial restart-delay 0!ip http serverno ip http secure-server!ip route 0.0.0.0 0.0.0.0 Serial1/0 2ip route 192.168.10.0 255.255.255.0 172.16.1.2 ip route 192.168.10.0 255.255.255.0 172.16.1.3 ip route 192.168.20.0 255.255.255.0 172.16.1.3 ip route 192.168.20.0 255.255.255.0 172.16.1.2 !!!!control-plane!!!!!!!!!!line con 0line aux 0line vty 0 4login!!endsw1配置:sw1#show runBuilding configuration...Current configuration : 940 bytes!version 12.4service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption!hostname sw1!boot-start-markerboot-end-marker!!no aaa new-modelmemory-size iomem 5!!ip cef!!!!!!!!!!!!!!!!!!!!!!interface FastEthernet0/0 !interface FastEthernet0/1 switchport mode trunk!interface FastEthernet0/2 switchport mode trunk!interface FastEthernet0/3 !interface FastEthernet0/4 !interface FastEthernet0/5 !interface FastEthernet0/6 !interface FastEthernet0/7 !interface FastEthernet0/8 !interface FastEthernet0/9 !interface FastEthernet0/10 !interface FastEthernet0/11 !interface FastEthernet0/12 !interface FastEthernet0/13 !interface FastEthernet0/14 !interface FastEthernet0/15 !interface Vlan1no ip address!ip http serverno ip http secure-server !!!!!control-plane!!!!!!!!!!line con 0line aux 0line vty 0 4login!!endsw2配置:sw2#show runBuilding configuration...Current configuration : 1497 bytes!version 12.4service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption!hostname sw2!boot-start-markerboot-end-marker!!no aaa new-modelmemory-size iomem 5!!ip cef!!!!!!!!!!!!!!!!!!!!!!!!interface Port-channel1switchport mode trunk!interface FastEthernet0/0!interface FastEthernet0/1 switchport mode trunk!interface FastEthernet0/2no switchportip address 172.16.1.2 255.255.255.0 !interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10switchport mode trunkchannel-group 1 mode on!interface FastEthernet0/11switchport mode trunkchannel-group 1 mode on!interface FastEthernet0/12switchport mode trunkchannel-group 1 mode on!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface Vlan1no ip address!interface Vlan10ip address 192.168.10.254 255.255.255.0 standby 1 ip 192.168.10.250standby 1 timers 3 50standby 1 priority 200standby 1 preemptstandby 1 track FastEthernet0/2 150!interface Vlan20ip address 192.168.20.254 255.255.255.0 standby 2 ip 192.168.20.250standby 2 preemptstandby 2 track FastEthernet0/2!ip http serverno ip http secure-server!!!!!control-plane!!!!!!!!!!line con 0line aux 0line vty 0 4login!!endsw3配置:sw3#show runBuilding configuration...Current configuration : 1572 bytes!version 12.4service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption!hostname sw3!boot-start-markerboot-end-marker!!no aaa new-model memory-size iomem 5!!ip cef!!!!!!!!!!!!!!!!!!!!!!!!interface Port-channel1switchport mode trunk!interface FastEthernet0/0!interface FastEthernet0/1no switchportip address 172.16.1.3 255.255.255.0 !interface FastEthernet0/2 switchport mode trunk!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10 switchport mode trunkchannel-group 1 mode on!interface FastEthernet0/11 switchport mode trunkchannel-group 1 mode on!interface FastEthernet0/12 switchport mode trunkchannel-group 1 mode oninterface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface Vlan1no ip address!interface Vlan10ip address 192.168.10.253 255.255.255.0standby 1 ip 192.168.10.250standby 1 timers 3 50standby 1 preemptstandby 1 track FastEthernet0/1!interface Vlan20ip address 192.168.20.253 255.255.255.0standby 2 ip 192.168.20.250standby 2 priority 200standby 2 preemptstandby 2 track FastEthernet0/1 150!ip http serverno ip http secure-server!!!mac-address-table static 0000.0c07.ac02 interface FastEthernet0/10 vlan 20 !!control-plane!!!!!!!!!line con 0line aux 0line vty 0 4login!!endsw4我这里没有做任何配置,大家可以根据需要在上面作访问控制列表之类的配置,好了,配置过程中遇到了一些问题,不过最后都解决了,坚持就是胜利啊!。
CiscoHSRP的配置实例

CiscoHSRP的配置实例HSRP的配置实例HSRP中路由器的状态及状态转换在热等待组中,每个路由器运行着一个简单的状态机,通过当前的状态和事件的触发,而转换成不同的状态。
其中包括以下状态。
1.初始状态HSRP启动时的状态,HSRP还没有运行,一般是在改变配置或端口刚刚启动时进入该状态。
2.学习状态在该状态下,路由器还没有决定虚拟IP地址,也没有看到认证的、来自活动路由器的HELLO 报文。
路由器仍在等待活动路由器发来的HELLO报文。
3.监听状态路由器已经得到了虚拟IP地址,但是它既不是活动路由器也不是等待路由器。
它一直监听从活动路由器和等待路由器发来的HELLO报文。
4.说话状态在该状态下,路由器定期发送HELLO报文,并且积极参加活动路由器或等待路由器的竞选。
5.等待状态处于该状态的路由器是下一个候选的活动路由器,它定时发送HELLO报文。
6.活动状态处于活动状态的路由器承担转发数据包的任务,这些数据包是发给该组的虚拟MAC地址的。
它定时发出HELLO报文。
另外,每一个路由器都有3个计时器,即活动计时器、等待计时器和呼叫计时器。
状态的变化都是由事件引起的,不同的事件作用于不同的状态在就会产生不同的动作,如启动计时器、发报文等某校园网规模比较大,上网的主机相对比较多,共分配有16个C 类地址。
为了保证数据安全和广播风暴,提高网络性能,将校园网划分成60个子网。
在网络中心采用Cisco系统公司的Catalyst 5509作为中心交换机,并且带有RSM作为VLAN间的路由器,另外使用一个Cisco 7000系列的路由器和RSM。
它们都支持VLAN以及VLAN上的HSRP。
如图2所示。
在每一个虚拟局域网内都有一个HSRP组,从逻辑上讲,Cisco 7010和Cisco 5509的RSM在每个虚拟局域网上都有局域网接口,并且都配置有IP地址,同时配置一个虚拟地址,该地址作为在该虚拟局域网内所有主机的网关。
双组热备份HSRP详细配置实例

双组热备份HSRP详细配置实例【技术要点】HSRP 实际上在局域网用得较多,由于局域网内大多使用三层交换机,所以这时HSRP 是在交换机上配置的。
热备份HSRP详细配置网络拓扑图热备份HSRP详细配置过程R1配置1.r1(config)#int f0/02.r1(config-if)#ip add 192.168.1.1 255.255.255.03.r1(config-if)#no shu4.r1(config-if)#int f1/05.r1(config-if)#ip add 192.168.2.1 255.255.255.06.r1(config-if)#no shu7.r1(config)#router rip8.r1(config-router)#network 192.168.1.09.r1(config-router)#network 192.168.2.010.r1(config)#int f0/011.r1(config-if)#standby 47 ip 192.168.1.25412.r1(config-if)#standby 47 priority 180 优先级为18013.r1(config-if)#standby 47 preemtp 配置占先权14.r1(config-if)#standby 47 track f1/0 100 端口跟踪,优先级减少10015.r1(config-if)#standby 100 ip 192.168.1.25316.r1(config-if)#standby 100 priority 150R2配置1.r2(config)#int f0/0r2(config-if)#ip add 192.168.1.2 255.255.255.02.r2(config-if)#no shu3.r2(config-if)#int f1/04.r2(config-if)#ip add 192.168.3.1 255.255.255.05.r2(config-if)#no shu6.r2(config)#router rip8.r2(config-router)#network 192.168.3.09.r2(config)#int f0/010.r2(config-if)#standby 47 ip 192.168.1.254 备份组为47虚拟IP为1.25411.r2(config-if)#standby 47 priority 150 优先级为15012.r2(config-if)#standby 100 ip 192.168.1.25313.r2(config-if)#standby 100 priority 18014.r2(config-if)#standby 100 preempt15.r2(config-if)#standby 100 track f1/0 100R3配置1.r3(config)#int f0/02.r3(config-if)#ip add 192.168.2.2 255.255.255.03.r3(config-if)#no shu4.r3(config-if)#int f1/05.r3(config-if)#ip add 192.168.3.2 255.255.255.06.r3(config-if)#no shu7.r3(config-if)#int f2/08.r3(config-if)#ip add 192.168.4.1 255.255.255.09.r3(config-if)#no shu10.r3(config)#router rip11.r3(config-router)#network 192.168.2.012.r3(config-router)#network 192.168.3.014.VPCS1:ip 192.168.1.3 192.168.1.254 24 VPCS1IP为1.3网关为1.25415.VPCS2:ip 192.168.4.2 192.168.4.1 24 VPCS2IP为4.2网关为4.1再查看:R1#sh standbyFastEthernet0/0 - Group 47State is Active2 state changes, last state change 00:04:50Virtual IP address is 192.168.1.254Active virtual MAC address is 0000.0c07.ac2fLocal virtual MAC address is 0000.0c07.ac2f (v1 default)Hello time 3 sec, hold time 10 secNext hello sent in 0.800 secsPreemption enabledActive router is localStandby router is 192.168.1.2, priority 150 (expires in 8.776 sec)Priority 180 (configured 180)Track interface FastEthernet1/0 state Up decrement 100IP redundancy name is "hsrp-Fa0/0-47" (default)FastEthernet0/0 - Group 100State is Standby4 state changes, last state change 00:01:37Virtual IP address is 192.168.1.253Active virtual MAC address is 0000.0c07.ac64Local virtual MAC address is 0000.0c07.ac64 (v1 default)Hello time 3 sec, hold time 10 secNext hello sent in 1.824 secsPreemption disabledActive router is 192.168.1.2, priority 180 (expires in 7.092 sec)Standby router is localPriority 150 (configured 150)IP redundancy name is "hsrp-Fa0/0-100" (default)R2#sh standby briP indicates configured to preempt.|Interface Grp Prio P State Active Standby Virtual IPFa0/0 47 150 Standby 192.168.1.1 local 192.168.1.254Fa0/0 100 180 P Active local 192.168.1.1 192.168.1.253总结:1)配置多个HSRP组:之前的步骤已经虚拟了192.168.1.254网关,对于这个网关只能有一个活动路由器,于是这个路由器将承担全部的数据流量。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
HSRP的配置实例
HSRP中路由器的状态及状态转换
在热等待组中,每个路由器运行着一个简单的状态机,通过当前的状态和事件的触发,而转换成不同的状态。
其中包括以下状态。
1.初始状态HSRP启动时的状态,HSRP还没有运行,一般是在改变配置或端口刚刚启动时进入该状态。
2.学习状态在该状态下,路由器还没有决定虚拟IP地址,也没有看到认证的、来自活动路由器的HELLO 报文。
路由器仍在等待活动路由器发来的HELLO报文。
3.监听状态路由器已经得到了虚拟IP地址,但是它既不是活动路由器也不是等待路由器。
它一直监听从活动路由器和等待路由器发来的HELLO报文。
4.说话状态在该状态下,路由器定期发送HELLO报文,并且积极参加活动路由器或等待路由器的竞选。
5.等待状态处于该状态的路由器是下一个候选的活动路由器,它定时发送HELLO报文。
6.活动状态处于活动状态的路由器承担转发数据包的任务,这些数据包是发给该组的虚拟MAC地址的。
它定时发出HELLO报文。
另外,每一个路由器都有3个计时器,即活动计时器、等待计时器和呼叫计时器。
状态的变化都是由事件引起的,不同的事件作用于不同的状态在就会产生不同的动作,如启动计时器、发报文等
某校园网规模比较大,上网的主机相对比较多,共分配有16个C类地址。
为了保证数据安全和广播风暴,提高网络性能,将校园网划分成60个子网。
在网络中心采用Cisco系统公司的Catalyst 5509作为中心交换机,并且带有RSM作为VLAN间的路由器,另外使用一个Cisco 7000系列的路由器和RSM。
它们都支持VLAN以及VLAN上的HSRP。
如图2所示。
在每一个虚拟局域网内都有一个HSRP组,从逻辑上讲,Cisco 7010和Cisco 5509的RSM在每个虚拟局域网上都有局域网接口,并且都配置有IP地址,同时配置一个虚拟地址,该地址作为在该虚拟局域网内所有主机的网关。
下面以VLAN 9为例,RSM中VLAN 9的配置如下:
---- interface Vlan9
---- description surportcenter
---- ip address 202.120.95.66 255.255.255.224
该路由器在该VLAN9上的接口的IP地址以及掩码
no ip redirects
no ip directed-broadcast
no ip route-cache cef
standby 9 timers 3 250
定义热等待组号为9,每3秒交换一次hello信息,250没有收到hello信息就开切换
standby 150 priority 110
定义路由器的权值,值越大,成为活动路由器的希望越大
standby 9 preempt
Enable该组的HSRP抢占功能,谁的权值大就可以立即成为活动路由器
standby 9 ip 202.120.95.65
该组的虚拟IP地址,作为该VLAN中主机的网关地址
Cisco 7010路由器中接口的配置如下:
interface FastEthernet0/0.9
description surportcenter
ip address 202.120.95.67 255.255.255.224
cisco7010在VLAN9上的接口的IP地址以及掩码,该地址和RSM中的地址必须属于同一个子网,并且不同
no ip redirects
encapsulation is l 9
所使用的虚拟局域网协议
standby 9 timers 3 250
和在RSM中的含义一样,并且必须相同
standby 9 priority 100
比在RSM中的值小,所以RSM在该VLAN中为活动的
standby 9 preempt
和在RSM中含义一样
standby 9 ip 202.120.95.65
该组的虚拟IP地址,必须和RSM中一样
为了达到负载均衡的目的,应该使Cisco 5509 RSM和Cisco 7010承担大致相同的负载,我们的方法是,在RSM中,VLAN 1到VLAN 30的权值为110,VLAN 31到VLAN 60的权值为100; 相反,在Cisco 7010中,VLAN 1到VLAN 30的权值为100,VLAN 31到VLAN 60的权值为100。
这样,在正常情况下,Cisco 5509
的RSM负责VLAN 1到VLAN 30的路由,Cisco 7010负责VLAN 31到VLAN 60的路由。
如果有一方出现了故障,将由另一个来负载全部的路由工作。
五、HSRP存在的问题
对于在HSRP协议,最大的问题是没有提供安全防护,在一个局域网内部,通过发送虚假的UDP多播数据包很容易对局域网中的路由器实施攻击,导致数据包黑洞(Packet Black Hole)和拒绝服务攻击
(Denial-of-Service Attack)。
一般无法从一个局域网的外部实施攻击,因为大多数路由器都不转发目的地址为所有路由器的多播地址(224.0.0.2)。
HSRP只是实现了路由器的平滑切换,使用户感觉不到这种切换,保证了网络的稳定性。
但是,一个HSRP
组内的路由器不能互通它们的其他网络配置信息,例如访问控制列表等。
所以在管理实施管理时,为了保证一致性,必须对它们进行相同的修改,增加了管理的复杂性,这也许是为了提高性能而付出的代价吧。