当前位置: 首页 > news >正文

HCIP第二次作业(VRRP/STP/VLAN/Eth-trunk/NAT)

实验拓扑图

根据要求,将配置的拓扑梳理为:

实验内容

顺序1,2,3        vlan,eth-trunk

建立配置vlan,建立eth-trunk

SW1

<Huawei>sys
[Huawei]sys SW1#创建vlan2 3
[SW1]vlan ba 2 to 3    #创建eth-trunk
[SW1]interface Eth-Trunk 0
[SW1-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 0/0/2#配置vlan
[SW1]port-group group-member GigabitEthernet 0/0/3 GigabitEthernet 0/0/4 Eth-Trunk 0
[SW1-port-group]port link-type trunk 
[SW1-port-group]port trunk allow-pass vlan 2 to 3
[SW1-port-group]undo port trunk allow-pass vlan 1

SW2

<Huawei>sys
[Huawei]sys SW2
[SW2]vlan ba 2 to 3[SW2]interface Eth-Trunk 0
[SW2-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 0/0/2[SW2-GigabitEthernet0/0/4]port link-type trunk 
[SW2-Eth-Trunk0]port link-type trunk 
[SW2-Eth-Trunk0]port trunk allow-pass vlan 2 to 3[SW2-Eth-Trunk0]port-group group-member GigabitEthernet 0/0/3 GigabitEthernet 0/0/4 Eth-Trunk 0
[SW2-port-group]port link-type trunk 
[SW2-port-group]port trunk allow-pass vlan 2 to 3
[SW2-port-group]undo por trunk all vlan 1

SW3

<Huawei>sys
[Huawei]sys SW3
[SW3]vlan ba 2 to 3
[SW3]int GigabitEthernet  0/0/1
[SW3-GigabitEthernet0/0/1]port link-type access 
[SW3-GigabitEthernet0/0/1]port default vlan 2
[SW3]int GigabitEthernet  0/0/2
[SW3-GigabitEthernet0/0/2]port link-type access 
[SW3-GigabitEthernet0/0/2]port default vlan 3
[SW4-GigabitEthernet0/0/2]q
[SW3]port-group group-member g 0/0/3 g 0/0/4
[SW3-port-group]por link-t tru
[SW3-port-group]port trunk allow-pass vlan 2 to 3
[SW3-GigabitEthernet0/0/4]undo por tr all vla 1

SW4

<Huawei>sys
[Huawei]sys SW4
[SW4]vlan ba 2 to 3
[SW4]int g 0/0/1
[SW4-GigabitEthernet0/0/1]port link-type  acc
[SW4-GigabitEthernet0/0/1]port default vlan 2
[SW4-GigabitEthernet0/0/1]int g 0/0/2
[SW4-GigabitEthernet0/0/2]por link-t acc
[SW4-GigabitEthernet0/0/2]por de vlan 3
[SW4-GigabitEthernet0/0/2]q
[SW4]port-group group-member g 0/0/3 g 0/0/4
[SW4-port-group]port link-type trun
[SW4-port-group]port trunk allow-pass vlan 2 to 3
[SW4-port-group]undo por tr all vla 1

顺序4

建立mstp

所有交换机

[SW]stp region-configuration 
[SW-mst-region]region-name aa    #域名
[SW-mst-region]revision-level 1    #修订等级
[SW-mst-region]instance 2 vlan 2    #划分实例
[SW-mst-region]instance 3 vlan 3
[SW-mst-region]active region-configuration     #激活配置
[SW-mst-region]q

SW1

[SW1]stp instance 2 root primary    #SW1在实例2作为根网桥
[SW1]stp instance 3 root secondary     #SW1在实例3作为备份网桥

SW2

[SW2]stp instance 2 root secondary
[SW2]stp instance 3 root primary 

顺序5,6        SVI,vrrp

SVI和vrrp的配置

SW1

[SW1]interface Vlanif 2
[SW1-Vlanif2]ip add 172.16.2.1 24
[SW1-Vlanif2]vrrp vrid 2 virtual-ip 172.16.2.254
[SW1-Vlanif2]vrrp vrid 2 priority 110
#配置上升链路监控和抢占延迟
[SW2-Vlanif2]vrrp vrid 2 track interface g 0/0/5 reduced 11
[SW2-Vlanif2]vrrp vrid 2 preempt-mode timer delay 20[SW1-Vlanif2]int vlanif 3
[SW1-Vlanif3]ip add 172.16.3.2 24
[SW1-Vlanif3]vrrp vrid 3 virtual-ip 172.16.3.254

SW2

[SW2]int vlanif 2
[SW2-Vlanif2]ip add 172.16.2.2 24
[SW2-Vlanif2]vrrp vrid 2 virtual-ip 172.16.2.254
[SW2-Vlanif2]int vlanif 3
[SW2-Vlanif3]ip add 172.16.3.1 24
[SW1-Vlanif3]vrrp vrid 3 virtual-ip 172.16.3.254
[SW2-Vlanif3]vrrp vrid 3 priority 110
[SW2-Vlanif3]vrrp vrid 3 track interface g 0/0/5 reduced 11
[SW2-Vlanif3]vrrp vrid 3 preempt-mode timer delay 20

顺序7 ip

dhcp实现ip地址分配

SW1和SW2

[SW]dhcp enable 
[SW]ip pool vlan2
[SW-ip-pool-vlan2]network 172.16.2.0 mask 24
[SW-ip-pool-vlan2]gateway-list 172.16.2.254
[SW-ip-pool-vlan2]q
[SW]ip pool vlan3
[SW-ip-pool-vlan3]network 172.16.3.0 mask 24
[SW-ip-pool-vlan3]gateway-list 172.16.3.254
[SW1-ip-pool-vlan3]q
[SW1]int vlanif 2
[SW1-Vlanif2]dhcp select global 
[SW1-Vlanif2]int vlanif 3
[SW1-Vlanif3]dhcp select global 

结果:

PC1

PC4

顺序8 路由

SW1

#连接AR1
[SW1]vlan 10
[SW1-vlan10]q
[SW1]int vlanif 10
[SW1-Vlanif10]ip add 172.16.0.1 30
[SW1]int g 0/0/5
[SW1-GigabitEthernet0/0/5]port link-type access 
[SW1-GigabitEthernet0/0/5]port default vlan 10#配置ospf
[SW1]ospf 1 rout	
[SW1]ospf 1 router-id 2.2.2.2
[SW1-ospf-1]area 0
[SW1-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

SW2

[SW2]vlan 10
[SW2-vlan10]q
[SW2]int vlanif 10
[SW2-Vlanif10]ip add 172.16.0.5 24
[SW2-Vlanif10]q
[SW2]int g 0/0/5
[SW2-GigabitEthernet0/0/5]port link-type access 
[SW2-GigabitEthernet0/0/5]port default vlan 10
[SW2]ospf 1 router-id 3.3.3.3
[SW2-ospf-1]area 0
[SW2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255

AR1

<Huawei>sys
[Huawei]sys AR1
[AR1]int g 0/0/1
[AR1-GigabitEthernet0/0/1]ip add 172.16.0.2 30
[AR1-GigabitEthernet0/0/1]int g 0/0/2
[AR1-GigabitEthernet0/0/2]ip add 172.16.0.6 30
[AR1-GigabitEthernet0/0/2]int g 0/0/0
[AR1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[AR1]ospf 1 router-id 1.1.1.1
[AR1-ospf-1]area 0
[AR1-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]q#配置缺省
[AR1-ospf-1]default-route-advertise always 
[AR1-ospf-1]q
[AR1]ip route-static 0.0.0.0 0 12.0.0.2

AR2

<Huawei>sys
[Huawei]sys ISP
[ISP]int g 0/0/0
[ISP-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip add 1.1.1.1 24

结果:

PC1 ping PC3

顺序9 nat

AR1

[AR1]acl 2000
[AR1-acl-basic-2000]rule permit  source 172.16.0.0 0.0.255.255
[AR1-acl-basic-2000]q
[AR1]int g 0/0/0	
[AR1-GigabitEthernet0/0/0]nat outbound  2000

结果:

PC1 ping ISP环回

http://www.dtcms.com/a/528142.html

相关文章:

  • 外国设计网站推荐自己学网站建设
  • ASP.NET Core中创建中间件的几种方式
  • Docker安装思源笔记使用指南
  • 需求登记网站怎么做免费高清图片素材网站推荐
  • SpringBoot集成Elasticsearch | Java High Level Rest Client(HLRC)方式
  • 《神领物流》day07-线路规划之线路管理_完整代码【简单易懂注释版】
  • 使用Ansys Polyflow对泡沫聚合物挤出进行建模
  • 【组成原理·硬件】6总线
  • Spring Boot3零基础教程,整合 SSM,笔记52
  • 序列化详解
  • 网站设计制作电影福建网站建设公司
  • 记录一次Oracle日志listener.log文件大小超过4G后出现Tomcat服务启动一直报错的原因【ORACLE】
  • Docker Desktop快速搭建本地k8s集群
  • LabVIEW超高分辨显微成像系统
  • 东莞建网站的公破解付费wordpress主题
  • 国产数据库破局:金仓数据库如何无缝替代MongoDB支撑2TB政务数据
  • Switch 20.5.0系统最新PSP模拟器懒人包
  • 怎么做网上直营店网站php素材网站源码免费下载
  • 巡检机器人户外视觉识别困境剖析与自动优化模式构建
  • C++ - 异常
  • C++笔记(面向对象)深赋值 浅赋值
  • 数据库在什么情况下会发生数据库死锁
  • 如何将Word文档精确转换为图片型PDF?
  • Auto CAD二次开发——封装事务处理函数并绘制直线函数
  • C4D域力场重要概念之点对象、粒子对象和通道转换
  • 车载诊断架构 ---关于Service 29证书认证与整车时间同步的问题带来的深思
  • 做蛋糕需要建议网站不wordpress跳转移动端模板
  • html5培训网站模板兴国电商网站建设
  • 【JUnit实战3_13】第八章:mock 对象模拟技术在细粒度测试中的应用(上)
  • STM32项目分享:简易自动门设计