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

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

完成下图要求:

在这里插入图片描述

拓扑图:

在这里插入图片描述

配置命令:

由于交换机日志太多不便于复制,所以就复制命令。大概步骤如下:
第一步先分配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-configurationregion-name aainstance 2 vlan 2active region-configuration
#
drop-profile default
#
ip pool vlan1gateway-list 172.16.1.250network 172.16.1.0 mask 255.255.255.0
#
ip pool vlan2gateway-list 172.16.2.250network 172.16.2.0 mask 255.255.255.0
#
interface Vlanif1ip address 172.16.1.1 255.255.255.0vrrp vrid 1 virtual-ip 172.16.1.250vrrp vrid 1 priority 101dhcp select global
#
interface Vlanif2ip address 172.16.2.1 255.255.255.0vrrp vrid 2 virtual-ip 172.16.2.250vrrp vrid 2 priority 99dhcp select global
#
interface Vlanif100ip address 172.16.0.2 255.255.255.252
#
interface MEth0/0/1
#
interface Eth-Trunk0port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/1port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/3port link-type accessport default vlan 100
#
interface GigabitEthernet0/0/1eth-trunk 0
#
interface GigabitEthernet0/0/2eth-trunk 0
#
interface NULL0
#
ospf 1area 0.0.0.0network 172.16.1.0 0.0.0.255network 172.16.2.0 0.0.0.255network 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-configurationregion-name aainstance 2 vlan 2active region-configuration
#
ip pool vlan1gateway-list 172.16.1.250network 172.16.1.0 mask 255.255.255.0
#
ip pool vlan2gateway-list 172.16.2.250network 172.16.2.0 mask 255.255.255.0
#
interface Vlanif1ip address 172.16.1.2 255.255.255.0vrrp vrid 1 virtual-ip 172.16.1.250dhcp select global
#
interface Vlanif2ip address 172.16.2.2 255.255.255.0vrrp vrid 2 virtual-ip 172.16.2.250dhcp select global
#
interface Vlanif100ip address 172.16.0.6 255.255.255.252
#
interface Eth-Trunk0port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/1port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/3port link-type accessport default vlan 100
#
interface GigabitEthernet0/0/1eth-trunk 0
#
interface GigabitEthernet0/0/2eth-trunk 0
#
ospf 1area 0.0.0.0network 172.16.1.2 0.0.0.0network 172.16.2.2 0.0.0.0network 172.16.0.6 0.0.0.0

SW3:

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

SW4:

[SW4]disp current-configuration 
#
sysname SW4
#
vlan batch 2
#
stp region-configurationregion-name aainstance 2 vlan 2active region-configuration
#
interface Vlanif1
#
interface Ethernet0/0/1
#
interface Ethernet0/0/2port link-type accessport default vlan 2
#
interface Ethernet0/0/3port link-type trunkport trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/4port link-type trunkport 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/2nat 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.lryc.cn/news/133964.html

相关文章:

  • 正中优配:尾盘拉升的股票第二天的走势?
  • ios小组件报错:Please adopt containerBackground API
  • 基于AWS的3D模型搜索服务实现
  • pycharm远程连接docker容器
  • 开源全球地理空间数据可视化框架——Cesium学习(2023.8.21)
  • RT-Thread学习日记——点亮LED
  • 粘包问题(TCP面向字节流批量发送数据导致)
  • selenium Chrome驱动下载地址
  • Linux命令200例:tar命令主要用于创建、查看和提取归档文件(常用)
  • 【Django】Task4 序列化及其高级使用、ModelViewSet
  • FFMPEG RTMP流打开速度慢优化方法一
  • NextJs - Middleware(中间件)
  • 记录几个Hudi Flink使用问题及解决方法
  • Go:测试框架GoConvey 简介
  • JavaWeb-特殊文件(propertis与XML)
  • ffmpeg合并mp4视频文件
  • ATF BL1/BL2 ufs_read_blocks/ufs_write_blocks使用分析
  • Elasticsearch(十二)搜索---搜索匹配功能③--布尔查询及filter查询原理
  • 解决Windows下的docker desktop无法启动问题
  • LLM生成式 AI 项目生命周期Generative AI project lifecycle
  • java高并发系列 - 第13天:JUC中的Condition对象
  • 【TTY子系统】printf与printk深入驱动解析
  • 无涯教程-PHP - 全局变量函数
  • shell脚本之循环语句
  • 派森 #P122. 峰值查找
  • 基础网络详解4--HTTP CookieSession 思考
  • 14. 利用Canvas自制时钟组件
  • 微信小程序使用云存储和Markdown开发页面
  • 【C++】运算符重载 | 赋值运算符重载
  • Python学习 -- 类对象从创建到常用函数