拓扑图

实验目的

1)在三层交换机上f0/1-2做三层portchannel,创建vlan 100,vlan 200,分别对应网段192.168.100.0/24 ,192.168.200.0/24

2) 两台交换机上配置HSRP ,sw1作为vlan100的主路由器,sw2作为vlan 200的主路由器

3)配置dhcp pool,是的下联pc自动获取地址

配置脚本

1.配置三层portchannel

1 SW1(config)#int port-channel 1

2 SW1(config-if)#no switchport

3 SW1(config-if)#ip addr 12.1.1.1 255.255.255.0

4 SW1(config)#int range f0/1-2

5 SW1(config-if-range)#no switchport

6 SW1(config-if-range)#channel-group 1 mode active

7

8

9

10 SW2(config)#int port-channel 1

11 SW2(config-if)#no switchport

12 SW2(config-if)#ip addr 12.1.1.2 255.255.255.0

13 SW2(config)#int range f0/1-2

14 SW2(config-if-range)#no switchport

15 SW2(config-if-range)#channel-group 1 mode active

验证:

1 SW2#show etherchannel su

2 Flags: D - down P - in port-channel

3 I - stand-alone s - suspended

4 H - Hot-standby (LACP only)

5 R - Layer3 S - Layer2

6 U - in use f - failed to allocate aggregator

7 u - unsuitable for bundling

8 w - waiting to be aggregated

9 d - default port

10

11

12 Number of channel-groups in use: 1

13 Number of aggregators: 1

14

15 Group Port-channel Protocol Ports

16 ------+-------------+-----------+----------------------------------------------

17

18 1 Po1(RU) LACP Fa0/1 (P ) Fa0/2(P )

19

2.配置HSRP

1 #创建vlan100 vlan200

2 SW1(config)#vlan 100

3 SW1(config-vlan)#vlan 200

4

5 #配置HSRP

6 SW1(config)#int range f0/3-4

7 SW1(config-if-range)#sw tr en do

8 SW1(config-if-range)#sw mo tr

9 SW1(config)#int f0/4

10 SW1(config-if)#sw tr allowed vlan 200

11 SW1(config-if)#int f0/3

12 SW1(config-if)#sw tr allowed vlan 100

13 二层交换机接口设置trunk

14

15

16 SW1(config)#int vlan 100

17 SW1(config-if)#ip addr 192.168.100.252 255.255.255.0

18 SW1(config-if)#standby 1 ip 192.168.100.254 #设置虚拟网关

19 SW1(config-if)#standby 1 priority 200 #设置优先级为200

20 SW1(config-if)#standby 1 preempt #开启抢占

21

22

23 SW1(config-if)#int vlan 200

24 SW1(config-if)#ip addr 192.168.200.253 255.255.255.0

25 SW1(config-if)#standby 2 ip 192.168.200.254

26 SW1(config-if)#standby 2 priority 195

27 SW1(config-if)#standby 2 preempt

28 %HSRP-6-STATECHANGE: Vlan100 Grp 1 state Speak -> Standby

29

30 %HSRP-6-STATECHANGE: Vlan100 Grp 1 state Standby -> Active

31

32 %HSRP-6-STATECHANGE: Vlan200 Grp 2 state Speak -> Standby

33

34 %HSRP-6-STATECHANGE: Vlan200 Grp 2 state Standby -> Active

35

36

37 -----------------

38 SW2(config)#vlan 100

39 SW2(config-vlan)#vlan 200

40

41 SW2(config)#int range f0/3-4

42 SW2(config-if-range)#sw tr en do

43 SW2(config)#int vlan 100

44 SW2(config-if-range)#sw mo tr

45 SW2(config)#int f0/4

46 SW2(config-if)#sw tr allowed vlan 200

47 SW2(config-if)#int f0/3

48 SW2(config-if)#sw tr allowed vlan 100

49

50 SW2(config-if)#ip addr 192.168.100.253 255.255.255.0

51 SW2(config-if)#standby 1 ip 192.168.100.254

52 SW2(config-if)#standby 1 priority 195

53 SW2(config-if)#standby 1 preempt

54 SW2(config-if)#int vlan 200

55 SW2(config-if)#ip addr 192.168.200.252 255.255.255.0

56 SW2(config-if)#standby 2 ip 192.168.200.254

57 SW2(config-if)#standby 2 priority 200

58 SW2(config-if)#standby 2 preempt

59 %HSRP-6-STATECHANGE: Vlan100 Grp 1 state Speak -> Standby

60

61 %HSRP-6-STATECHANGE: Vlan100 Grp 1 state Standby -> Active

62

63 %HSRP-6-STATECHANGE: Vlan200 Grp 2 state Speak -> Standby

64

65 %HSRP-6-STATECHANGE: Vlan200 Grp 2 state Standby -> Active

66

67 %HSRP-6-STATECHANGE: Vlan100 Grp 1 state Speak -> Standby

68

验证:

1 SW2#show standby brief

2 P indicates configured to preempt.

3 |

4 Interface Grp Pri P State Active Standby Virtual IP

5 Vl100 1 195 P Standby 192.168.100.252 local 192.168.100.254

6 Vl200 2 200 P Active local 192.168.200.253 192.168.200.254

7

8

9 SW1#show standby brief

10 P indicates configured to preempt.

11 |

12 Interface Grp Pri P State Active Standby Virtual IP

13 Vl100 1 200 P Active local 192.168.100.253 192.168.100.254

14 Vl200 2 195 P Standby 192.168.200.252 local 192.168.200.254

15

16 ## 3.配置DHCP POOL

17 SW1(config)#ip dhcp pool vlan100

18 SW1(dhcp-config)#network 192.168.100.0 255.255.255.0

19 SW1(dhcp-config)#default-router 192.168.100.254

20 SW1(dhcp-config)#dns-server 8.8.8.8

21 SW1(config)#ip dhcp excluded-address 192.168.100.252 192.168.100.254

22

23 SW1(dhcp-config)#network 192.168.200.0 255.255.255.0

24 SW1(dhcp-config)#default-router 192.168.200.254

25 SW1(dhcp-config)#dns-server 8.8.8.8

26 SW1(config)#ip dhcp excluded-address 192.168.200.252 192.168.200.254

27

28

29

30 SW2(config)#ip dhcp excluded-address 192.168.100.252 192.168.100.254

31 SW2(config)#ip dhcp excluded-address 192.168.200.252 192.168.200.254

32 SW2(config)#ip dhcp pool vlan100

33 SW2(dhcp-config)# network 192.168.100.0 255.255.255.0

34 SW2(dhcp-config)# default-router 192.168.100.254

35 SW2(dhcp-config)# dns-server 8.8.8.8

36 SW2(dhcp-config)#ip dhcp pool vlan200

37 SW2(dhcp-config)# network 192.168.200.0 255.255.255.0

38 SW2(dhcp-config)# default-router 192.168.200.254

验证

关闭sw1,验证是否能够ping通网关

1 SW1(config)#int range f0/1-4

2 SW1(config-if-range)#shut

3

1

2 SW2#show standby brief

3 P indicates configured to preempt.

4 |

5 Interface Grp Pri P State Active Standby Virtual IP

6 Vl100 1 195 P Active local unknown 192.168.100.254

7 Vl200 2 200 P Active local 192.168.200.253 192.168.200.254

8

9

10

11 C:>ping 192.168.100.254

12

13 Pinging 192.168.100.254 with 32 bytes of data:

14

15 Reply from 192.168.100.254: bytes=32 time<1ms TTL=255

16 Reply from 192.168.100.254: bytes=32 time=1ms TTL=255

17 Reply from 192.168.100.254: bytes=32 time<1ms TTL=255

18 Reply from 192.168.100.254: bytes=32 time<1ms TTL=255

开启sw1

1 SW1(config-if-range)#no shut

2

3

4 SW1#show standby brief

5 P indicates configured to preempt.

6 |

7 Interface Grp Pri P State Active Standby Virtual IP

8 Vl100 1 200 P Active local 192.168.100.253 192.168.100.254

9 Vl200 2 195 P Standby 192.168.200.252 local 192.168.200.254

目前CCIE RS 笔试和LAB 稳定,持续过人中,了解之前的PASS情况和咨询考试情况

报名咨询QQ:839898248 VX:Ciscolnfinity 备注知乎

欢迎关注微信公众号:思唯网络学院

hsrp 切换_【思唯网络学院】HSRP+DHCP实验讲解相关推荐

  1. arp协议的主要功能是_【思唯网络学院】ARP理论知识详解(一)

    一.简介 ARP(Address Resolution Protocol,地址解析协议)是将IP地址解析为以太网MAC地址的协议. ARP安全是针对ARP攻击的一种安全特性,它通过一系列对ARP表项学 ...

  2. pppoe拨号的外网ip无法ping通_【思唯网络学院】 五大网络概念:IP地址、子网掩码、网关、DHCP服务和PPPoE拨号...

    5G技术的更新,推动了新一代的网络通信发展,家庭宽带上网也从最初的十几K的速度,提升到了现在动则上百上千兆的速度,很多有部署了家庭NAS的用户,甚至都已经更新到了10G级别的内部局域网了. 在这个信息 ...

  3. 基带工程师是做什么的_【思唯网络学院】网络工程师认证可以用来做什么?

    点击上方"蓝字"关注我们了解更多精彩01思科华为证书可以用来做什么 网工证书从本质来说是证明你有这个能力,如果证书本身证明不了什么,那这个证书就已经失去该有的功能了. 这也是为何现 ...

  4. 局域网网络风暴检测工具_【思唯网络学院】从原理到配置,最全的VLAN说明就在这了!...

    有关VLAN的技术标准IEEE 802.1Q早在1999年6月份就由IEEE委员正式颁布实施了,而且最早的VLNA技术早在1996年Cisco(思科)公司就提出了.随着几年来的发展,VLAN技术得到广 ...

  5. 华为交换机默认vlan都是通的吗_【思唯网络学院】华为交换机常用的三种vlan划分方法...

    端口类型 在学习划分vlan前,必须要了解华为交换机的端口类型,以及他们的使用方法,因为端口的类型在实际配置中是必须会用到的,因为下面的vlan划分会用到. 1.Access类型端口 执行命令port ...

  6. ipv6 ospf配置方法_【思唯网络学院】网络故障大全及处理原理和方法

    第一章 故障处理方法 一.网络的复杂性 一般网络包括路由.拨号.交换.视频.WAN(ISDN.帧中继.ATM.-).LAN.VLAN.- 二.故障处理模型 1. 界定问题(Define the Pro ...

  7. lacp可以在access接口吗_【思唯网络学院】【干货】LACP与PAGP是什么?有何区别?...

    为了为网络创建最大的可用性和稳定性,企业和数据中心在部署网络时会强调链路冗余或冗余链路.通过提供对链路丢失的自动恢复,以太网通道技术是实现网络冗余的最有效方法. 在跨交换机或路由器等网络设备配置Eth ...

  8. 思科命令大全_【思唯网络学院】【汇总】思科网络设备产品型号大全!超全解释~...

    思科公司是全球领先的网络解决方案供应商.Cisco的名字取自San Francisco(旧金山),那里有座闻名于世界的金门大桥.可以说,依靠自身的技术和对网络经济模式的深刻理解,思科成为了网络应用的成 ...

  9. ipv6单播地址包括哪两种类型_【思唯网络学院】CCNP知识点总结——IPv6

    CCNP知识点总结--IPv6 1.常用计数 2的32次方:4,294,967,296: 2的128次方:340,282,366,920,938,463,374,607,432,768,211,456 ...

最新文章

  1. Java学习笔记18
  2. vs2010常用快捷键
  3. PostgreSQL数据库图像搜索插件imgsmlr部署
  4. linux ubi 分区,Linux最新UBI文件系统介绍
  5. HTML 限制 input 输入类型
  6. java工程师_Java开发工程师需要掌握哪些技能?
  7. Android 调用系统的分享[完美实现同一时候分享图片和文字]
  8. [洛谷P3292] [SCOI2016]幸运数字
  9. java.util.LinkedHashMap cannot be cast to Entity
  10. vmlinux vmlinuz zimage uimage 区别
  11. 2022年消闲设施行业研究报告
  12. 电脑如何分盘win10_如何给win10电脑系统盘分区?
  13. 【数字信号处理】线性常系数差分方程 ( 使用递推解法求解 “ 线性常系数差分方程 “ | “ 线性常系数差分方程 “ 初始条件的重要性 )
  14. LeetCode 复数乘法
  15. 站内搜寻引擎 php mysql_使用PHP+Sphinx建立高效的站内搜索引擎的方法
  16. 解读 ESP32 API参考-system-App Image Format
  17. 迅雷网心云赚钱宝3代【Pro】8核性能神器,真实收益有多高?
  18. internet协议
  19. 支付宝 iOS SDK 官方下载页面
  20. linux获得蓝牙外设mac,iOS 与蓝牙操作如何获取MAC地址

热门文章

  1. 华为OD机试真题- 处理器问题【2023Q1】
  2. iOS应用安全开发你不知道的那些事儿
  3. biee for mysql_BIEE11GRpd合并
  4. 巴基斯坦电信和中国电信合作建光纤网络
  5. 原 docker(21):使用docker构建小的镜像
  6. (未完待续)浅谈微服务以及 常用中间件( zookeeper redis rabbitmq)
  7. linux的tail用法,tail命令_Linux tail命令用法详解
  8. linux 监控日志文件实时输出的方法(tail命令)
  9. 【idea】IDEA 出现问题:Error running xxx Command line is too long. Shorten command line 解决方案
  10. 2020年我国将研制出时速600公里高速磁浮样车