神州数码交换机HSRP实验
实验六-HSRP与上行链路跟踪

一、实验目的1、组网要求企业总部局域网采用两台核心交换机组网来提高网络可靠性,为防止二层环路,需要全网运行STP;将SW1部署为跟网桥,SW2部署为备份跟网桥,并将接入PC的接口配置为portfast 端口;SW1—SW2之间使用链路捆绑进一步提高可靠性;同时,部署HSRP为内部vlan提供网关冗余。
本局域网有4个vlan,生产业务vlan10,办公业务vlan11,二层交换机网管vlan8;将SW1部署为vlan8/10/11的主网关,将SW2部署为vlan11的主网关;要求vlan10,vlan11的主网关跟踪上行链路。
2、测试HSRP主备网关倒换。
3、分析PC1 ping PC2的三层通信过程和二层通信过程。
二、实验拓扑三、实验内容1、基本信息配置SW1Switch>enable//进入全局模式Switch#config terminal//进入特权模式Switch(config)#hostname SW1//设置主机名SW1(config)#no ip domain lookup//禁用域名查找SW1(config)#enable password ip//设置进入特权模式密码SW1(config)#line console 0//连接到console线口SW1(config-line)#logging synchronous //自动换行SW1(config-line)#exec-t 0//超时为0SW1(config-line)#password ip//设置进入console线口的密码SW1(config-line)#login//进入console线口是需要进行认证SW1(config-line)#exit//退出console线口SW1(config)#line aux 0//进入线口SW1(config-line)#logging synchronous //自动换行SW1(config-line)#exec-t 0//超时为0SW1(config-line)#password bluefox//设置进入本线口的密码SW1(config-line)#login//设置进入线口是进行认证SW1(config-line)#exit//退出线口SW1(config)#line vty 04//进入线口SW1(config-line)#logging synchronous //自动换行SW1(config-line)#exec-t 0//超时为0SW1(config-line)#password bluefox//设置进入密码SW1(config-line)#login//设置进入是进行认证SW1(config-line)#exit//退出线口SW2Switch>enableSwitch#config terminalSwitch(config)#hostname SW2SW2(config)#no ip domain lookup SW2(config)#enable password ipSW2(config)#line console 0SW2(config-line)#logging synchronous SW2(config-line)#exec-t 0SW2(config-line)#password ipSW2(config-line)#loginSW2(config-line)#exitSW2(config)#line aux 0SW2(config-line)#logging synchronous SW2(config-line)#exec-t 0SW2(config-line)#password bluefox SW2(config-line)#loginSW2(config-line)#exitSW2(config)#line vty 04SW2(config-line)#logging synchronous SW2(config-line)#exec-t 0SW2(config-line)#password bluefox SW2(config-line)#loginSW2(config-line)#exitSW3SW3>enableSW3#config terminalSW3(config)#hostname SW3SW3(config)#no ip domain lookupSW3(config)#enable password ipSW3(config)#line console 0SW3(config-line)#logging synchronous SW3(config-line)#exec-t 0SW3(config-line)#password ipSW3(config-line)#loginSW3(config-line)#exitSW3(config)#line aux 0SW3(config-line)#logging synchronous SW3(config-line)#exec-t 0SW3(config-line)#password bluefox SW3(config-line)#loginSW3(config-line)#exitSW3(config)#line vty 04SW3(config-line)#logging synchronous SW3(config-line)#exec-t 0SW3(config-line)#password bluefox SW3(config-line)#loginSW3(config-line)#exitRT5Router>enableRouter#config terminalRouter(config)#hostname RT5RT5(config)#no ip domain lookupRT5(config)#enable password ipRT5(config)#line console 0RT5(config-line)#logging synchronous RT5(config-line)#exec-t 0RT5(config-line)#password ipRT5(config-line)#loginRT5(config-line)#exitRT5(config)#line aux 0RT5(config-line)#logging synchronous RT5(config-line)#exec-t 0RT5(config-line)#password bluefox RT5(config-line)#loginRT5(config-line)#exitRT5(config)#line vty 04RT5(config-line)#logging synchronous RT5(config-line)#exec-t 0RT5(config-line)#password bluefox RT5(config-line)#loginRT5(config-line)#exitRT6Router>enableRouter#config terminalRouter(config)#hostname RT6RT6(config)#no ip domain lookupRT6(config)#enable password ipRT6(config)#line console 0RT6(config-line)#logging synchronous RT6(config-line)#exec-t 0RT6(config-line)#password ipRT6(config-line)#loginRT6(config-line)#exitRT6(config)#line aux 0RT6(config-line)#logging synchronous RT6(config-line)#exec-t 0RT6(config-line)#password bluefox RT6(config-line)#loginRT6(config-line)#exitRT6(config)#line vty 04RT6(config-line)#logging synchronousRT6(config-line)#exec-t 0RT6(config-line)#password bluefoxRT6(config-line)#loginRT6(config-line)#exit2、创建vlanSW1SW1#vlan database//进入vlan database模式SW1(vlan)#vlan 8//创建vlan8SW1(vlan)#vlan 10//创建vlan10SW1(vlan)#vlan 11//创建vlan11SW1(vlan)#exit//退出vlan database模式、SW2SW2#vlan database//进入vlan database模式SW2(vlan)#vlan 8//创建vlan8SW2(vlan)#vlan 10//创建vlan10SW2(vlan)#vlan 11//创建vlan11SW2(vlan)#exit//退出vlan database模式SW3SW3#vlan database//进入vlan数据库SW3(vlan)#vlan 8//创建vlan8SW3(vlan)#vlan 10//创建vlan10SW3(vlan)#vlan 11//创建vlan11SW3(vlan)#exit//退出vlan database模式4、跟网桥配置SW1SW1(config)#spanning-tree vlan 8 priority 0 //配置sw1为vlan8的跟网桥SW1(config)#spanning-tree vlan 10 priority 0//配置sw1为vlan10的跟网桥SW1(config)#spanning-tree vlan 11 priority 0//配置sw1为vlan11 的跟网桥注:模拟器上不支持批量配置vlan跟网桥,只能一个一个配置SW2SW2(config)#spanning-tree vlan 8 priority 4096//配置sw2为vlan8的备份网桥SW2(config)#spanning-tree vlan 10 priority 4096//配置sw2为vlan10 的备份网桥SW2(config)#spanning-tree vlan 11 priority 4096//配置sw2为vlan11的备份网桥5、二层链路捆绑SW1SW1(config)#interface range fastEthernet 0/1 -2//进入端口1和2SW1(config-if-range)#switchport trunk encapsulation dot1q//设置trunk封装协议为dot1qSW1(config-if-range)#switchport mode trunk//端口为trunk模式SW1(config-if-range)#switchport trunk allowed vlan all//配置trunk允许所有vlan通过SW1(config-if-range)#channel-group 2 mode on//将端口1和2划分到通道组2中SW1(config-if-range)#exit//退出端口1和2SW2SW2(config)#interface range fastEthernet 0/1 -2//进入端口1 和2SW2(config-if-range)#switchport trunk encapsulation dot1q//配置trunk封装协议为dot1qSW2(config-if-range)#switchport mode trunk//配置端口为trunk接口SW2(config-if-range)#switchport trunk allowed vlan all//配置trunk允许所有vlan通过SW2(config-if-range)#channel-group 2 mode on//将接口1和2 划分到通道组2中SW2(config-if-range)#exit//退出接口6、二层接口配置SW1SW1(config)#interface fastEthernet 0/3//进入接口SW1(config-if)#switchport trunk encapsulation dot1qSW1(config-if)#switchport mode trunk//配置接口为trunk接口SW1(config-if)#switchport trunk allowed vlan all//配置trunk允许所有vlan通过SW1(config-if)#exit//退出端口SW2SW2(config)#interface fastEthernet 0/3//进入接口SW2(config-if)#switchport trunk encapsulation dot1q//配置trunk封装协议为dot1qSW2(config-if)#switchport mode trunk//配置接口为trunk接口SW2(config-if)#switchport trunk allowed vlan all//配置trunk允许所有vlan通过SW2(config-if)#exit//退出接口SW3SW3(config)#interface fastEthernet 0/10//进入接口SW3(config-if)#switchport mode access//配置接口为access接入模式SW3(config-if)#switchport access vlan 10//将接口划分到vlan10 中SW3(config-if)# spanning-tree portfast//设置接口为portfast模式,SW3(config-if)#exit//退出接口SW3(config)#interface fastEthernet 0/11//进入接口SW3(config-if)#switchport mode access//配置接口为access接入模式SW3(config-if)#switchport access vlan 11//将接口划分到vlan11中SW3(config-if)# spanning-tree portfast//设置接口为portfast模式SW3(config-if)#exit//退出接口SW3(config)#interface range fastEthernet 0/1 -2//进入接口1和2,此处为批量设置,因为两个接口的配置相同SW3(config-if-range)#switchport trunk encapsulation dot1qSW3(config-if-range)#switchport mode trunk//配置接口为trunk模式SW3(config-if-range)#switchport trunk allowed vlan all//配置trunk允许所有vlan通过SW3(config-if-range)#exit//退出接口1和27、二层设备网管地址配置SW3(config)#interface vlan 8//为sw3配置网管地址SW3(config-if)#ip address 192.168.8.132 255.255.255.128 //配置ip地址SW3(config-if)#no shutdown//启用端口SW3(config-if)#exit//退出8、三层接口配置SW1SW1(config)#interface vlan 8//配置vlan8的路由点SW1(config-if)#ip address 192.168.8.130 255.255.255.128 //配置ip地址SW1(config-if)#no shutdown//启用SW1(config-if)#exit//退出SW1(config)#interface vlan 10//配置vlan10的路由点SW1(config-if)#ip address 192.168.10.2 255.255.255.0//配置ip地址SW1(config-if)#no shutdown//启用SW1(config-if)#exit//退出SW1(config)#interface vlan 11//配置vlan11的路由点SW1(config-if)#ip address 192.168.11.2 255.255.255.0//配置ipSW1(config-if)#no shutdown//启用SW1(config-if)#exitSW2SW2(config)#interface vlan 8//配置vlan8的路由点SW2(config-if)#ip address 192.168.8.131 255.255.255.128 //配置ip地址SW2(config-if)#no shutdown//启用SW2(config-if)#exit//退出SW2(config)#interface vlan 10//配置vlan10的路由点SW2(config-if)#ip address 192.168.10.3 255.255.255.0//配置ip地址SW2(config-if)#no shutdown//启用SW2(config-if)#exit//退出SW2(config)#interface vlan 11//配置vlan11的路由点SW2(config-if)#ip address 192.168.11.3 255.255.255.0//配置ipSW2(config-if)#no shutdown//启用SW2(config-if)#exitSW1上行链路SW1(config)#interface fastEthernet 0/12//进入接口SW1(config-if)#no switchport//配置接口为三层接口SW1(config-if)#ip address 192.168.9.1 255.255.255.252 //为接口配置IP地址SW1(config-if)#no shutdown//打开接口SW1(config-if)#exit//退出接口RT5(config)#interface ethernet 0/0//进入接口RT5(config-if)#ip address 192.168.9.2 255.255.255.252 //配置IP地址RT5(config-if)#no shutdown//打开接口RT5(config-if)#exit//退出接口SW2上行链路SW2(config)#interface fastEthernet 0/12//进入接口SW2(config-if)#no switchport//配置接口为三层接口SW2(config-if)#ip address 192.168.9.5 255.255.255.252//配置IP地址SW2(config-if)#no shutdown//打开接口SW2(config-if)#exit//退出接口RT6(config)#interface ethernet 0/0//进入接口RT6(config-if)#ip address 192.168.9.6 255.255.255.252//配置IP地址RT6(config-if)#no shutdown//打开端口RT6(config-if)#exit//退出端口9、HSRP部署SW1上的HSRP配置SW1(config)#interface vlan 8SW1(config-if)#standby 8 ip 192.168.8.129//配置HSRP组8的虚IPSW1(config-if)#standby 8 priority 120//设置组8 的优先级SW1(config-if)#standby 8 preempt//配置组8的抢占SW1(config-if)#exitSW1(config)#interface vlan 10SW1(config-if)#standby 10 ip 192.168.10.1//配置组10 的虚IPSW1(config-if)#standby 10 priority 120//配置组10的优先级SW1(config-if)#standby 10 preempt配置组10的抢占SW1(config-if)#standby 10 track fastethernet 0/12 30//配置HSRP组10跟踪上连接口,上连接口DOWN时优先级减30 SW1(config-if)#exitSW1(config)#interface vlan 11SW1(config-if)#standby 11 ip 192.168.11.1//配置组11的虚IPSW1(config-if)#standby 11 preempt//配置组11的抢占SW1(config-if)#exitSW2上HSRP的配置SW2(config)#interface vlan 8SW2(config-if)#standby 8 ip 192.168.8.129//配置组8的虚IPSW2(config-if)#standby 8 preempt//配置组8的抢占SW2(config-if)#exitSW2(config)#interface vlan 10SW2(config-if)#standby 10 ip 192.168.10.1//配置组10的虚IPSW2(config-if)#standby 10 preempt//配置10的抢占SW2(config-if)#exitSW2(config)#interface vlan 11SW2(config-if)#standby 11 ip 192.168.11.1//配置组11的虚IPSW2(config-if)#standby 11 priority 120//配置组11的优先级SW2(config-if)#standby 11 preempt//配置组11的抢占SW2(config-if)#standby 11 track fastethernet 0/12 30//配置组11跟踪上连接口,上连接口down时优先级减30SW2(config-if)#exit注:不配置优先级时默认是10010、开启三层交换路由功能SW1(config)#ip routingSW2(config)#ip routing11、静态路由SW1(config)#ip route 192.168.9.4 255.255.255.252 192.168.10.3SW2(config)#ip route 192.168.9.0 255.255.255.252 192.168.10.2RT5(config)#ip route 0.0.0.0 0.0.0.0 192.168.9.1RT6(config)#ip route 0.0.0.0 0.0.0.0 192.168.9.5四、实验结果SW1#show standby briefP indicates configured to preempt.Interface Grp Prio P State Active Standby Virtual IPVl8 8 120 P Active local 192.168.8.131 192.168.8.129 Vl10 10 120 P Active local 192.168.10.3 192.168.10.1 Vl11 11 100 P Standby 192.168.11.3 local 192.168.11.1SW2#show standby briefP indicates configured to preempt.Interface Grp Prio P State Active Standby Virtual IPVl8 8 100 P Standby 192.168.8.130 local 192.168.8.129 Vl10 10 100 Standby 192.168.10.2 local 192.168.10.1 Vl11 11 120 P Active local 192.168.11.2 192.168.11.1Show running-config信息截取SW1interface Vlan8ip address 192.168.8.130 255.255.255.128standby 8 ip 192.168.8.129standby 8 priority 120standby 8 preempt!interface Vlan10ip address 192.168.10.2 255.255.255.0standby 10 ip 192.168.10.1standby 10 priority 120standby 10 preempt!interface Vlan11ip address 192.168.11.2 255.255.255.0standby 11 ip 192.168.11.1standby 11 preempt!SW2interface Vlan8ip address 192.168.8.131 255.255.255.128standby 8 ip 192.168.8.129standby 8 preempt!interface Vlan10ip address 192.168.10.3 255.255.255.0standby 10 ip 192.168.10.1standby 10 preempt!interface Vlan11ip address 192.168.11.3 255.255.255.0standby 11 ip 192.168.11.1standby 11 priority 120standby 11 preempt全网连通性测试PC1VPCS 1 >ping 192.168.8.132192.168.8.132 icmp_seq=1 timeout192.168.8.132 icmp_seq=2 time=35.000 ms 192.168.8.132 icmp_seq=3 time=44.000 ms 192.168.8.132 icmp_seq=4 time=13.000 ms 192.168.8.132 icmp_seq=5 time=49.000 msVPCS 1 >ping 192.168.11.100192.168.11.100 icmp_seq=1 time=11.000 ms 192.168.11.100 icmp_seq=2 time=10.000 ms 192.168.11.100 icmp_seq=3 time=45.000 ms 192.168.11.100 icmp_seq=4 time=10.000 ms 192.168.11.100 icmp_seq=5 time=10.000 msVPCS 1 >ping 192.168.9.2192.168.9.2 icmp_seq=1 time=51.000 ms 192.168.9.2 icmp_seq=2 time=14.000 ms 192.168.9.2 icmp_seq=3 time=21.000 ms 192.168.9.2 icmp_seq=4 time=43.000 ms 192.168.9.2 icmp_seq=5 time=13.000 msVPCS 1 >ping 192.168.9.6192.168.9.6 icmp_seq=1 time=59.000 ms 192.168.9.6 icmp_seq=2 time=12.000 ms 192.168.9.6 icmp_seq=3 time=17.000 ms 192.168.9.6 icmp_seq=4 time=15.000 ms 192.168.9.6 icmp_seq=5 time=19.000 ms PC2VPCS 2 >ping 192.168.10.100192.168.10.100 icmp_seq=1 timeout192.168.10.100 icmp_seq=2 time=14.000 ms 192.168.10.100 icmp_seq=3 time=11.000 ms 192.168.10.100 icmp_seq=4 time=10.000 ms 192.168.10.100 icmp_seq=5 time=46.000 msVPCS 2 >ping 192.168.8.132192.168.8.132 icmp_seq=1 timeout192.168.8.132 icmp_seq=2 timeout192.168.8.132 icmp_seq=3 timeout192.168.8.132 icmp_seq=4 time=21.000 ms192.168.8.132 icmp_seq=5 time=9.000 msVPCS 2 >ping 192.168.8.132192.168.8.132 icmp_seq=1 time=28.000 ms192.168.8.132 icmp_seq=2 time=10.000 ms192.168.8.132 icmp_seq=3 time=14.000 ms192.168.8.132 icmp_seq=4 time=9.000 ms192.168.8.132 icmp_seq=5 time=44.000 msVPCS 2 >ping 192.168.9.6192.168.9.6 icmp_seq=1 timeout192.168.9.6 icmp_seq=2 time=31.000 ms192.168.9.6 icmp_seq=3 time=18.000 ms192.168.9.6 icmp_seq=4 time=16.000 ms192.168.9.6 icmp_seq=5 time=18.000 msVPCS 2 >ping 192.168.9.2192.168.9.2 icmp_seq=1 timeout192.168.9.2 icmp_seq=2 timeout192.168.9.2 icmp_seq=3 time=22.000 ms192.168.9.2 icmp_seq=4 time=21.000 ms192.168.9.2 icmp_seq=5 time=88.000 msHSRP主备切换测试将SW1上的fa0/12shutdown后SW1#show standby briefP indicates configured to preempt.|Interface Grp Prio P State Active Standby Virtual IPVl8 8 120 P Active local 192.168.8.131 192.168.8.129 Vl10 10 90 P Standby 192.168.10.3 local 192.168.10.1 Vl11 11 100 P Standby 192.168.11.3 local 192.168.11.1SW2#show standby briefP indicates configured to preempt.|Interface Grp Prio P State Active Standby Virtual IPVl8 8 100 P Standby 192.168.8.130 local 192.168.8.129 Vl10 10 100 P Active local 192.168.10.2 192.168.10.1 Vl11 11 120 P Active local 192.168.11.2 192.168.11.1将SW2上的fa0/12shutdown后SW1#show standby briefP indicates configured to preempt.|Interface Grp Prio P State Active Standby Virtual IPVl8 8 120 P Active local 192.168.8.131 192.168.8.129Vl10 10 120 P Active local 192.168.10.3 192.168.10.1Vl11 11 100 P Active local 192.168.11.3 192.168.11.1SW2#show standby briefP indicates configured to preempt.|Interface Grp Prio P State Active Standby Virtual IPVl8 8 100 P Standby 192.168.8.130 local 192.168.8.129Vl10 10 100 P Standby 192.168.10.2 local 192.168.10.1Vl11 11 90 P Standby 192.168.11.2 local 192.168.11.1五、实验分析与心得简单分析PC1 ping PC2的通信过程:1、 PC1发送数据给网关SW1,因为它是vlan10 的主网关,SW3收到数据后,查MAC地址表从fa0/1端口发送出去;2、 SW1收到数据后,解封装,发现MAC地址是自己,但是目的ip不是自己,查路由表,重新封装数据,从fa0/3端口发送出去;3、SW3收到数据帧后,查MAC地址表,从fa0/11端口发送出去。
HSRP实验(2015.05.05)

两台三层交换机HSRP综合实例Laird.ZhangVersion 1.0配置1.1详述1.1.1拓扑图1.1.2说明SW1和SW2是两台三层交换机,SW3和SW4是两台二层交换机,R1是一台路由器,PC1、PC2、PC3和PC4是用四台路由模拟的PC。
SW1和SW2是双核心,它们之间做HSRP,用做端口汇聚(聚合)的两条链路来连接。
R1用来模拟该网络出口,用loopback0来模拟外网接口,SW3和SW4为PC1、PC2、PC3和PC4提供接入。
创建有4个VLAN:VLAN10、VLAN20、VLAN30和VLAN40,PC1、PC2、PC3和PC4分别属于VLAN10、VLAN20、VLAN30和VLAN40。
SW1的地址:VLAN10为10.1.10.253,VLAN20为10.1.20.253,VLAN30为10.1.30.253,VLAN40为10.1.40.253。
SW2的地址:VLAN10为10.1.10.252,VLAN20为10.1.20.252,VLAN30为10.1.30.252,VLAN40为10.1.40.252。
PC的IP地址:VLAN10为10.1.10.1,VLAN20为10.1.20.1,VLAN30为10.1.30.1,VLAN40为10.1.40.1。
HSRP的虚拟IP地址:VLAN10为10.1.10.254,VLAN20为10.1.20.254,VLAN30为10.1.30.254,VLAN40为10.1.40.254。
R1与SW1和SW2通过三层接口连接:R1的Fa2/0的IP地址为10.1.1.2/30,SW1的F0/2的IP地址为10.1.1.1/30;R1的Fa3/0的IP地址为10.1.1.6/30,SW2的Fa0/3的IP地址为10.1.1.5/30;R1的Loopback0的IP地址为10.1.1.8/32SW1是HSRP10和HSRP30的活动路由器,也是VLAN10和VLAN30的跟桥;SW2分别是HSRP20和HSRP40的活动路由器,也是VLAN20和VLAN40的跟桥。
HSRP实验报告

拓扑Switch1 F0/0 <----> Switch2 F0/0Switch1 F0/1 <----> Switch3 F0/0Switch2 F0/1 <----> Switch3 F0/1Switch1 F0/2 <----> VPCS V0/1Switch2 F0/2 <----> VPCS V0/2Switch3 F0/2 <----> VPCS V0/3Switch3 F0/3 <----> VPCS V0/4Switch3 F0/4 <----> VPCS V0/5(模拟为三层交换机)Switch1 F0/0 F0/2 为三层接口F0/1 为二层接口(属于VLAN10)(模拟为三层交换机)Switch2 F0/0 F0/2 为三层接口F0/1 为二层接口(属于VLAN10)(模拟为二层交换机)Switch3 F0/0 - 5 为二层接口(属于VLAN10)在S1和S2 VLAN10 接口配置如下:S1:ip address 192.168.10.10 255.255.255.0standby 10 ip 192.168.10.1standby 10 priority 200standby 10 preemptS2:ip address 192.168.10.10 255.255.255.0standby 10 ip 192.168.10.1standby 10 priority 150standby 10 preempt虚拟主机IP地址设置:VPCS V0/1 IP=192.168.2.2 192.168.2.1/24VPCS V0/2 IP=192.168.3.2 192.168.3.1/24VPCS V0/3 IP=192.168.10.2 192.168.10.1/24VPCS V0/4 IP=192.168.10.3 192.168.10.1/24VPCS V0/5 IP=192.168.10.4 192.168.10.1/24实验结论:三层接口没有生成树,即只有S1的F0/1,S2的F0/1,S3的F0/0 - 5 运行生成树;第一种情况:当主网关失效的时候,备用网关便马上进行抢占,切换时间速度快(3-5秒左右);当主网关链路恢复的时候,接口因需要考虑生成树状态,不能马上进入转发状态,通常需要30秒时间过后,才能引发网关抢占,这段时间内两个网关都无法使用(即从主网关链路状态恢复为UP,然后经过生成树状态30秒,再加3-5秒抢占时间),可以通过给S1的F0/1,S2的F0/2配置PORTFAST特性以提高切换速度,或者交换机使用其它能够快速会聚的生成树协议。
HSRP实验

HSRP 一网络拓扑图二实验思路1.vlan trunk 的配置2.ip地址配置3.DHCP DHCP中继配置4.HSRP配置三实验步骤ESW3的基本步骤ESW3#vlan databaseESW3(vlan)#vlan 10VLAN 10 modified:ESW3(vlan)#vlan 20VLAN 20 modified:ESW3(vlan)#vlan 30VLAN 30 modified:ESW3(vlan)#vlan 40VLAN 40 modified:ESW3(vlan)#exitESW3#configESW3(config)#interface f1/0ESW3(config-if)#switchport mode access ESW3(config-if)#switchport access vlan 10 ESW3(config-if)#interface f1/1ESW3(config-if)#switchport mode access ESW3(config-if)#switchport access vlan 20 ESW3(config-if)#interface f1/2ESW3(config-if)#switchport mode access ESW3(config-if)#switchport access vlan 30 ESW3(config-if)#interface f1/3ESW3(config-if)#switchport mode accessESW3(config-if)#switchport access vlan 40ESW3(config-if)#exitESW3(config)#interface fastEthernet 1/4ESW3(config-if)#switchport trunk encapsulation dot1q ESW3(config-if)#switchport mode trunkESW3(config-if)#interface fastEthernet 1/5ESW3(config-if)#switchport trunk encapsulation dot1q ESW3(config-if)#switchport mode trunkESW1的基本配置ESW1#vlan databaseESW1(vlan)#vlan 10VLAN 10 modified:ESW1(vlan)#vlan 20VLAN 20 modified:ESW1(vlan)#vlan 30VLAN 30 modified:ESW1(vlan)#vlan 40VLAN 40 modified:ESW1(vlan)#exitESW1(config)#interface fastEthernet1/2ESW1(config-if)#ip address 192.168.100.1 255.255.255.0 ESW1(config)#interface fastEthernet 1/0ESW1(config-if)#switchport trunk encapsulation dot1q ESW1(config-if)#switchport mode trunkESW1(config-if)#interface fastEthernet 1/1ESW1(config-if)#switchport trunk encapsulation dot1q ESW1(config-if)#switchport mode trunkESW1(config-if)#exESW1(config)#interface vlan 10ESW1(config-if)#ip address 192.168.10.1 255.255.255.0 ESW1(config-if)#standby 10 ip 192.168.10.254ESW1(config-if)# standby 10 priority 200ESW1(config-if)#standby 10 preemptESW1(config)#interface vlan 20ESW1(config-if)#ip address 192.168.20.1 255.255.255.0 ESW1(config-if)#standby 20 ip 192.168.20.254ESW1(config-if)# standby 20 priority 200ESW1(config-if)#standby 20 preemptESW1(config)#interface vlan 30ESW1(config-if)#ip address 192.168.30.1 255.255.255.0 ESW1(config-if)#standby 30 ip 192.168.30.254ESW1(config-if)#standby 30 priority 150ESW1(config-if)#standby 30 preemptESW1(config)#interface vlan 40ESW1(config-if)#ip address 192.168.40.1 255.255.255.0ESW1(config-if)#standby 40 ip 192.168.40.254 ESW1(config-if)#standby 40 priority 150ESW1(config-if)#standby 40 preemptESW1(config-if)#exESW1(config)#interface vlan 10ESW1(config-if)#ip helper-address 192.168.100.2 ESW1(config)#interface vlan 20ESW1(config-if)#ip helper-address 192.168.100.2 ESW1(config)#interface vlan 30ESW1(config-if)#ip helper-address 192.168.100.2 ESW1(config)#interface vlan 40ESW1(config-if)#ip helper-address 192.168.100.2 ESW2的基本配置ESW2#vlan databaseESW2(vlan)#vlan 10VLAN 10 modified:ESW2(vlan)#vlan 20VLAN 20 modified:ESW2(vlan)#vlan 30VLAN 30 modified:ESW2(vlan)#vlan 40VLAN 40 modified:ESW2(vlan)#exitESW2(config)#interface fastEthernet1/2ESW2(config-if)#ip address 192.168.200.1 255.255.255.0 ESW2(config)#interface fastEthernet 1/0ESW2(config-if)#switchport trunk encapsulation dot1q ESW2(config-if)#switchport mode trunkESW2(config-if)#interface fastEthernet 1/1ESW2(config-if)#switchport trunk encapsulation dot1q ESW2(config-if)#switchport mode trunkESW2(config-if)#exESW2(config)#interface vlan 10ESW2(config-if)#ip address 192.168.10.2 255.255.255.0 ESW2(config-if)#standby 10 ip 192.168.10.254ESW2(config-if)#standby 10 priority 150ESW2(config-if)#standby 10 preemptESW2(config)#interface vlan 20ESW2(config-if)#ip address 192.168.20.2 255.255.255.0 ESW2(config-if)#standby 20 ip 192.168.20.254ESW2(config-if)# standby 20 priority 150ESW2(config-if)#standby 20 preemptESW2(config)#interface vlan 30ESW2(config-if)#ip address 192.168.30.2 255.255.255.0 ESW2(config-if)#standby 30 ip 192.168.30.254ESW2(config-if)#standby 30 priority 200ESW2(config-if)#standby 30 preemptESW2(config)#interface vlan 40ESW2(config-if)#ip address 192.168.40.2 255.255.255.0 ESW2(config-if)#standby 40 ip 192.168.40.254ESW2(config-if)#standby 40 priority 200ESW2(config-if)#standby 40 preemptESW2(config-if)#exESW2(config)#interface vlan 10ESW2(config-if)#ip helper-address 192.168.200.2ESW2(config)#interface vlan 20ESW2(config-if)#ip helper-address 192.168.200.2ESW2(config)#interface vlan 30ESW2(config-if)#ip helper-address 192.168.200.2ESW2(config)#interface vlan 40ESW2(config-if)#ip helper-address 192.168.200.2R1的基本配置R1#configureR1(config)#interface ethernet 0/1R1(config-if)#ip address 192.168.100.2 255.255.255.0 R1(config-if)#no shutdownR1(config-if)#interface ethernet 0/0R1(config-if)#ip address 192.168.200.2 255.255.255.0R1(config-if)#no shutdownR1(config-if)#exitR1(config)#service dhcpR1(config)#ip dhcp pool vlan10R1(dhcp-config)# network 192.168.10.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.10.1R1(dhcp-config)#dns-server 3.3.3.3R1(dhcp-config)#exitR1(config)#ip dhcp pool vlan20R1(dhcp-config)# network 192.168.20.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.20.1R1(dhcp-config)#dns-server 3.3.3.3R1(dhcp-config)#exitR1(config)#ip dhcp pool vlan30R1(dhcp-config)# network 192.168.30.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.30.1R1(dhcp-config)#dns-server 3.3.3.3R1(dhcp-config)#exitR1(config)#ip dhcp pool vlan40R1(dhcp-config)# network 192.168.40.0 255.255.255.0 R1(dhcp-config)#default-router 192.168.40.1R1(dhcp-config)#dns-server 3.3.3.3R1(dhcp-config)#exitR1(config)#ip route 192.168.10.0 255.255.255.0 192.168.100.1 R1(config)#ip route 192.168.10.0 255.255.255.0 192.168.200.1 R1(config)#ip route 192.168.20.0 255.255.255.0 192.168.100.1 R1(config)#ip route 192.168.20.0 255.255.255.0 192.168.200.1 R1(config)#ip route 192.168.30.0 255.255.255.0 192.168.100.1 R1(config)#ip route 192.168.30.0 255.255.255.0 192.168.200.1 R1(config)#ip route 192.168.40.0 255.255.255.0 192.168.100.1 R1(config)#ip route 192.168.40.0 255.255.255.0 192.168.200.1测试结果PC1 DHCP show ipPC1> dhcpDORA IP 192.168.10.2/24 GW 192.168.10.1PC1> show ipNAME : PC1[1]IP/MASK : 192.168.10.2/24GATEWAY : 192.168.10.1DNS : 3.3.3.3DHCP SERVER : 192.168.100.2DHCP LEASE : 86397, 86400/43200/75600MAC : 00:50:79:66:68:00LPORT : 10000RHOST:PORT : 127.0.0.1:10001MTU: : 1500PC2 DHCP show ipPC2> dhcpDORA IP 192.168.20.2/24 GW 192.168.20.1 PC2> show ipNAME : PC2[1]IP/MASK : 192.168.20.2/24 GATEWAY : 192.168.20.1DNS : 3.3.3.3DHCP SERVER : 192.168.100.2DHCP LEASE : 86394, 86400/43200/75600 MAC : 00:50:79:66:68:01LPORT : 10004RHOST:PORT : 127.0.0.1:10005MTU: : 1500PC3 DHCP show ipPC3> dhcpDORA IP 192.168.30.2/24 GW 192.168.30.1PC3> show ipNAME : PC3[1]IP/MASK : 192.168.30.2/24 GATEWAY : 192.168.30.1DNS : 3.3.3.3DHCP SERVER : 192.168.100.2DHCP LEASE : 86393, 86400/43200/75600 MAC : 00:50:79:66:68:02LPORT : 10002RHOST:PORT : 127.0.0.1:10003MTU: : 1500PC4 DHCP show ipPC4> dhcpDORA IP 192.168.40.2/24 GW 192.168.40.1 PC4> show ipNAME : PC4[1]IP/MASK : 192.168.40.2/24 GATEWAY : 192.168.40.1DNS : 3.3.3.3DHCP SERVER : 192.168.100.2DHCP LEASE : 86394, 86400/43200/75600MAC : 00:50:79:66:68:03LPORT : 10006RHOST:PORT : 127.0.0.1:10007MTU: : 1500PC1pingPC4PC1> ping 192.168.40.2 -t84 bytes from 192.168.40.2 icmp_seq=1 ttl=63 time=37.786 ms 84 bytes from 192.168.40.2 icmp_seq=2 ttl=63 time=31.251 ms 84 bytes from 192.168.40.2 icmp_seq=3 ttl=63 time=37.749 ms 84 bytes from 192.168.40.2 icmp_seq=4 ttl=63 time=15.626 ms 84 bytes from 192.168.40.2 icmp_seq=5 ttl=63 time=31.264 ms当f1/0接口关闭之后192.168.40.2 icmp_seq=6 timeout192.168.40.2 icmp_seq=7 timeout84 bytes from 192.168.40.2 icmp_seq=8 ttl=63 time=31.251 ms 84 bytes from 192.168.40.2 icmp_seq=9 ttl=63 time=37.282 ms 84 bytes from 192.168.40.2 icmp_seq=10 ttl=63 time=84.531 ms 84 bytes from 192.168.40.2 icmp_seq=11 ttl=63 time=31.253 ms84 bytes from 192.168.40.2 icmp_seq=12 ttl=63 time=31.250 ms 84 bytes from 192.168.40.2 icmp_seq=13 ttl=63 time=122.337 ms 84 bytes from 192.168.40.2 icmp_seq=14 ttl=63 time=31.248 ms五调试信息ESW1 show running-configESW1#show running-configBuilding configuration...Current configuration : 2971 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname ESW1!boot-start-markerboot-end-marker!!no aaa new-modelresource policy!memory-size iomem 5ip subnet-zerono ip icmp rate-limit unreachable ip tcp synwait-time 5!!ip cefno ip domain lookupno ip dhcp use vrf connected!!!!!!!!!!!!!!!vtp file nvram:vlan.dat!!no crypto isakmp ccm!!!!interface FastEthernet1/0 switchport mode trunkduplex fullspeed 100!interface FastEthernet1/1 switchport mode trunkduplex fullspeed 100interface FastEthernet1/2no switchportip address 192.168.100.1 255.255.255.0 duplex fullspeed 100!interface FastEthernet1/3duplex fullspeed 100!interface FastEthernet1/4duplex fullspeed 100!interface FastEthernet1/5duplex fullspeed 100!interface FastEthernet1/6duplex fullspeed 100!interface FastEthernet1/7 duplex fullspeed 100!interface FastEthernet1/8 duplex fullspeed 100!interface FastEthernet1/9 duplex fullspeed 100!interface FastEthernet1/10 duplex fullspeed 100!interface FastEthernet1/11 duplex fullspeed 100!interface FastEthernet1/12 duplex fullspeed 100interface FastEthernet1/13duplex fullspeed 100!interface FastEthernet1/14duplex fullspeed 100!interface FastEthernet1/15duplex fullspeed 100!interface Vlan1no ip addressshutdown!interface Vlan10ip address 192.168.10.1 255.255.255.0 ip helper-address 192.168.100.2standby 10 ip 192.168.10.254standby 10 priority 200standby 10 preemptinterface Vlan20ip address 192.168.20.1 255.255.255.0 ip helper-address 192.168.100.2standby 20 ip 192.168.20.254standby 20 priority 200standby 20 preempt!interface Vlan30ip address 192.168.30.1 255.255.255.0 ip helper-address 192.168.100.2standby 30 ip 192.168.30.254standby 30 priority 150standby 30 preempt!interface Vlan40ip address 192.168.40.1 255.255.255.0 ip helper-address 192.168.100.2standby preemptstandby 40 ip 192.168.40.254standby 40 priority 150!no ip http serverno ip http secure-serverip classless!!!no cdp log mismatch duplex!!!control-plane!!!!!!!!!banner exec ^C************************************************************* **This is a normal Router with a SW module inside (NM-16ESW)It has been preconfigured with hard coded speed and duplexTo create vlans use the command "vlan database" from exec mode After creating all desired vlans use "exit" to apply the configTo view existing vlans use the command "show vlan-switch brief"Warning: You are using an old IOS image for this router. Please update the IOS to enable the "macro" command!************************************************************* **^C!line con 0exec-timeout 0 0privilege level 15logging synchronousline aux 0exec-timeout 0 0privilege level 15logging synchronousline vty 0 4login!!endESW2 show running-configESW2#show running-configBuilding configuration...Current configuration : 3130 bytes!version 12.3service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption!hostname ESW2!boot-start-markerboot-end-marker!!no aaa new-modelresource policy!memory-size iomem 5ip subnet-zerono ip icmp rate-limit unreachable ip tcp synwait-time 5!!ip cefno ip domain lookupno ip dhcp use vrf connected!!!!!!!!!!!!!!!vtp file nvram:vlan.dat!!no crypto isakmp ccm!!!!interface FastEthernet1/0 switchport mode trunkduplex fullspeed 100!interface FastEthernet1/1 switchport mode trunkduplex fullspeed 100interface FastEthernet1/2no switchportip address 192.168.200.1 255.255.255.0 duplex fullspeed 100!interface FastEthernet1/3duplex fullspeed 100!interface FastEthernet1/4duplex fullspeed 100!interface FastEthernet1/5duplex fullspeed 100!interface FastEthernet1/6duplex fullspeed 100!interface FastEthernet1/7 duplex fullspeed 100!interface FastEthernet1/8 duplex fullspeed 100!interface FastEthernet1/9 duplex fullspeed 100!interface FastEthernet1/10 duplex fullspeed 100!interface FastEthernet1/11 duplex fullspeed 100!interface FastEthernet1/12 duplex fullspeed 100interface FastEthernet1/13duplex fullspeed 100!interface FastEthernet1/14duplex fullspeed 100!interface FastEthernet1/15duplex fullspeed 100!interface Vlan1no ip addressshutdown!interface Vlan10ip address 192.168.10.254 255.255.255.0 ip helper-address 192.168.200.2standby 10 ip 192.168.10.254standby 10 priority 150standby 10 preemptinterface Vlan20ip address 192.168.20.254 255.255.255.0 ip helper-address 192.168.200.2standby 20 ip 192.168.20.254standby 20 priority 150standby 20 preempt!interface Vlan30ip address 192.168.30.254 255.255.255.0 ip helper-address 192.168.200.2standby 30 ip 192.168.30.254standby 30 priority 200standby 30 preempt!interface Vlan40ip address 192.168.40.254 255.255.255.0 ip helper-address 192.168.200.2standby 40 ip 192.168.40.254standby 40 priority 200standby 40 preempt!no ip http serverno ip http secure-serverip classless!!!mac-address-table static 0000.0c07.ac1e interface FastEthernet1/1 vlan 30mac-address-table static 0000.0c07.ac28 interface FastEthernet1/1 vlan 40no cdp log mismatch duplex!!!control-plane!!!!!!!!!banner exec ^C************************************************************* **This is a normal Router with a SW module inside (NM-16ESW)It has been preconfigured with hard coded speed and duplexTo create vlans use the command "vlan database" from exec modeAfter creating all desired vlans use "exit" to apply the config To view existing vlans use the command "show vlan-switch brief"Warning: You are using an old IOS image for this router. Please update the IOS to enable the "macro" command!************************************************************* **^C!line con 0exec-timeout 0 0privilege level 15logging synchronousline aux 0exec-timeout 0 0privilege level 15logging synchronousline vty 0 4login!!endESW3 show running-configESW3#show running-configBuilding configuration...Current configuration : 2415 bytes!version 12.3service timestamps debug datetime msec service timestamps log datetime msec no service password-encryptionno service dhcp!hostname ESW3!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!memory-size iomem 5ip subnet-zerono ip routingno ip icmp rate-limit unreachable ip tcp synwait-time 5!!no ip cefno ip domain lookupno ip dhcp use vrf connected!!!!!!!!!!!!!!!vtp file nvram:vlan.dat!!no crypto isakmp ccm!!!!interface FastEthernet1/0 switchport access vlan 10 duplex fullspeed 100interface FastEthernet1/1 switchport access vlan 20 duplex fullspeed 100!interface FastEthernet1/2 switchport access vlan 30 duplex fullspeed 100!interface FastEthernet1/3 switchport access vlan 40 duplex fullspeed 100!interface FastEthernet1/4 switchport mode trunkduplex fullspeed 100!interface FastEthernet1/5 switchport mode trunkduplex fullspeed 100!interface FastEthernet1/6 duplex fullspeed 100!interface FastEthernet1/7 duplex fullspeed 100!interface FastEthernet1/8 duplex fullspeed 100!interface FastEthernet1/9 duplex fullspeed 100!interface FastEthernet1/10 duplex fullspeed 100!interface FastEthernet1/11 duplex fullspeed 100!interface FastEthernet1/12 duplex fullspeed 100!interface FastEthernet1/13 duplex fullspeed 100!interface FastEthernet1/14 duplex fullspeed 100!interface FastEthernet1/15 duplex fullspeed 100!interface Vlan1no ip addressno ip route-cacheshutdown!no ip http serverno ip http secure-server ip classless!!!no cdp log mismatch duplex !!!control-plane!!!!!!!!!banner exec ^C************************************************************* **This is a normal Router with a SW module inside (NM-16ESW)It has been preconfigured with hard coded speed and duplexTo create vlans use the command "vlan database" from exec modeAfter creating all desired vlans use "exit" to apply the config To view existing vlans use the command "show vlan-switch brief"Warning: You are using an old IOS image for this router. Please update the IOS to enable the "macro" command!************************************************************* **^C!line con 0exec-timeout 0 0privilege level 15logging synchronousline aux 0exec-timeout 0 0privilege level 15logging synchronousline vty 0 4login!!endR1 show running-configR1#show running-configBuilding configuration...Current configuration : 2114 bytes!version 12.3service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption!hostname R1!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!memory-size iomem 5ip subnet-zerono ip icmp rate-limit unreachableip tcp synwait-time 5!!ip cefno ip domain lookupno ip dhcp use vrf connected!ip dhcp pool vlan10network 192.168.10.0 255.255.255.0 default-router 192.168.10.1dns-server 3.3.3.3!ip dhcp pool vlan20network 192.168.20.0 255.255.255.0 default-router 192.168.20.1dns-server 3.3.3.3!ip dhcp pool vlan30network 192.168.30.0 255.255.255.0 default-router 192.168.30.1dns-server 3.3.3.3!ip dhcp pool vlan40network 192.168.40.0 255.255.255.0 default-router 192.168.40.1dns-server 3.3.3.3!!!!!!!!!!!!!!!!!no crypto isakmp ccm!!!!interface Ethernet0/0ip address 192.168.200.2 255.255.255.0 half-duplex!interface Ethernet0/1ip address 192.168.100.2 255.255.255.0 half-duplex!interface Ethernet0/2no ip addressshutdownhalf-duplexinterface Ethernet0/3 no ip addressshutdownhalf-duplex!interface Ethernet1/0 no ip addressshutdownhalf-duplex!interface Ethernet1/1 no ip addressshutdownhalf-duplex!interface Ethernet1/2 no ip addressshutdownhalf-duplex!interface Ethernet1/3 no ip addressshutdownhalf-duplex!no ip http serverno ip http secure-serverip classlessip route 192.168.10.0 255.255.255.0 192.168.100.1 ip route 192.168.10.0 255.255.255.0 192.168.200.1 ip route 192.168.20.0 255.255.255.0 192.168.100.1 ip route 192.168.20.0 255.255.255.0 192.168.200.1 ip route 192.168.30.0 255.255.255.0 192.168.100.1 ip route 192.168.30.0 255.255.255.0 192.168.200.1 ip route 192.168.40.0 255.255.255.0 192.168.100.1 ip route 192.168.40.0 255.255.255.0 192.168.200.1 !!!no cdp log mismatch duplex!!!control-plane!!!!!!!!!!line con 0exec-timeout 0 0privilege level 15 logging synchronous line aux 0exec-timeout 0 0privilege level 15 logging synchronous line vty 0 4login!!end六实验结论通过这系列实验,熟悉了HSRP的协议,加深了理解。
HSRP实验过程及报告

目录HSRP实验过程及报告 (2)实验环境: (2)实验拓扑: (2)实验目的: (2)实验过程: (3)1 配置交换机 (3)2 测试HSRP (5)3测试HSRP跟踪 (8)实验总结: (10)HSRP实验过程及报告实验环境:DynamipsGUI模拟器模拟出4台cisco3640三层交换机。
两台开启HSRP协议,设备之间使用Ethernetchannel绑定的两条线路互联。
其余两台交换机分别连接到这两台交换机。
实验拓扑:实验拓扑如图1实验目的:熟悉HSRP协议,验证HSRP网关冗余特性,测试HSRP抢占过程及HSRP接口跟踪。
实验过程:1 配置交换机在交换机SW1配置F0/0.F0/1接口加入channel-group 1 并将port-channel 1 配置为trunk模式。
SW1(config)#int range f0/0 - 1SW1(config-if-range)#channel-group 1 mode onCreating a port-channel interface Port-channel1SW1(config-if-range)#*Mar 1 01:23:58.639: %EC-5-BUNDLE: Interface Fa0/0 joined port-channel Po1 *Mar 1 01:23:58.935: %EC-5-BUNDLE: Interface Fa0/1 joined port-channel Po1 SW1(config-if-range)#*Mar 1 01:24:01.415: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to upSW1(config-if-range)#exitSW1(config)#int port-channel 1SW1(config-if)#switchport mode trunkSW1(config-if)#endSW1#sh etherchannel suFlags: D - down P - in port-channelI - stand-alone s - suspendedR - Layer3 S - Layer2U - in useGroup Port-channel Ports-----+------------+-----------------------------------------------------------1 Po1(SU) Fa0/0(P) Fa0/1(P)在交换机SW2上同样的配置。
HSRP热备份

HSRP热备份【实验名称】:HSRP (Hot Standby Routing Protocol)热备份路由协议【实验拓扑】:【实验原理】:HSRP 是Hot Standby Routing Protocol(热备份路由协议)的缩写。
它的作用是能够把一台或多台路由器用来做备份,所谓热备份是指当使用的路由器不能正常工作时,候补的路由器能够实现平滑的替换,尽量不被察觉。
HSRP概念:热备份路由协议 (Hot Standby Routing Protocol)当主机使用缺省网关实现容错备份功能适用于支持多播或广播的局域网如 Ethernet, Toking Ring, FDDI等HSRP 用于广播或多播局域网上的路由器热备份,并适于静态的路由配置,实际上HSRP 正是解决设备不能动态适应路由改变的问题。
【实验步骤】:1.按拓扑图将网络搭建好,配置好三个路由的信息,在三个路由器上启用rip协议。
2.将客户机A(网关:192.168.6.1、192.168.7.1)与路由桥接,并检测是否联通。
3.使用HSRP 协议,开始R6与R7路由HSRP 协议的配置@:其中R7的优先级比R6的优先级高4.断开R7的fa2/0接口,这时R6的优先级高,用客户机B在去ping 192.168.56.1 追踪经过的路由,查看数据包走的是那条断开R7的fa2/0接口,这时R6的优先级高,用客户机B在去ping 192.168.56.1 追踪经过的路由,查看数据包走的是那条1.按拓扑图将网络搭建好,配置好三个路由的信息,在三个路由器上启用rip协议。
R5配置信息:Router>enableRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R5R5(config)#int s1/1R5(config-if)#ip add 192.168.56.1 255.255.255.0R5(config-if)#no shutR5(config-if)#exitR5(config)#int s1/2R5(config-if)#ip add 192.168.57.1 255.255.255.0R5(config-if)#no shutR5(config-if)#exitR5(config)#int lo5R5(config-if)#ip add 192.168.5.1 255.255.255.0R5(config-if)#no shutR5(config-if)#exitR5(config)#router ripR5(config-router)#net 192.168.56.0R5(config-router)#net 192.168.57.0R5(config-router)#net 192.168.5.0R5(config-router)#exitR5(config)#R6 配置信息:Router>enableRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R6R6(config)#int s1/0R6(config-if)#ip add 192.168.56.2 255.255.255.0R6(config-if)#no shutR6(config-if)#exitR6(config)#int fa2/0R6(config-if)#ip add 192.168.6.1 255.255.255.0R6(config-if)#no shutR6(config-if)#exitR6(config)#router ripR6(config-router)#net 192.168.56.0R6(config-router)#net 192.168.6.0R6(config-router)#endR6#R7配置信息:R7(config)#int s1/4R7(config-if)#ip add 192.168.57.2 255.255.255.0R7(config-if)#no shutR7(config-if)#int fa2/0R7(config-if)#ip add 192.168.6.100 255.255.255.0R7(config-if)#no shutR7(config-if)#exitR7(config)#router ripR7(config-router)#net 192.168.57.0R7(config-router)#net 192.168.6.0R7(config-router)#endR7#2.将客户机A(网关:192.168.6.1、)与路由桥接,并检测是否联通。
HSRP基本实验及其测试

HSRP基本实验及其测试实验拓扑如下:(1)R1的基本配置SW1(config)#interface range f0/0 – 1SW1(config-if-range)#channel-group 1 mode onSW1(config)#interface port-channel 1SW1(config-if)#switchport mode trunk*****************************************************************R1中HSRP的配置****************************************************************** SW1(config-if)#standby 1 ip 192.168.1.254SW1(config-if)#standby 1 priority 120SW1(config-if)#standby preempt(2)R2的基本配置SW1(config)#interface range f0/0 – 1SW1(config-if-range)#channel-group 1 mode onSW1(config)#interface port-channel 1SW1(config-if)#switchport mode trunk*****************************************************************R2中HSRP的配置****************************************************************** SW2(config-if)#standby 1 ip 192.168.1.254SW2(config-if)#standby preempt注意,在SW2中没有指定priority,所以HSRP默认使用100(3)测试HSRP Active router和standby router之间的切换R1上show standby vlan 1显示结果如下:SW1#show standby vlan 1Vlan1 - Group 1State is Active2 state changes, last state change 00:07:18Virtual IP address is 192.168.1.254Active virtual MAC address is 0000.0c07.ac01Local virtual MAC address is 0000.0c07.ac01 (v1 default)Hello time 3 sec, hold time 10 secNext hello sent in 2.752 secsPreemption enabledActive router is localStandby router is 192.168.1.2, priority 100 (expires in 8.916 sec)Priority 120 (configured 120)IP redundancy name is "hsrp-Vl1-1" (default)SW2#show standby vlan 1Vlan1 - Group 1State is Standby1 state change, last state change 00:08:34Virtual IP address is 192.168.1.254Active virtual MAC address is 0000.0c07.ac01Local virtual MAC address is 0000.0c07.ac01 (v1 default)Hello time 3 sec, hold time 10 secNext hello sent in 1.396 secsPreemption enabledActive router is 192.168.1.1, priority 120 (expires in 9.372 sec)Standby router is localPriority 100 (default 100)IP redundancy name is "hsrp-Vl1-1" (default)******************************************************************************* 将SW1和SW3之间的链路中断,观察active router 和standby router的转换******************************************************************************* SW1(config)#interface vlan 1SW1(config-if)#shutdown*Mar 1 00:36:19.947: %HSRP-5-STATECHANGE: Vlan1 Grp 1 state Active -> Init Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.1.4, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 24/58/84 ms这个结果说明,当avtive router SW1出现故障时,standby router SW2开始运行,而用户的服务不会中断;因为这个时候已经配置了抢占,所以SW2这个时候成了avtive router*Mar 1 00:36:19.747: %HSRP-5-STATECHANGE: Vlan1 Grp 1 state Standby -> Active@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ SW1(config)#interface vlan 1SW1(config-if)#no shutdown*Mar 1 00:40:14.063: %HSRP-5-STATECHANGE: Vlan1 Grp 1 state Listen -> Active可见,当SW1的故障恢复的时候,它又称为了avtive router,因为配置的时候配置了抢占。
HSRP实验指导书

HSRP实验实验6-1HSRP实验学习目标•了解网关冗余技术。
•配置HSRP实现对业务网关的冗余原理HSRP 是Cisco 的专有协议。
HSRP(Hot Standby Router Protocol)把多台路由器组成一个“热备份组”,形成一个虚拟路由器。
这个组内只有一个路由器是活动的(Active),并由它来转发数据包,如果活动路由器发生了故障,备份路由器将成为活动路由器。
从网络内的主机来看,网关并没有改变。
HSRP 路由器利用HELLO 包来互相监听各自的存在。
当路由器长时间没有接收到HELLO包,就认为活动路由器故障,备份路由器就会成为活动路由器。
HSRP 协议利用优先级决定哪个路由器成为活动路由器。
如果一个路由器的优先级比其它路由器的优先级高,则该路由器成为活动路由器。
路由器的缺省优先级是100。
一个组中,最多有一个活动路由器和一个备份路由器。
拓扑图图1拓扑操作步骤步骤一配置汇聚交换机HSRP1、将《VLAN间路由实验》中保存的拓扑打开,要求服务器区设备访问网络主走SW1,图书馆区设备访问网络主走SW2,交换机管理网段主走SW1。
步骤二配置服务器区域VLAN101 HSRP。
1、VLAN101 standby 10.X.0.13、在SW1上关闭F0/1接口验证HSRP切换过程4、在SW1上开启F0/1接口验证HSRP回切过程步骤三配置图书馆区域VLAN103 HSRP 1、VLAN103 standby 10.X.2.12、查看HSRP状态步骤四配置管理VLAN2 HSRP 1、VLAN2 standby 10.X.129.254步骤五设置二层交换机缺省网关及PC机IP参数1、设置SW3-SW6缺省网关(由于模拟器只支持HSRP配置,不支持具体功能,所以接入交换机网关配置为10.0.129.1,本应为standby IP)2、设置PC1 和PC3的IP地址等参数(由于模拟器只支持HSRP配置,不支持具体功能,所以PC1网关配置为10.0.0.251,所以PC3网关配置为10.0.2.252,本应为standby IP)步骤六保存配置1、全网设备保存配置,防止掉电配置丢失。
HSRP实验详解及案例

热备份路由协议(HSRP)一、HSRP的相关概念HSRP(hot standby router protocol)是思科私有的一种协议,二、HSRP的配置1、配置为HSRP的成员switch(config-if)#standby group-number ip irtual-ip-addressgroup-number:默认组是0号,范围0~255irtual-ip-address:虚拟HSRP路由器的ip地址,即网段的网关地址。
例如:switch(config-if)#(no)standby 10 ip 192.168.1.2542、配置HSRP的优先级switch(config-if)#standby group-number priority priority-valuepriority-value:范围是0~255,默认值是100.例如:switch(config-if)#(no)standby 10 priority 2003、配置HSRP的占先权switch(config-if)#standby group-number preempt4、配置Hello消息的计时器switch(config-if)#standby group-number times hellotime holdtimehellotime:默认时间是3s,设置范围是1~255,holdtime:保持时间是hello时间的3倍,默认是10s。
例如:switch(config-if)#standby 10 times 2 85、配置HSRP的端口跟踪switch(config-if)#standby group-number track i nterface-type mod/num interface-priority interface-priority:当端口失效时,路由器的热备份优先级将降低的数值,默认为10.例如:switch(config-if)#standby 10 track fastEthernet 0/1 1006、查看HSRP状态switch#show standby [interface-type mod/num] [group-number] briefinterface-type mod/num:要显示的端口类型和序号。
HSRP VRRP GLBP网关冗余和负载均衡实验

HSRP VRRP GLBP网关冗余和负载均衡实验为了保障网络的稳定性,减少因网络设备故障而导致网络瘫痪,在OSI/RM的二层,交换机厂商开发出了STP以及PVST等技术,实现交换机的冗余备份和负载均衡。
那在第三层呢,是否有相应的技术解决路由器的冗余备份和负载均衡呢?当然有,那就有HSRP(思科私有协议)和VRRP(IEEE标准)。
不过HSRP和VRRP正常情况下,只有冗余备份的功能,而要实现负载均衡的功能,只有创建多个备份组,两个或多个虚拟网关,让局域内的PC机配置不同的网关,从而实现负载均衡的功能,这样在操作上就显得比较麻烦。
为了解决这个问题,思科公司进一步开发出了GLBP技术(Gateway Load Balance Protocol),GLBP由多个路由器组成一个备份组,将每台路由器的MAC地址(最多四个)加入备份组,成为虚拟网关的MAC地址组。
当局域网内的PC机请求网关ARP响应时,虚拟网关的MAC地址组中MAC地址轮流响应,从而实现流量根据二层的网关MAC地址走不同的真实路由器,从而实现负载均衡。
实验拓扑图实验一:通过HSRP实现路由器的冗余备份和负载均衡路由器R1上的配置在路由器R1配置备份组standby 1 虚拟网关IP为192.168.1.254,优先级为120,高于默认的优先级100,从而R1在备份组1中成为ACTIVE路由器,并配置占先权和端口跟踪,当E0/0故障时,standby 1 priority优先级自动降低30.备份组2 standby 2虚拟网关IP为192.168.1.253,优先级使用默认的100(默认优先级100系统不显示),也需要配置占先权,使用能够在备份组2的ACTIVE路由器R2故障时,启用占先权功能,由standby成为ACTIVE,保障网络的运行稳定。
在ISIS路由协议中,配置E0/1接口为被动接口模式,以防止通过E0/1向R2传播路由信息,形成环路。
实验40、HSRP的配置

实验四十、HSRP的配置一、实验目的1.掌握热备份路由协议的配置2.理解热备份路由协议的原理二、应用环境在企业网内部实现网关的冗余,提高可靠性三、实验设备1.DCR-1751 两台2.PC机一台四、实验拓扑五、实验要求ROUTER-A ROUTER-B192.168.10.2/24 F0/0192.168.10.3/24F0/0优先级200 100Standby IP 192.168.10.1/24PC机IP:192.168.10.4/24 网关:192.168.10.1目的:正常情况下A为活跃路由器,当A坏掉,B成为活跃路由器,从PC机PING网关没有变化六、实验步骤第一步:配置接口地址,并测试连通性第二步:配置HSRP路由器A的配置:Router-A_config#int f0/0Router-A_config_f0/0#ip address 192.168.10.2 255.255.255.0 Router-A_config_f0/0#standby priority 200 !配置优先级Router-A_config_f0/0#standby ip 192.168.10.1 !配置虚拟地址Router-A_config_f0/0#stand authentication router !配置认证密码路由器B的配置Router-B_config#int f0/0Router-B_config_f0/0#ip address 192.168.10.3 255.255.255.0Router-B_config_f0/0#standby priority 100Router-B_config_f0/0#standby ip 192.168.10.1Router-B_config_f0/0#stand authentication routerRouter-B_config_f0/0#^Z第三步:配置PC机IP地址和网关,并测试网关第四步:验证Router-A#sh standbyFastEthernet0/0 - Group 0HSRP State is ActiveVirtual IP address : 192.168.10.1/24 (config)Virtual Mac address : 0000.0c07.ac00Active Router IP : 192.168.10.2Standby Router IP : 192.168.10.3Preempt is not setCurrent Priority is 200Config Priority is 200HSRP timer : hello 3 s(default) hold 10s (default) HSRP current timer : hello 2 active 0 standby 9 Authentication string is routerRouter-B#sh standbyFastEthernet0/0 - Group 0HSRP State is StandbyVirtual IP address : 192.168.10.1/24 (config)Virtual Mac address : 0000.0c07.ac00Active Router IP : 192.168.10.2Standby Router IP : 192.168.10.3Preempt is not setCurrent Priority is 100Config Priority is 100HSRP timer : hello 3 s(default) hold 10s (default) HSRP current timer : hello 3 active 9 standby 0 Authentication string is router第五步:关闭路由器A,从PC机PING 网关七、注意事项和排错1.Standby IP 要设置一致2.认证密码要相同3.PC机的网关是Standby IP,也就是虚拟地址八、配置序列Router-B#sh runBuilding configuration...Current configuration:!!version 1.3.2Eservice timestamps log dateservice timestamps debug dateno service password-encryption!hostname Router-B!ip host a 192.168.1.1ip host c 192.168.2.2!!interface FastEthernet0/0ip address 192.168.10.3 255.255.255.0no ip directed-broadcaststandby ip 192.168.10.1!interface Serial1/0ip address 192.168.1.2 255.255.255.0no ip directed-broadcast!interface Async0/0no ip addressno ip directed-broadcast!!九、共同思考1.HSRP的作用是什么?2.虚拟地址与真实地址有什么关系?3.有哪些定时器?十、课后练习请将地址改为10.0.0.0/24重复以上实验十一、相关命令详解standby priority, standby preempt为了配置HSRP为了恢复其缺省值,使用no格式命令。
热待机路由协议

热待机路由协议(HSRP)实验【实验目的】熟悉和掌握HSRP基本配置, 观察HSRP状态信息, 在此基础上理解HSRP的用途。
【实验原理】1.背景有时,为了获得可靠性在某一子网内可能会通过两个以上的路由器与外界网络相连,这时作为子网内的主机来说,可以选择不同的网关(路由器)作为出口。
在Windows系统中,允许主机配置多个缺省网关,以供机器按顺序选择。
主机启动后通过ARP协议获得某一网关的MAC地址,然后以其作为缺省网关。
但是,若在某些情况下该路由器失效,主机并没有能力知道这情况,更不会自动地去选择另一个网关作为自己的缺省网关,直到我们人为的运行ARP请求或者主机重新启动。
正是由于这种原因,造成了在本来有其它出口的情况下,主机却在一段时间内找不到适当的出口的问题。
基于这个问题,我们希望能通过某种策略,使得子网内的主机只需要通过某一特定的网关(一个虚拟的路由器)出去,而把担当该虚拟路由器的磋商工作交给路由器之间去完成。
这时对于主机来说,网关始终是固定的,从而简化了用户端的配置。
HSRP正是基于这样的思想而设计出来的一种解决上述问题的方法。
2.HSRP概述热待机路由协议的目的就是希望能在网络内提供趋于100%的数据转发能力,尽量保证在路由器出现故障的情况下,继续发往该路由器的数据包不会丢失,能够自动由其它路由器发送出去。
这是通过一个虚拟的路由器来实现的。
子网内的主机以该虚拟路由器作为缺省网关并向其发送数据,而各个启动了HSRP的路由器通过竞争来担当该虚拟路由器的角色并负责这些数据的转发。
负责转发发向虚拟路由器的数据包的那台路由器为Active状态,其它一个或多个路由器作为Standby状态。
当Active路由器失效时,Standby路由器通过与Active路由器的信息交互和计时器来自动取缔原来的路由器,将自身变为Active,继续负责发往虚拟路由器的数据转发工作。
然而,对用户来说,这种网络的变化是透明的,亦即可以达到一种。
实验四:HSRP

实验四:HSRP一:实验目标(1)组网需求:企业总部局域网采用两台核心交换机,为防止二层环路,需全网运行STP:将SW1部署为根网桥,SW2部署为备份根网桥,并将接入PC的接口配置为portfast端口;同时部署HSRP为内部vlan提供网关冗余。
本局域网有4个vlan,生产业务vlan10,办公业务vlan11,服务器vlan12,二层交换机网管vlan8,将SW1部署为vlan8/10/12主网关,将sw2部署为vlan11的主网关,要求vlan10、11的主网关跟踪上行链路。
(2)测试HSRP主备网关倒换。
(3)分析pc1 ping pc2的三层通信过程和二层通信过程。
二:拓扑图三:预期结果当vlan10或vlan11的上行链路shutdown时,HSRP组的主备网关会倒换。
四:调试二层接口配置:SW3:show ip int bri:三层接口配置: SW1:show ip int bri:SW2:show ip int bri:STP配置:SW1:SW2:SW3:HSRP配置:SW1中:VLAN8:VLAN 10:VLAN 11:VLAN 12:SW2中:Vlan8:Vlan10:Vlan11:Vlan12:Sw1中vlan10的上行链路跟踪:Sw2中vlan11的上行链路跟踪:五:测试SW1中Show ip int bri:SW2中Show ip int bri:未将sw1的上行链路showdown时:Sw1中:Show standby bri:Sw2中:Show standby bri:将sw1上行链路接口fa0/12 shutdown后:Sw1中:Show standby bri:Sw2中:Show standby bri:重新将SW1中的fa0/12口打开:Pc1 ping pc2:六:总结与原理分析PC1 ping PC2的数据流分析:PC1—SW3—SW1—SW3—PC2PC2—SW3—SW1—SW2—SW1—SW3—PC1①Pc1封装icmp包,发现未知目的MAC地址且目的IP与自己不在同一个网段,则封装一个ARP请求,请求的目的IP为网关IP,目的MAC为全F;②在通过fa0/10口时,arp请求被打上了vlan10 的标签;③进入sw3,sw3查询mac地址表,发现没有pc1 的mac地址,便更新mac表;④由于配置了生成树协议,相对于vlan10,sw3的fa0/2口是阻塞的,所以arp请求被交换机从fa0/1口发送到三层交换机sw1;⑤Sw1收到arp请求后,发现目的ip是自身的,然后拆vlan10标,更新mac地址表,便封装一个arp应答,封装时打上vlan10的标,从fa0/3口单播出去;⑥Sw3收到arp应答,查询mac地址表后,从fa0/10转发出去,在出口拆掉vlan10的标签;⑦Pc1收到arp应答,更新自身的arp缓存表,重新封装icmp包,其目的mac是网关,目的IP是pc2的IP地址,将封装好的icmp包,通过fa0/10口送往SW3;⑧Icmp包在fa0/10口被打上vlan10的标签;⑨Icmp包进入sw3,sw3查询mac地址表,把icmp包从fa0/1口转发出去;⑩SW1收到icmp包,拆vlan10标,发现目的IP地址不是自己的,但是网关却是已知的vlan11,且不知道目的mac地址,便封装一个arp请求,并打上vlan11的标签,洪泛出去;⑪由于配置了生成树协议,所以SW3的Fa0/2口相对于vlan11是阻塞的,所以ARP请求从fa0/3口发送到SW3;⑫SW3收到了arp请求后将其洪泛,arp请求从fa0/11口出去,在通过fa0/11口时被拆掉vlan11的标签;⑬Pc2收到arp请求,更新自己的arp缓存表后,封装一个arp应答;⑭Arp应答从fa0/11口进入SW3时被打vlan11的标签;⑮SW3收到arp应答后,更新mac地址表,然后从fa0/1口转发给SW1;⑯SW1收到arp应答后,拆除arp应答的vlan11的标签,更新mac地址表,重新封装icmp包,将ICMP转发给SW3;⑰SW3收到ICMP包后,将ICMP包转发给PC2,在通过sw3的fa0/11口时,icmp包的vlan11标签被拆除;⑱Pc2收到icmp包后,发现目的IP地址,mac地址均为自己的后,封装一个icmp回应包,通过SW3的fa0/11口时被打上vlan11的标签,之后进入SW3;⑲Icmp回应包进入SW3后被SW3通过fa0/1口转发到SW1;⑳由于配置了HSRP,且SW1是vlan11的备份路由,所以SW1需通过查路由表,将icmp回应包转发给SW2;21SW2收到icmp回应包后,拆掉vlan11的标签,更新mac地址表和路由表,发现icmp包的目的IP是自己网段内的IP地址,重新封装一个icmp回应包,并打上vlan10的标签,SW2的端口Fa0/3连接的SW3的Fa0/2相对于vlan10是阻塞的,所以打了vlan10标签的数据流将被发送到SW1;22SW1收到icmp回应包后,更新自己的mac地址表和路由表,并查询mac地址表后,将其转发到SW3;23SW3收到icmp回应包后,查询mac地址表,将其通过fa0/10口转发,icmp 包在通过fa0/10口时,被拆除vlan10的标签;24Pc1收到icmp回应包。
HSRP实验

HSRP实验实验目的:1.了解HSRP的工作原理,HSRP是如何提供网关的备份。
2.清楚HSRP路由器的几个状态,并且知道HSRP是如何选举活跃和备份路由器,HSRP的几个状态。
3.知道HSRP中优先级、占先权、端口跟踪的作用。
并且能够配置优先级、占先权、端口跟踪。
4.清楚HSRP中虚拟MAC的组成,计时器,消息类型,发送地址等等。
实验需求:1.把R4模拟成PC机,路由器之间使用静态路由做连接。
2.在R1和R3上配置standby 虚拟的IP地址是172.16.1.254.3.将R4的网关设置成172.16.1.254,保证R4可以PING通192.168.1.14.要尽最大可能保证R1和R3上的链路不管出现什么情况可以尽力保证R4能够PING通192.168.1.15.使用各种命令去验证standby的各种配置,检查各种参数。
注意事项:本拓扑图是按照机房的拓扑图来完成,如果需要使用到模拟器来完成本实验。
请按照模拟器的拓扑图来进行相应的更改。
配置步骤(在这里我使用OSPF来配置,同学在做的时候请使用静态路由来实现网络连通,基本的链路配置就不给出了,请同学们在配置玩链路以后测试链路的连通性)R1上的实验配置:R1(config)#router ospf 1R1(config-router)#router-id 1.1.1.1R1(config-router)#network 12.12.12.0 0.0.0.255 area 0 //将所有属于12.12.12.0/24这个网段的主机公告area 0R1(config-router)#network 172.16.1.0 0.0.0.255 area 0R1(config-router)#int e0R1(config-if)#standby 1 ip 172.16.1.254 //在E0口上配置HSRP,组编号是1虚拟IP地址是172.16.1.254R1(config-if)#R2上的实验配置R2(config)#router ospf 1R2(config-router)#router-id 2.2.2.2R2(config-router)#network 12.12.12.0 0.0.0.255 area 0R2(config-router)#network 23.23.23.0 0.0.0.255 area 0R2(config-router)#network 192.168.1.0 0.0.0.255 area 0R2(config-router)#R3上的实验配置R3(config)#router os 1R3(config-router)#router-id 3.3.3.3R3(config-router)#network 23.23.23.0 0.0.0.255 area 0R3(config-router)#network 172.16.1.0 0.0.0.255 area 0R3(config-router)#int e0R3(config-if)#standby 1 ip 172.16.1.254 //在E0口上配置HSRP,组编号是1虚拟IP地址是172.16.1.254R3(config-if)#需要主意:如果希望2个路由器共同维护一个HSRP组,那么要求保证2个路由器有相同的组编号和虚拟IP地址R4上的配置:(R4我们模拟成主机,如果希望把路由器模拟成主机需要关闭路由另外在给路由器配置网关)R4(config)#no ip routing //关闭路由功能R4(config)#ip default-gateway 172.16.1.254 //配置一个默认网关,需要主意网关和路由功能只能生效一个,希望网关生效就需要关闭路由功能。
实验37交换机HSRP实验

实验三十七、交换机HSRP实验一、 实验目的1、熟悉HSRP协议的使用方式和配置方法;2、理解HSRP协议的适用场合。
二、 应用环境大部分网络中的PC都是指定默认网关的,PC通过默认网关达到上网的目的。
如果作为默认网关的交换机损坏,所有使用该网关为下一跳主机的通信必然要中断。
即便配置了多个默认网关,如不重新启动终端设备,也不能切换到新的网关。
HSRP就是为了避免静态指定网关的缺陷而设计的。
在网络中有至少两台设备作为PC的网关存在,并且这两台设备可以虚拟出一个相同的IP作为PC的网关,也就是说一个IP地址可以对应两台交换机设备,任何一台交换机失效,都不会影响下面PC的通信。
HSRP,全称Hot Standby Routing Protocol,原理类似于服务器HA群集,两台或更多的三层设备以同样的方式配置成Cluster,创建出单个的虚拟路由器,然后客户端将网关指向该虚拟路由器。
最后由HSRP决定哪个设备扮演真正的默认网关。
三、 实验设备1、DCRS-7604(或6804)交换机1台2、DCRS-5526S交换机1台3、HUB或交换机1台4、PC机2-4台5、Console线1-2根6、直通网线若干根五、 实验要求1、在交换机7604和交换机5526S上分别划分基于端口的VLAN:交换机 VLAN 端口成员 IP1 24 10.1.157.1/24DCRS-7604100 1 192.168.100.2/2410 8-16 192.168.10.1/24DCRS-5526S1 24 10.1.157.2/24100 1 192.168.100.3/2420 8-16 192.168.20.1/242、PC1-PC4的网络设置为:设备 IP地址 gateway MaskPC1 192.168.100.101 192.168.100.1255.255.255.0PC2 192.168. 100.102 192.168.100.1255.255.255.0PC3 192.168.10.2 192.168.10.1 255.255.255.0PC4 192.168.20.2 192.168.20.1 255.255.255.03、验证:无论拔掉192.168.100.1的线还是192.168.100.2的线,PC1和PC2不需要做网络设置的改变都可以与PC3和PC4通信。
HSRP热备份实验报告

HSRP热备份实验报告HSRP 热备份实验【实验目的】1.理解HSRP的工作原理2.掌握HSRP的配置【实验拓扑】【步骤1】在r1在配置r1(config)#int s0/0r1(config-if)#ip add 192.168.12.1 255.255.255.0 r1(config-if)#clock rate 64000r1(config-if)#no shutdownr1(config)#int s0/1r1(config-if)#ip add 192.168.23.1 255.255.255.0 r1(config-if)#clock rate 64000r1(config-if)#no shutdownr1(config-if)#int lo0r1(config-if)#ip add 8.8.8.8 255.255.255.0r1(config-if)#no shutdownr1(config-if)# router ripr1(config-router)#version 2r1(config-router)#no auto-summaryr1(config-router)#network 192.168.12.0r1(config-router)#network 192.168.23.0r1(config-router)#network 8.8.8.0【步骤2】在r2在配置ip以及路由协议、hsrp和端口跟踪r2(config)#int s0/0r2(config-if)#ip add 192.168.12.2 255.255.255.0r2(config-if)#no shutdownr2(config-if)#int f1/0r2(config-if)#ip add 192.168.0.102 255.255.255.0r2(config-if)#no shutdownr2(config-if)#exitr2(config)#router ripr2(config-router)#version 2r2(config-router)#no auto-summaryr2(config-router)#network 192.168.12.0r2(config-router)#network 192.168.0.0r2(config-router)#passive-interface f1/0r2(config)#int f1/0r2(config-if)#standby 1 ip 192.168.0.1r2(config-if)#standby 1 priority 150r2(config-if)#standby 1 preemptr2(config-if)#standby 1 track s0/0 60【步骤3】在r3在配置ip以及路由协议、hsrpr3(config)#int s0/0r3(config-if)#ip add 192.168.23.2 255.255.255.0r3(config-if)#no shutdownr3(config)#int f1/0r3(config-if)#ip add 192.168.0.101 255.255.255.0r3(config-if)#no shutdownr3(config-if)#exitr3(config)#router ripr3(config-router)#version 2r3(config-router)#network 192.168.23.0r3(config-router)#network 192.168.0.0r3(config-router)#passive-interface f1/0r3(config)#int f1/0r3(config-if)#standby 1 ip 192.168.0.1r3(config-if)#standby 1 preempt【步骤4】分别在r2和r3上查看热备份情况【步骤4】把网云配置成本地计算机去ping r1路由上的8.8.8.8 看实验是否成功经测试实验成功。
HSRP实验

HSRP实验实验拓扑见下:如上图所示,其中R4、R5、R6为PC,用路由器来模拟PC机,用小凡来做。
其中R1为ISP,R2和R3的路由器上都采用NAT来实验与R6的通信,路由器以及PC机的地址分配见下:R6:1.1.1.2R2:R3:255.255.255.0F1/0100.1.1.2F1/0200.1.1.21.1.1.1f0/0192.168.1.100F0/0192.168.1.200R1:R4:192.168.1.3R5:192.168.1.4F1/0 1.1.1.1255.255.255.0255.255.255.0F2/0200.1.1.1192.168.1.1192.168.1.2F0/0100.1.1.1说明,在R2和R3的接口上虚拟一个IP来作为R4和R5的网关。
各路由器的配置及详细说明见下:R1:Router>enRouter#conf tRouter(config)#no ip domain-lookupRouter(config)#line console0Router(config-line)#no exec-tRouter(config-line)#logging synchronousRouter(config-line)#exitRouter(config)#hostname R1R1(config)#interface fastEthernet1/0R1(config-if)#ip address1.1.1.1255.255.255.0R1(config-if)#no shutR1(config-if)#exitR1(config)#intR1(config)#interface fastEthernet2/0R1(config-if)#ip address200.1.1.1255.255.255.0R1(config-if)#no shutR1(config-if)#exitR1(config)#interface fastEthernet0/0R1(config-if)#ip address100.1.1.1255.255.255.0R1(config-if)#no shutR1的配置相对简单,只需要为每个端口分配之前规划好的IP地址就行。
HSRP

Hot Standby Router Protocol(HSRP)1、实验目的1、掌握HSRP的应用及配置2、实验内容拓扑图:需求:实现链路、设备热备3、实验配置配置:PC上设置好正确的IP地址,注意网关指向HSRP的虚拟地址(192.168.1.254)1、在R1上配置HSRPR1(config)#interface fastEthernet 0/0R1(config-if)#standby 1 ip 192.168.1.254//设置HSRP虚拟路由器的IP地址为:192.168.1.254R1(config-if)#standby 1 priority 105//设置HSRP的优先级值;值越大优先级越高R1(config-if)#standby 1 preempt//设置HSRP根据优先级值抢占Active角色功能R1(config-if)#standby 1 track fa0/1//开启HSRP对接口的Track功能2、在R2上配置HSRPR2(config)#interface fastEthernet 0/0R2(config-if)#standby 1 ip 192.168.1.254R2(config-if)#standby 1 priority 100//设置HSRP的优先级值;缺省为100,可以不设R2(config-if)#standby 1 preemptR2(config-if)#standby 1 track fa0/13、在SW1上配置DHCP,宣告PC的网关地址为192.168.1.254 (略)验证:1、查看HSRP协议相关信息R1#show standbyFastEthernet0/0 - Group 1State is Active//路由器HSRP的状态2 state changes, last state change 00:00:06Virtual IP address is 192.168.1.254//HSRP的虚拟IP地址,需手动指定Active virtual MAC address is 0000.0c07.ac01//HSRP的虚拟MAC地址,系统自动分配Local virtual MAC address is 0000.0c07.ac01 (v1 default)Hello time 3 sec, hold time 10 sec//HSRP的Hello时间Next hello sent in 1.924 secsPreemption enabled//HSRP抢占功能开启Active router is localStandby router is 192.168.1.2, priority 100//192.168.1.2 为HSRP的Standby路由器Priority 105 (configured 105)//配置的优先级值为105Track interface FastEthernet0/1 state Up decrement 10//开启了Track功能,惩罚值为10Group name is "hsrp-Fa0/0-1" (default)2、Debug HSRP的交互报文R1#debug standby*Mar 1 01:03:48.015: HSRP: Fa0/0 Grp 1 Hello out 192.168.1.1 Active pri 105 vIP 192.168.1.254*Mar 1 01:03:48.683: HSRP: Fa0/0 Grp 1 Hello in 192.168.1.2 Standby pri 100 vIP 192.168.1.254*Mar 1 01:03:49.135: HSRP: Fa0/0 Grp 1 Hello out 192.168.1.1 Active pri 105 vIP 192.168.1.254当R1的F0/1端口发生故障*Mar 1 01:07:13.283: %TRACKING-5-STATE: 1 interface Fa0/1 line-protocol Up->Down*Mar 1 01:07:13.283: HSRP: Fa0/0 Grp 1 Track 1 object changed, state Up -> Down*Mar 1 01:07:13.283: HSRP: Fa0/0 Grp 1 Priority 105 -> 95*Mar 1 01:07:13.291: HSRP: Fa0/0 Grp 1 Hello in 192.168.1.2 Standby pri 100 vIP 192.168.1.254*Mar 1 01:07:14.487: HSRP: Fa0/0 Grp 1 Hello out 192.168.1.1 Active pri 95 vIP 192.168.1.254 *Mar 1 01:07:19.407: HSRP: Fa0/0 Interface adv in, Active, active 1, passive 0, from 192.168.1.2 *Mar 1 01:07:19.411: HSRP: Fa0/0 Grp 1 Active router is 192.168.1.2, was local*Mar 1 01:07:19.411: HSRP: Fa0/0 Nbr 192.168.1.2 active for group 1*Mar 1 01:07:19.415: HSRP: Fa0/0 Grp 1 Standby router is unknown, was 192.168.1.2*Mar 1 01:07:19.415: HSRP: Fa0/0 Nbr 192.168.1.2 no longer standby for group 1 (Active)*Mar 1 01:07:19.415: HSRP: Fa0/0 Grp 1 Active: g/Hello rcvd from higher pri Active router (100/192.168.1.2)*Mar 1 01:07:19.415: HSRP: Fa0/0 Grp 1 Active -> Speak*Mar 1 01:07:19.419: HSRP: Fa0/0 Interface adv out, Passive, active 0 passive 1*Mar 1 01:07:19.419: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Active -> Speak*Mar 1 01:07:19.419: HSRP: Fa0/0 Grp 1 Resign out 192.168.1.1 Speak pri 95 vIP 192.168.1.254*Mar 1 01:07:19.427: HSRP: Fa0/0 Grp 1 Deactivating MAC 0000.0c07.ac01*Mar 1 01:07:19.427: HSRP: Fa0/0 Grp 1 Removing 0000.0c07.ac01 from MAC address filter*Mar 1 01:07:19.431: HSRP: Fa0/0 Grp 1 MAC addr update Delete from SMF 0000.0c07.ac01 *Mar 1 01:07:19.431: HSRP: Fa0/0 Grp 1 Hello out 192.168.1.1 Speak pri 95 vIP 192.168.1.254 *Mar 1 01:07:19.435: HSRP: Fa0/0 IP Redundancy "hsrp-Fa0/0-1" update, Active -> Speak*Mar 1 01:07:19.459: HSRP: Fa0/0 Interface adv in, Passive, active 0, passive 1, from 192.168.1.2*Mar 1 01:07:19.463: HSRP: Fa0/0 Grp 1 Resign in 192.168.1.2 Speak pri 100 vIP 192.168.1.254*Mar 1 01:07:19.463: HSRP: Fa0/0 Grp 1 Active router is unknown, was 192.168.1.2*Mar 1 01:07:19.463: HSRP: Fa0/0 Nbr 192.168.1.2 no longer active for group 1 (Speak)*Mar 1 01:07:19.467: HSRP: Fa0/0 Nbr 192.168.1.2 Was active or standby - start passive holddown*Mar 1 01:07:19.467: HSRP: Fa0/0 Grp 1 Hello in 192.168.1.2 Speak pri 100 vIP 192.168.1.254 *Mar 1 01:07:19.467: HSRP: Fa0/0 Grp 1 Speak: f/Hello rcvd from higher pri Speak router (100/192.168.1.2)*Mar 1 01:07:19.471: HSRP: Fa0/0 Grp 1 Speak -> Listen*Mar 1 01:07:19.471: HSRP: Fa0/0 Grp 1 Redundancy "hsrp-Fa0/0-1" state Speak -> Backup*Mar 1 01:07:19.471: HSRP: Fa0/0 Interface adv in, Active, active 1, passive 1, from 192.168.1.2 *Mar 1 01:07:19.471: HSRP: Fa0/0 Nbr 192.168.1.2 Adv in, active 1 passive 1*Mar 1 01:07:19.475: HSRP: Fa0/0 Nbr 192.168.1.2 is no longer passive*Mar 1 01:07:19.475: HSRP: Fa0/0 Nbr 192.168.1.2 destroyed*Mar 1 01:07:19.475: HSRP: Fa0/0 Grp 1 Coup in 192.168.1.2 Speak pri 100 vIP 192.168.1.254 *Mar 1 01:07:19.475: HSRP: Fa0/0 Grp 1 Active router is 192.168.1.2*Mar 1 01:07:19.479: HSRP: Fa0/0 Nbr 192.168.1.2 created*Mar 1 01:07:19.479: HSRP: Fa0/0 Nbr 192.168.1.2 active for group 1*Mar 1 01:07:19.479: HSRP: Fa0/0 Interface adv out, Passive, active 0 passive*Mar 1 01:07:19.483: HSRP: Fa0/0 Interface adv in, Active, active 1, passive 0, from 192.168.1.2 *Mar 1 01:07:19.483: HSRP: Fa0/0 IP Redundancy "hsrp-Fa0/0-1" update, Speak -> Backup*Mar 1 01:07:19.879: HSRP: Fa0/0 Grp 1 Hello in 192.168.1.2 Active pri 100 vIP 192.168.1.254 四、应用场景网络骨干链路上实现双出口链路、设备热备、负载均衡功能。
HSRP实验总结

实验总结:
机器:交换机2台,型号3550(三层设备);
实验目的:配置hsrp,使PC1能够PING通PC2,并且PC们不才用同一个网关,都采用不同的虚拟网关。
实验拓扑图:
实验过程:命令
Switch 1
Switch#conf t
Switch(config)#vlan 3
Switch(config-vlan)#exit
Switch(config)#int vlan 3
Switch(config-if)#ip add 192.168.1.1 255.255.255.0 (vlan 3的管理ip地址)
Switch(config-if)#no shut
Switch(config-if)#standby 17 ip 192.168.1.50 (虚拟网关地址必须在同一个网段里,给
端口加入备份组17.,指定虚拟ip地址)Switch(config-if)#standby 17 priority 200 (优先级为200)
Switch(config-if)#standby 17 preempt (配置占先级,意思是谁配置了占先级,
并且谁先起来了,谁就为指定主备份组;
如果2台交换机都配置了占先级,那就
相当于没有配置一样。
)
Switch(config-if)#end
Switch#
Switch 2的命令配置与switch 1的相同,只是虚拟ip地址不同,但在同一个网段里,优先级也是不同的。
PC1的配置:ip地址为:192.168.1.10/24 网关为:192.168.1.50 虚拟网关或者虚拟IP PC2的配置:ip地址为:192.168.1.20/24 网关为:(不与PC1的网关相同)。
HSRP

实验:配置HSRP 使得线路冗于效果当PC2 访问PC1时默认走1 R1 出去。
如果PC2 到R1之间出问题自动切换到R2!!!如果R1和R3之间线路出问题也切换到R2!!(路由跟踪功能)PC1 IP:192.168.3.2 255.255.255.0PC2 IP:192.168.1.10 255.255.255.0=================================================R1(config)#router ripR1(config-router)#ver 2R1(config-router)#net 192.168.1.0R1(config-router)#net 192.168.2.0R1(config-router)#passive-interface fa0/0 配置被动接口可以不配为了防止影响HSRP=========================================================R2(config)#router ripR2(config-router)#ver 2R2(config-router)#net 192.168.3.0R2(config-router)#net 192.168.2.0R2(config-router)#net 192.168.4.0R2(config-router)#passive-interface fa0/0==============================================================R3(config)#router ripR1(config-router)#ver 2R3(config-router)#net 192.168.1.0R3(config-router)#net 192.168.4.0========================================================R1(config)#int fa0/0R1(config-if)#standby 1 ip 192.168.1.100 配置HSRP组号为 1 虚拟共用IP 为192.168.1.100R1(config-if)#standby 1 preempt 强占功能允许优先级高的路由替代优先低的R1(config-if)#standby 1 priority 120 设置R1优先级为120R1(config-if)#standby 1 authentication md5 key-string cisco 设置认证防止方法路由器加入R1(config-if)#standby 1 track s1/0 30 设置路由跟踪就是当2.0网段出问题了,自动将路由器优先级减去30 使得自己的优先级低与同组路由器,从而让其它路由器获得转发权继续转发数据。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
standby authentication
命令:standby [<group>] authentication <string> no standby [<group>] authentication
DCRS-5526S(Config-If-Vlan20)#ip address 192.168.20.1 255.255.255.0 DCRS-5526S(Config-If-Vlan20)#exit DCRS-5526S(Config)# 验证配置 使用PC1、PC2 ping 192.168.100.2 和192.168.100.3验证结果,都是通的。 使用PC1、PC2 ping 192.168.100.1 是不通的。因为此时192.168.100.1还是不存在的。
六、 实验步骤
第一步:交换机全部恢复出厂设置,配置交换机的VLAN信息 交换机DCRS-7604: DCRS-7604#conf DCRS-7604(Config)#vlan 100 DCRS-7604(Config-Vlan100)#switchport interface ethernet 1/24 DCRS-7604(Config-Vlan100)#exit DCRS-7604A(Config)#vlan 10 DCRS-7604A(Config-Vlan10)#switchprt interface ethernet 1/8-16 DCRS-7604A(Config-Vlan10)#exit
交换机DCRS-5526S: DCRS-5526S(Config)#interface vlan 100 DCRS-5526S(Config-If-Vlan100)#standby 100 ip 192.168.100.1 DCRS-5526S(Config-If-Vlan100)#standby 100 authentication xuxp DCRS-5526S(Config-If-Vlan100)#standby 100 priority 20 DCRS-5526S(Config-If-Vlan100)# 验证配置: DCRS-5526S#show standby ********************************************************************* Vlan100 - Group100 Local state is ACTIVE (interface up) ,priority 20(Config) Hello time 3 sec, hold time 10 sec(Default) Authentication is xuxp Preemption disabled Virtual IP address is 192.168.100.1 Active router is local,Priority 20 (default 100) Standby router is 192.168.100.2,priority 10 (expires in 6 sec) *********************************************************************
DCRS-5526S#
由此可见:HSRP已经成功建立,并且master的机器是5526S,因为它的优先级是20,高 于7604的优先级10。
第五步:验证实验
1、使用PC1和PC2 ping 目的地址。
PC
Ping
结果
PC1、PC2 192.168.100.1 通
原因
PC1、PC2 PC3、PC4
通
2、在PC1使用“ping 192.168.100.1 -t”命令,并且在过程中拔掉192.168.100.3的网 线,观察情况。
七、 注意事项和排错
在配置、使用 HSRP 协议时,可能会由于物理连接、配置错误等原因导致 HSRP 协议未 能正常运行。因此,用户应注意以下要点:
首先应该保证物理连接的正确无误; 其次,保证接口和链路协议是 UP(使用 show interface 命令); 然后,确保在接口上已启动了 HSRP 协议; 检查同一备份组内的不同交换机认证是否相同; 检查同一备份组内的不同交换机配置的 timer 时间是否相同; 检查虚拟 IP 地址是否和接口真实 IP 地址在同一网段内;
2、 PC1-PC4 的网络设置为:
设备 PC1 PC2 PC3 PC4
IP 地址 192.168.100.101 192.168. 100.102 192.168.10.2 192.168.20.2
gateway 192.168.100.1 192.168.100.1 192.168.10.1 192.168.20.1
实验三十七、交换机 HSRP 实验
一、 实验目的
1、 熟悉 HSRP 协议的使用方式和配置方法; 2、 理解 HSRP 协议的适用场合。
二、 应用环境
大部分网络中的 PC 都是指定默认网关的,PC 通过默认网关达到上网的目的。如果作为 默认网关的交换机损坏,所有使用该网关为下一跳主机的通信必然要中断。即便配置了多个 默认网关,如不重新启动终端设备,也不能切换到新的网关。HSRP 就是为了避免静态指定 网关的缺陷而设计的。
验证配置: 在交换机A中ping 192.168.20.1 ,在在交换机B中ping 192.168.10.1,如果都通,则 配置正确。
第四步:配置HSRP 交换机DCRS-7604: DCRS-7604(Config)#interface vlan 100 DCRS-7604(Config-If-Vlan100)#standby 100 ip 192.168.100.1 DCRS-7604(Config-If-Vlan100)#standby 100 authentication xuxp DCRS-7604(Config-If-Vlan100)#standby 100 priority 10 DCRS-7604(Config-If-Vlan100)#exit DCRS-7604(Config)#
八、 配置序列
Current configuration: !
hostname DCRS-7604 ! Vlan 1
vlan 1 ! Vlan 100
vlan 100 ! Interface Ethernet1/1
switchport access vlan 100 ! Interface Ethernet1/2 …… Interface Ethernet1/28 !
在网络中有至少两台设备作为 PC 的网关存在,并且这两台设备可以虚拟出一个相同的 IP 作为 PC 的网关,也就是说一个 IP 地址可以对应两台交换机设备,任何一台交换机失效, 都不会影响下面 PC 的通信。
HSRP,全称 Hot Standby Routing Protocol,原理类似于服务器 HA 群集,两台或更多 的三层设备以同样的方式配置成 Cluster,创建出单个的虚拟路由器,然后客户端将网关指 向该虚拟路由器。最后由 HSRP 决定哪个设备扮演真正的默认网关。
交换机DCRS-5526S: DCRS-5526S(Config)#vlan 100 DCRS-5526S(Config-Vlan100)#switchport interface ethernet 0/0/24 DCRS-5526S(Config-Vlan100)#exit DCRS-5526S(Config)#vlan 20 DCRS-5526S(Config-Vlan20)#switchport interface ethernet 0/0/8-16 DCRS-5526S(Config-Vlan20)#exit
第二步:配置交换机各vlan虚接口的IP地址 交换机DCRS-7604: DCRS-7604(Config)#int vlan 1 DCRS-7604(Config-If-Vlan1)#ip address 10.1.157.1 255.255.255.0 DCRS-7604(Config-If-Vlan1)#no shut DCRS-7604(Config-If-Vlan1)#exit DCRS-7604(Config)#int vlan 100 DCRS-7604(Config-If-Vlan100)#ip address 192.168.100.2 255.255.255.0 DCRS-7604(Config-If-Vlan100)#no shut DCRS-7604(Config-If-Vlan100)#exit DCRS-7604A(Config)#int vlan 10 DCRS-7604A(Config-If-Vlan10)#ip address 192.168.10.1 255.255.255.0 DCRS-7604A(Config-If-Vlan10)#no shut DCRS-7604A(Config-If-Vlan10)#exit
交换机 DCRS-7604
DCRS-5526S
VLAN 1 100 10 1 100 20
端口成员 24 1 8-16 24 1 8-16
IP 10.1.157.1/24 192.168.100.2/24 192.168.10.1/24 10.1.157.2/24 192.168.100.3/2255.255.0 255.255.255.0 255.255.255.0 255.255.255.0
3、 验证:
无论拔掉 192.168.100.1 的线还是 192.168.100.2 的线,PC1 和 PC2 不需要做网络设 置的改变都可以与 PC3 和 PC4 通信。则证明 HSRP 正常工作。
interface Vlan1 interface vlan 1 ip address 10.1.157.1 255.255.255.0