【HCIP】企业网三层架构实验

news2024/9/22 5:22:53

题目:

 拓扑图

配置

 LSW1

//链路聚合

[lsw3]interface Eth-Trunk 1
[lsw3-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 0/0/4
[lsw3-Eth-Trunk1]q
[lsw3]vlan batch 1 2
[lsw3]interface Eth-Trunk 1
[lsw3-Eth-Trunk1]port link-type trunk 
[lsw3-Eth-Trunk1]port trunk allow-pass vlan 1 2
[lsw3-Eth-Trunk1]q
[lsw3]int g0/0/1
[lsw3-GigabitEthernet0/0/1]port link-type trunk
[lsw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 1 2
[lsw3-GigabitEthernet0/0/1]int g0/0/2
[lsw3-GigabitEthernet0/0/2]port link-type trunk
[lsw3-GigabitEthernet0/0/2]port trunk allow-pass vlan 1 2

//LSW1配置

[lsw1]vlan batch 1 2
[lsw1]int e0/0/3
[lsw1-Ethernet0/0/3]port link-type trunk
[lsw1-Ethernet0/0/3]port trunk allow-pass vlan 1 2
[lsw1-Ethernet0/0/3]int e0/0/4
[lsw1-Ethernet0/0/4]port link-type trunk
[lsw1-Ethernet0/0/4]port trunk allow-pass vlan 1 2
[lsw1-Ethernet0/0/4]int e0/0/1
[lsw1-Ethernet0/0/1]port link-type access  
[lsw1-Ethernet0/0/1]port default vlan 1
[lsw1-Ethernet0/0/1]int e0/0/2
[lsw1-Ethernet0/0/2]port link-type access 
[lsw1-Ethernet0/0/2]port default vlan 2

LSW2

//链路聚合

[lsw4]interface Eth-Trunk 1
[lsw4-Eth-Trunk1]trunkport GigabitEthernet 0/0/3 0/0/4
[lsw4-Eth-Trunk1]q
[lsw4]vlan batch 1 2
[lsw4]interface Eth-Trunk 1
[lsw4-Eth-Trunk1]port link-type trunk 
[lsw4-Eth-Trunk1]port trunk allow-pass vlan 1 2
[lsw4-Eth-Trunk1]q
[lsw4]int g0/0/1
[lsw4-GigabitEthernet0/0/1]port link-type trunk
[lsw4-GigabitEthernet0/0/1]port trunk allow-pass vlan 1 2
[lsw4-GigabitEthernet0/0/1]int g0/0/2
[lsw4-GigabitEthernet0/0/2]port link-type trunk
[lsw4-GigabitEthernet0/0/2]port trunk allow-pass vlan 1 2

//LSW2配置

[lsw2]vlan batch 1 2
[lsw2]int e0/0/3
[lsw2-Ethernet0/0/3]port link-type trunk
[lsw2-Ethernet0/0/3]port trunk allow-pass vlan 1 2
[lsw2-Ethernet0/0/3]int e0/0/4
[lsw2-Ethernet0/0/4]port link-type trunk
[lsw2-Ethernet0/0/4]port trunk allow-pass vlan 1 2
[lsw2-Ethernet0/0/4]int e0/0/1 
[lsw2-Ethernet0/0/1]port link-type access  
[lsw2-Ethernet0/0/1]port default vlan 1
[lsw2-Ethernet0/0/1]int e0/0/2
[lsw2-Ethernet0/0/2]port link-type access 
[lsw2-Ethernet0/0/2]port default vlan 2

所有access接口配置为边缘接口,并配置BPDU保护

LSW1

[lsw1]port-group group-member e0/0/1 e0/0/2
[lsw1-port-group]
[lsw1-port-group]stp edged-port enable 
[lsw1-Ethernet0/0/1]stp edged-port enable 
[lsw1-Ethernet0/0/2]stp edged-port enable 
[lsw1-Ethernet0/0/2]q
[lsw1]stp bpdu-protection .
//开启MSTP

[lsw1]stp mode mstp     
[lsw1]stp mode mstp 
[lsw1]stp region-configuration     
[lsw1]stp region-configuration 
[lsw1-mst-region]region-name HCIP
[lsw1-mst-region]revision-level 10    
[lsw1-mst-region]revision-level 10
[lsw1-mst-region]instance 1 vlan 1
[lsw1-mst-region]instance 2 vlan 2
[lsw1-mst-region]active region-configuration

LSW2

[lsw2]port-group group-member e0/0/1 e0/0/2
[lsw2-port-group]stp edged-port enable 
[lsw2-Ethernet0/0/1]stp edged-port enable 
[lsw2-Ethernet0/0/2]stp edged-port enable 
[lsw2-port-group]q
[lsw2]stp bpdu-protection 
//开启MSTP
[lsw2]stp mode mstp     
[lsw2]stp mode mstp 
[lsw2]stp region-configuration     
[lsw2]stp region-configuration 
[lsw2-mst-region]region-name HCIP
[lsw2-mst-region]revision-level 10    
[lsw2-mst-region]revision-level 10
[lsw2-mst-region]instance 1 vlan 1
[lsw2-mst-region]instance 2 vlan 2
[lsw2-mst-region]active region-configuration 

LSW3

//开启MSTP

[lsw3]stp mode mstp     
[lsw3]stp mode mstp 
[lsw3]stp region-configuration     
[lsw3]stp region-configuration 
[lsw3-mst-region]region-name HCIP
[lsw3-mst-region]revision-level 10    
[lsw3-mst-region]revision-level 10
[lsw3-mst-region]instance 1 vlan 1
[lsw3-mst-region]instance 2 vlan 2
[lsw3-mst-region]active region-configuration 
//配置主根和备份根

[lsw3]stp instance 0 root primary
[lsw3]stp instance 1 root primary 
[lsw3]stp instance 2 root secondary

//配置VRRP

[lsw3]interface Vlanif 1
[lsw3-Vlanif1]ip address 172.16.1.1 24
[lsw3-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.254
[lsw3-Vlanif1]vrrp vrid 1 priority 105
[lsw3-Vlanif1]q
[lsw3]interface Vlanif 2
[lsw3-Vlanif2]ip address 172.16.2.1 24
[lsw3-Vlanif2]vrrp vrid 1 virtual-ip 172.16.2.254

//配置DHCP,PC端自动获取IP地址

[lsw3]dhcp enable 
[lsw3]ip pool v1
[lsw3-ip-pool-v1]network 172.16.1.0 mask 24
[lsw3-ip-pool-v1]gateway-list 172.16.1.254
[lsw3-ip-pool-v1]q
[lsw3]ip pool v2           
[lsw3-ip-pool-v2]network 172.16.2.0 mask 24
[lsw3-ip-pool-v2]gateway-list 172.16.2.254
[lsw3-ip-pool-v2]q
[lsw3]interface Vlanif 1
[lsw3-Vlanif1]dhcp select global 
[lsw3]interface Vlanif 2
[lsw3-Vlanif2]dhcp select global

//配置OSPF

[lsw3]vlan 99
[lsw3]interface Vlanif 99
[lsw3-Vlanif99]ip address 172.16.0.1 30
[lsw3]interface g0/0/5 
[lsw3-GigabitEthernet0/0/1]port link-type access 
[lsw3-GigabitEthernet0/0/1]port default vlan 99

[lsw3]ospf 1 router-id 2.2.2.2
[lsw3-ospf-1]area 0
[lsw3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.0.255
[lsw3-ospf-1]area 1
[lsw3-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255

//沉默接口
[lsw3-ospf-1]silent-interface all
[lsw3-ospf-1]undo silent-interface GigabitEthernet 0/0/5    
[lsw3-ospf-1]undo silent-interface Eth-Trunk 1
[lsw3-ospf-1]undo silent-interface Vlanif 1
[lsw3-ospf-1]undo silent-interface Vlanif 99
 

LSW4

//开启MSTP

[lsw4]stp mode mstp     
[lsw4]stp mode mstp 
[lsw4]stp region-configuration     
[lsw4]stp region-configuration 
[lsw4-mst-region]region-name HCIP
[lsw4-mst-region]revision-level 10    
[lsw4-mst-region]revision-level 10
[lsw4-mst-region]instance 1 vlan 1
[lsw4-mst-region]instance 2 vlan 2
[lsw4-mst-region]active region-configuration 

//配置主根和备份根

[lsw4]stp instance 0 root secondary
[lsw4]stp instance 1 root secondary
[lsw4]stp instance 2 root primary

//配置VRRP

[lsw4]interface Vlanif 1
[lsw4-Vlanif1]ip address 172.16.1.2 24
[lsw4-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.254
[lsw4-Vlanif1]q
[lsw4]interface Vlanif 2
[lsw4-Vlanif2]ip address 172.16.2.2 24
[lsw4-Vlanif2]vrrp vrid 1 virtual-ip 172.16.2.254
[lsw4-Vlanif2]vrrp vrid 1 priority 105

//配置DHCP,PC端自动获取IP地址

[lsw4]dhcp enable 
[lsw4]ip pool v1
[lsw4-ip-pool-v1]network 172.16.1.0 mask 24
[lsw4-ip-pool-v1]gateway-list 172.16.1.254
[lsw4-ip-pool-v1]q
[lsw4]ip pool v2           
[lsw4-ip-pool-v2]network 172.16.2.0 mask 24
[lsw4-ip-pool-v2]gateway-list 172.16.2.254
[lsw4-ip-pool-v2]q
[lsw4]interface Vlanif 1
[lsw4-Vlanif1]dhcp select global 
[lsw4]interface Vlanif 2
[lsw4-Vlanif2]dhcp select global

//配置OSPF

[lsw4]vlan 99
[lsw4]interface Vlanif 99
[lsw4-Vlanif99]ip address 172.16.0.5 30
[lsw4]interface g0/0/5 
[lsw4-GigabitEthernet0/0/1]port link-type access 
[lsw4-GigabitEthernet0/0/1]port default vlan 99

[lsw4]ospf 1 router-id 3.3.3.3
[lsw4-ospf-1]area 0
[lsw4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.0.255
[lsw4-ospf-1]area 1
[lsw4-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255

//沉默接口
[lsw4-ospf-1]silent-interface all
[lsw4-ospf-1]undo silent-interface GigabitEthernet 0/0/5    
[lsw4-ospf-1]undo silent-interface Eth-Trunk 1
[lsw4-ospf-1]undo silent-interface Vlanif 1
[lsw4-ospf-1]undo silent-interface Vlanif 99

R1和R2基础配置

R1

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 172.16.0.2 30
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 172.16.0.6 30
[r1-GigabitEthernet0/0/1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 10.1.1.1 24

//配置OSPF

[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.0.255

//缺省NAT

[r1]ip route-static 0.0.0.0 0 10.1.1.2
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]default-route-advertise
[r1-ospf-1]q
[r1]acl 2000
[r1-acl-basic-2000]rule 1 permit source any 
[r1]int g0/0/2
[r1-GigabitEthernet0/0/0]nat outbound 2000

R2

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 10.1.1.2 24
[r2-GigabitEthernet0/0/0]q
[r2]int LoopBack 0
[r2-LoopBack0]ip add 2.2.2.2 24

检验

PC1自动获取IP地址,且可以ping通2.2.2.2

PC2自动获取IP地址,且可以ping通2.2.2.2

PC3自动获取IP地址,且可以ping通2.2.2.2

PC4自动获取IP地址,且可以ping通2.2.2.2

 停止LSW3运行

 

 PC1依旧能ping通

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/909173.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

docker中bridge、host、container、none四种网络模式简介

一.bridge模式 1.简介 2.演示 (1)运行两个容器,不指定网络模式情况下默认是bridge模式 (2)在主机中自动生成了两个veth设备 (3)查看两个容器的IP地址 (4)可以自定义…

基于图卷积网络的知识嵌入8.21

基于图卷积网络的知识嵌入 摘要介绍 摘要 近年来,围绕图卷积网络(GCN)这一主题出现了大量的文献。如何有效地利用复杂图中丰富的结构信息(例如具有heterogeneous types of entities and relations(异构实体和关系类型) 的知识图谱…

深入理解ForkJoin

任务类型 线程池执行的任务可以分为两种:CPU密集型任务和IO密集型任务。在实际的业务场景中,我们需要根据任务的类型来选择对应的策略,最终达到充分并合理地使用CPU和内存等资源,最大限度地提高程序性能的目的。 CPU密集型任务 …

【快速解决方案】浏览器的安全策略不允许通过 file:// 协议直接加载外部文件(最省事的方法)

目录 问题摘要 解决办法 检验结果 问题摘要 Failed to load resource: net::ERR_FILE_NOT_FOUND🌈 Cute Code Editor 🌈.html:162 Fetch API cannot load file:///D:/%E6%A1%8C%E9%9D%A2/%E4%B8%83%E5%A4%95%E5%BF%AB%E4%B9%90/index.txt. URL scheme …

RK3399平台开发系列讲解(内核调试篇)内核中内存泄漏的调试

🚀返回专栏总目录 文章目录 一、Linux 内核内存泄漏二、如何观测内核内存泄漏?三、kmemleak 工具沉淀、分享、成长,让自己和他人都能有所收获!😄 📢 内核内存泄漏往往都会是很严重的问题,那么,我们该如何判断内存泄漏是否是内核导致的呢? 一、Linux 内核内存泄漏 …

003-Nacos 2.1.x 注册实例源码分析

目录 Nacos 2.1.X注册实例入口接口流程Client 注册 事件处理 服务订阅入口 Nacos 2.1.X 注册实例 入口 com.alibaba.nacos.naming.remote.rpc.handler.InstanceRequestHandler#handleService service Service.newService(request.getNamespace(), request.getGroupName(), r…

计算机网络————IP数据报的首部各字段详解(很重要)

目录 1. IP数据报的介绍2. 首部的固定部分的各字段说明2.1 Version(版本)2.2 IHL(首部长度)2.3 Type of service(区分服务)2.4 Total Length(总长度)2.5 Identification(…

企业级即时通讯协作和移动应用管理平台哪个品牌好?

在竞争激烈的商业环境下,高效的企业通讯和协作变得至关重要。WorkPlus作为领先的品牌,专注于提供企业级即时通讯协作和移动应用管理平台。本文将介绍WorkPlus如何成为企业实现协同工作、高效沟通和流程管理的理想解决方案。 一、全面协作加速工作流程&am…

二、1.保护模式

访问外部硬件有两个方式: 将某个外设的内存映射到一定范围的地址空间中, CPU 通过地址总线访问该内存区域时会落到外设 的内存中,这种映射让 CPU 访问外设的内存就如同访问主板上的物理内存一样外设是通过 IO 接口与 CPU 通信的,…

BDA初级分析——民宿投资决策影响因素分析

实战作业: 民宿投资决策影响因素分析如今,出门旅行住民宿已经不是一个新鲜话题,而且民宿品牌也是层出不穷.作为一名旅行服务业的数据分析师,我们以Airbnb北京的民宿为例,对其进行数据分析,探索什么类型的民宿价格更高?…

Eltima USB Network Gate 10.0 Crack

USB Network Gate -通过网络共享USB 设备 USB Network Gate (前身为以太网USB控制器USB) 轻松的通过网络(Internet/LAN/WAN)分享您的一个或者多个连接到您计算机的USB设备。 无论您身处异国还是近在隔壁办公室,您都可以轻松使用远程扫描仪、打印机、摄像头、调制解…

从零构建深度学习推理框架-9 再探Tensor类,算子输入输出的分配

再探Tensor类&#xff1a; 第二节中我们编写的Tensor类其实并不能满足我们的使用需要&#xff0c;我们将在这一节以代码阅读的方式来看看一个完全版本的Tensor应该具备怎样的要素&#xff0c;同时我们对Tensor类的分析来看看在C中一个设计好的类应该是怎么样的。 Tensor<fl…

K8s学习笔记3

Kubernetes功能&#xff1a; Kubernetes是一个轻便的可扩展的开源平台&#xff0c;用于管理容器化应用和服务。通过Kubernetes能够进行应用的自动化部署和扩缩容。在Kubernetes中&#xff0c;会将组成应用的容器组合成一个逻辑单元以更易管理和发现。Kubernetes积累了作为Goog…

打怪升级之从零开始的网络协议

序言 三个多月过去了&#xff0c;我又来写博客了&#xff0c;这一次从零开始学习网络协议。 总的来说&#xff0c;计算机网络很像现实生活中的快递网络&#xff0c;其最核心的目标&#xff0c;就是把一个包裹&#xff08;信息&#xff09;从A点发送到B点去。下面是一些共同的…

面试-快速学习计算机网络-UDP/TCP

1. OSI四层和七层映射 区别&#xff1a; 应用层&#xff0c;表示层&#xff0c;会话层合并为了应用层数据链路层和物理层合并为了网络接口层 2. TCP和UDP的区别&#xff1f; 总结&#xff1a; 1 . TCP 向上层提供面向连接的可靠服务 &#xff0c;UDP 向上层提供无连接不可靠服…

验证二叉搜索树

给你一个二叉树的根节点 root &#xff0c;判断其是否是一个有效的二叉搜索树。 有效 二叉搜索树定义如下&#xff1a; 节点的左子树只包含 小于 当前节点的数。节点的右子树只包含 大于 当前节点的数。 所有左子树和右子树自身必须也是二叉搜索树。 示例 1&#xff1a; 输…

8.21summary

计划部分完成&#xff0c;复习暂未完成

Linux环境下交叉编译环境安装、编译和运行

Win11主机上安装虚拟机&#xff0c;虚拟机内运行Ubuntu20.04&#xff0c;为了能够在本地电脑&#xff08;Win11&#xff09;上开发测试软件和算法&#xff0c;最终将编译好的可执行文件拷贝到Linux板上&#xff08;Rk3288上运行linux系统&#xff09;运行&#xff0c;因此需要安…

【QML】鼠标放在控件上颜色改变的效果实现

最近刚好要用到一个功能&#xff0c;在qml上实现鼠标放上去&#xff0c;控件的颜色改变&#xff0c;鼠标移走&#xff0c;控件颜色恢复。第一反应是这个功能非常简单&#xff0c;但是搞了一会儿都没实现&#xff0c;最后发现MouseArea其实提供了一个很简便的方法来提供使用&…

马蹄集 第九次oj赛

目录 MT2188单条件和 8421码 余3码 永恒之2 新十六进制 人脑计算机 二进制&#xff1f;不同&#xff01; 三进制计算机1 三进制计算机2 excel的烦恼 MT2188单条件和 号难度&#xff1a;黄金© 时间限制&#xff1a;1秒 巴占用内存&#xff1a;128M ★收藏△报错 “单…