eNSP综合小实验:VRRP、MSTP、Eth-Trunk、NAT、DHCP等技术应用

news2024/9/25 3:24:25

完成下图要求:

在这里插入图片描述

拓扑图:

在这里插入图片描述

配置命令:

由于交换机日志太多不便于复制,所以就复制命令。大概步骤如下:
第一步先分配IP地址,在sw1和sw2上创建VLAN100用于e0/0/3口配IP,在sw1、sw2、sw3、sw4上创建VLAN2,在sw1、sw2上创建vlanif1和vlanif2。建树组2,将sw1设为VLAN1的root,VLAN2的备份,将sw2设为VLAN2的root,VLAN1的备份。搭ospf使全网通,在sw1和sw2上vrrp建邻,解决网关冗余。配置DHCP,在vlanif1和vlanif2下开启全局地址分配。在r1上做nat和ospf缺省路由。再写一条静态缺省指向ISP。结束!

SW1:

[SW1]disp current-configuration 
#
sysname SW1
#
vlan batch 2 100
#
stp instance 0 root primary
stp instance 2 root secondary
#
dhcp enable
#
stp region-configuration
 region-name aa
 instance 2 vlan 2
 active region-configuration
#
drop-profile default
#
ip pool vlan1
 gateway-list 172.16.1.250
 network 172.16.1.0 mask 255.255.255.0
#
ip pool vlan2
 gateway-list 172.16.2.250
 network 172.16.2.0 mask 255.255.255.0
#
interface Vlanif1
 ip address 172.16.1.1 255.255.255.0
 vrrp vrid 1 virtual-ip 172.16.1.250
 vrrp vrid 1 priority 101
 dhcp select global
#
interface Vlanif2
 ip address 172.16.2.1 255.255.255.0
 vrrp vrid 2 virtual-ip 172.16.2.250
 vrrp vrid 2 priority 99
 dhcp select global
#
interface Vlanif100
 ip address 172.16.0.2 255.255.255.252
#
interface MEth0/0/1
#
interface Eth-Trunk0
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 100
#
interface GigabitEthernet0/0/1
 eth-trunk 0
#
interface GigabitEthernet0/0/2
 eth-trunk 0
#
interface NULL0
#
ospf 1
 area 0.0.0.0
  network 172.16.1.0 0.0.0.255
  network 172.16.2.0 0.0.0.255
  network 172.16.0.2 0.0.0.0

SW2:

[SW2]disp current-configuration 
#
sysname SW2
#
vlan batch 2 100
#
stp instance 0 root secondary
stp instance 2 root primary
#
dhcp enable
#
stp region-configuration
 region-name aa
 instance 2 vlan 2
 active region-configuration
#
ip pool vlan1
 gateway-list 172.16.1.250
 network 172.16.1.0 mask 255.255.255.0
#
ip pool vlan2
 gateway-list 172.16.2.250
 network 172.16.2.0 mask 255.255.255.0
#
interface Vlanif1
 ip address 172.16.1.2 255.255.255.0
 vrrp vrid 1 virtual-ip 172.16.1.250
 dhcp select global
#
interface Vlanif2
 ip address 172.16.2.2 255.255.255.0
 vrrp vrid 2 virtual-ip 172.16.2.250
 dhcp select global
#
interface Vlanif100
 ip address 172.16.0.6 255.255.255.252
#
interface Eth-Trunk0
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/3
 port link-type access
 port default vlan 100
#
interface GigabitEthernet0/0/1
 eth-trunk 0
#
interface GigabitEthernet0/0/2
 eth-trunk 0
#
ospf 1
 area 0.0.0.0
  network 172.16.1.2 0.0.0.0
  network 172.16.2.2 0.0.0.0
  network 172.16.0.6 0.0.0.0

SW3:

[SW3]dis current-configuration 
#
sysname SW3
#
vlan batch 2
#
stp region-configuration
 region-name aa
 instance 2 vlan 2
 active region-configuration
#
interface Vlanif1
#
interface Ethernet0/0/1
 port link-type access
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 2
#
interface Ethernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

SW4:

[SW4]disp current-configuration 
#
sysname SW4
#
vlan batch 2
#
stp region-configuration
 region-name aa
 instance 2 vlan 2
 active region-configuration
#
interface Vlanif1
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 2
#
interface Ethernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

R1:

<Huawei>sys
[Huawei]sys r1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 172.16.0.1 30
[r1-GigabitEthernet0/0/0]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 172.16.0.5 30
[r1-GigabitEthernet0/0/1]int g 0/0/2
[r1-GigabitEthernet0/0/2]ip add 12.1.1.1 24

[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
[r1-ospf-1-area-0.0.0.0]network 12.1.1.1 0.0.0.0

[r1-ospf-1]default-route-advertise always 

acl number 2000  
 rule 5 permit source 172.16.0.0 0.0.255.255 

interface GigabitEthernet0/0/2
 nat outbound 2000

ISP:

<Huawei>sys
[Huawei]sys ISP
[ISP]int g 0/0/0
[ISP-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[ISP-GigabitEthernet0/0/0]int lo0
[ISP-LoopBack0]ip add 2.2.2.2 24

实验结果:

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

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

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

相关文章

分布式搜索引擎----elasticsearch

目录 1、初识elasticsearch 1.1、什么是elasticsearch 1.2.ELK技术栈 2、正向索引和倒排索引 2.1、正向索引 2.2、倒排索引 2.3、正向索引和倒排索引的区别 3、elasticsearch中的概念理解 3.1、文档和字段 3.2、索引和映射 3.3、mysql与elasticsearch 1、初识elasti…

快手大模型出炉【快意】来袭

「快意」大模型&#xff08;KwaiYii&#xff09; 是由快手AI团队从零到一独立自主研发的一系列大规模语言模型&#xff08;Large Language Model&#xff0c;LLM&#xff09;&#xff0c;当前包含了多种参数规模的模型&#xff0c;并覆盖了预训练模型&#xff08;KwaiYii-Base)…

10个比ChatGPT更值得体验的AI工具

打分依据&#xff1a;在制定比ChatGPT更酷的AI工具列表时&#xff0c;我们进行了广泛的研究&#xff0c;并考虑了各种因素&#xff0c;如性能、多功能性、创新性、用户友好度、集成契合度和行业影响及未来潜力等&#xff0c;根据这些指标仔细筛选和评估了一众AI工具&#xff0c…

(vue)多级表头且转为百分比显示

(vue)多级表头且转为百分比显示 <el-table-column align"center" label"近三个月数据情况"><el-table-column align"center" prop"amount" :label"tableLast[0]"><template slot-scope"{ row }"&g…

尚硅谷宋红康MySQL笔记 3-9

我不会记录的特别详细 大体框架 基本的Select语句运算符排序与分页多表查询单行函数聚合函数子查询 第三章 基本的SELECT语句 SQL分类 这个分类有很多种&#xff0c;大致了解下即可 DDL&#xff08;Data Definition Languages、数据定义语言&#xff09;&#xff0c;定义了…

SynchronousQueue阻塞与ArrayBlockingQueue设置容量为1阻塞的区别

SynchronousQueue阻塞的地方是在put进去一个元素即阻塞&#xff0c;没办法继续执行&#xff0c;除非其他线程take该队列的元素。 而ArrayBlockingQueue设置容量为1阻塞的地方是在下一次put&#xff0c;也就是说&#xff0c;put一个元素之后还能继续往下执行代码。 public clas…

leetcode359周赛

2828. 判别首字母缩略词 核心思想:枚举。只需要枚举首字母和s是否一一对应即可。 2829. k-avoiding 数组的最小总和 核心思想&#xff1a;自己的方法就是哈希表&#xff0c;枚举i的时候&#xff0c;将k-i统计起来&#xff0c;如果出现了那么就跳过。灵神的方法是数学法&#…

Python学习 -- 类对象从创建到常用函数

在Python编程中&#xff0c;类是一种强大的工具&#xff0c;用于创建具有共同属性和行为的对象。本篇博客将详细介绍Python中类和对象的创建&#xff0c;类的属性和方法&#xff0c;以及一些常用的类函数&#xff0c;通过丰富的代码例子来帮助读者深入理解。 一、类和对象的创…

Spring之IoC容器篇

目录 1.Spring简介 1.1Spring框架的核心特性 2.Spring IoC容器 2.1Spring IoC容器特点 2.2出现的背景 2.3关于IoC的理解 2.4案例演示 3.Spring注入方式 3.1set注入 3.2构造注入 3.3接口注入 4.Spring上下文与tomcat整合 4.1思考 4.2代码演示 4.3收获 1.Spring简介…

【内网监控】通过cpolar实现远程监控

【内网监控】通过cpolar实现远程监控 文章目录 【内网监控】通过cpolar实现远程监控前言1. 在cpolar官网预留一个空白隧道2. 完成空白数据隧道&#xff0c;生成地址3. 设置空白隧道的出口4. 空白数据隧道的出口设置5. 获取公网地址6. 打开本地电脑“远程桌面”7. 打开Windows自…

AMBA总线协议(4)——AHB(二)

目录 一、前言 二、AHB操作概述 三、AHB 基本传输 1、简单传输 2、带有等待的传输 3、多重传输 四、AHB传输类型 五、小结 一、前言 在之前的文章中对于AMBA AHB做了一个简单的介绍&#xff0c;AHB 主要用于高性能模块(如 CPU、DMA 和 DSP 等)之间的连接&#x…

【工具使用】Keil5软件使用-进阶调试篇

一、概述 本文面向已经懂得软件基本操作的职业老手&#xff0c;如果是未使用过该软件的小鲜肉&#xff0c;请移步基础篇。这里以STM32芯片为例对工具进行讲解&#xff0c;其他品牌的芯片在调试方面上可能存在差异。 二、软件说明 Keil提供了包括C编译器、宏汇编、链接器、库管…

内核日志过滤

本操作以centos为例。 1、不想把日志存入到 /var/log/messages中&#xff0c;转存到其他文件 >1.1、修改配置文件 /etc/rsyslog.conf vim /etc/rsyslog.conf# 添加以下代码if $programname kernel and ($msg contains hexdump or $msg contains shentong_data_file) then …

如祺出行递表,港交所迎来首位Robotaxi商业化观察对象

港交所近年来持续对新经济公司和科技创新类公司释放善意&#xff0c;接连优化上市条款&#xff0c;摆出“筑巢引凤”姿态。这也让外界对新兴领域的兴趣大大增加。 8月18日&#xff0c;出行科技与服务公司如祺出行正式递表港交所&#xff0c;其业务模式为Robotaxi和有人驾驶网约…

python AI绘图教程

前提 1.安装python 2.安装git 步骤 下载stable-diffusion-webui项目&#xff08;链接&#xff1a;GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI&#xff09; git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git 安装st…

git管理代码

理论上改代码前要pull一次&#xff0c;然后在push前在pull一次 改代码前pull一次是为了获取最新的同步&#xff0c;但是coding也是需要时间的&#xff0c;难保敲代码的这段时间没有人动远程仓库的东西&#xff0c;所以在改完代码要push的时候也应该再pull一下看有无冲突&#x…

《Zookeeper》源码分析(十七)之 LeaderZooKeeperServer

目录 LeaderZooKeeperServer类结构创建LeaderZooKeeperServer加载初始化数据loadData()启动LeaderZooKeeperServersetupRequestProcessors() LeaderZooKeeperServer 类结构 ZooKeeperServer主要是设置了一系列Processor处理器&#xff0c;对于不同的服务器角色有不同的实例类…

论文导读 | Operations Research近期文章精选

推文作者&#xff1a;张曦予 编者按 本期我们选取了七月后半月来自Operations Research的一篇文章以及来自Management Science的四篇文章以飨读者&#xff0c;内容涉及多个方面&#xff0c;我们选取的文章包含了各个方面对于管理以及运筹进行研究的文章&#xff0c;如研究疲劳对…

更新清华软件源时报错:Certificate verification failed: The certificate is NOT trusted.

场景&#xff1a; 在下载libapriltag-dev依赖时&#xff0c;Linux给报了一个错误&#xff1a;E: Unable to locate package libapriltag-dev 。这个错误经常会出现&#xff0c;无法在现有的软件源里找到该安装包或者该依赖&#xff0c;这个时候&#xff0c;首先我们就需要先检查…