简单园区网拓扑实验

news/2024/12/29 5:56:25/

1.实验拓扑

2.实验要求

1、按照图示的VLAN及IP地址需求,完成相关配置
2、要求SW1为VLAN 2/3的主根及主网关
SW2为vlan 20/30的主根及主网关
SW1和SW2互为备份
3、可以使用super vlan
4、上层通过静态路由协议完成数据通信过程
5、AR1为企业出口路由器
6、要求全网可达

3.实验分析

1.对于接入层设备sw3以及sw4需要配置vlan以及在每个接口放通vlan,在0/0/1和0/0/2接口为access干道,在0/0/3和0/0/4接口为trunk干道需要放通所有vlan

2.配置IP:对于汇聚层设备,sw1和sw2分别为vlan2 3以及vlan20 30的网关所以需要采用vlanif接口进行配置使其具有三层功能

3.链路聚合:sw1和sw2中间的两条链路采用链路聚合技术,vlanif接口配ip

4.生成树协议:SW1为VLAN 2/3的主根及主网关,SW2为vlan 20/30的主根及主网关,所以这里需要采用mstp多生成树协议

5.上层链路通信使用rip协议,r1为企业路由器出口,r1以下的网络都为内网网络,做到全网可通此时需要采用nat技术

4.实验配置

(1)链路聚合

汇聚层设备sw1以及sw2之间需要链路聚合

[sw1]interface e	
[sw1]interface Eth-Trunk 0
[sw1-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw1-Eth-Trunk0]port link-type trunk 
[sw1-Eth-Trunk0]port trunk allow-pass vlan 2 3 20 30 101
[sw2]interface e	
[sw2]interface Eth-Trunk 0
[sw2-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw2-Eth-Trunk0]port link-type trunk 
[sw2-Eth-Trunk0]port trunk allow-pass vlan 2 3 20 30 101

(2)划分vlan以及配置接口

sw3

[sw3]vlan batch 2 3 20 30
[sw3]interface GigabitEthernet  0/0/1
[sw3]port link-type access
[sw3]port default vlan 2 
[sw3]interface GigabitEthernet  0/0/2
[sw3]port link-type access
[sw3]port default vlan 3
[sw3]interface GigabitEthernet  0/0/3
[sw3]port link-type trunk 
[sw3]port trunk allow-pass vlan 2 3 20 30
[sw3]interface GigabitEthernet  0/0/4
[sw3]port link-type trunk 
[sw3]port trunk allow-pass vlan 2 3 20 30

sw4

[sw4]vlan batch 2 3 20 30
[sw4]interface GigabitEthernet  0/0/1
[sw4]port link-type access
[sw4]port default vlan 20 
[sw4]interface GigabitEthernet  0/0/2
[sw4]port link-type access
[sw4]port default vlan 30
[sw4]interface GigabitEthernet  0/0/3
[sw4]port link-type trunk 
[sw4]port trunk allow-pass vlan 2 3 20 30
[sw4]interface GigabitEthernet  0/0/4
[sw4]port link-type trunk 
[sw4]port trunk allow-pass vlan 2 3 20 30

(3)vlanIF配置ip网关

sw1

[r1]vlan batch 2 3 20 30 101
[sw1]interface Vlanif 2
[sw1-Vlanif2]ip add 10.0.2.1 24
[sw1]int g0/0/3
[sw1-GigabitEthernet0/0/3]po li t
[sw1-GigabitEthernet0/0/3]po t al v 2 3 20 30
[sw1]interface Vlanif 101
[sw1-Vlanif101]ip add 10.0.0.9 30
[sw1]interface Vlanif 3
[sw1-Vlanif3]ip add 10.0.3.1 24
[sw1]int g0/0/4
[sw1-GigabitEthernet0/0/4]po li t
[sw1-GigabitEthernet0/0/4]po t al v 2 3 20 30

sw2

[sw2]vlan batch 2 3 20 30 101
[sw2]interface Vlanif 20
[sw2-Vlanif2]ip add 10.0.20.1 24
[sw2]int g0/0/3
[sw2-GigabitEthernet0/0/3]po li t
[sw2-GigabitEthernet0/0/3]po t al v 2 3 20 30
[sw2]interface Vlanif 101
[sw2-Vlanif101]ip add 10.0.0.10 30
[sw2]interface Vlanif 30
[sw2-Vlanif3]ip add 10.0.30.1 24
[sw2]int g0/0/4
[sw2-GigabitEthernet0/0/4]po li t
[sw2-GigabitEthernet0/0/4]po t al v 2 3 20 30

(4)生成树协议

[sw1]stp mode mstp
[sw1]stp enable 
[sw1]stp region-configuration 
[sw1-mst-region]region-name hcip 
[sw1-mst-region]instance 1 vlan 2 3 
[sw1-mst-region]instance 2 vlan 20 30
[sw1-mst-region]active region-configuration 
[sw1]stp instance 1 root primary
[sw1]stp instance 2 root secondary
[sw1]int g0/0/3
[sw1-GigabitEthernet0/0/3]stp root-protection
[sw1-GigabitEthernet0/0/4]stp root-protection
[sw1-GigabitEthernet0/0/4]int e 0
[sw1-Eth-Trunk0]stp root-protection
[sw2]stp mode mstp
[sw2]stp enable 
[sw2]stp region-configuration 
[sw2-mst-region]region-name hcip 
[sw2-mst-region]instance 1 vlan 2 3 
[sw2-mst-region]instance 2 vlan 20 30
[sw2-mst-region]active region-configuration 
[sw2]stp instance 2 root primary
[sw2]stp instance 1 root secondary
[sw2-GigabitEthernet0/0/3]int g0/0/3
[sw2-GigabitEthernet0/0/3]stp root-protection
[sw2-GigabitEthernet0/0/3]int g0/0/4
[sw2-GigabitEthernet0/0/4]stp root-protection
[sw2-GigabitEthernet0/0/4]int e 0
[sw2-Eth-Trunk0]stp root-protection
[sw3]stp mode mstp
[sw3]stp enable 
[sw3]stp region-configuration 
[sw3-mst-region]region-name hcip 
[sw3-mst-region]instance 1 vlan 2 3 
[sw3-mst-region]instance 2 vlan 20 30
[sw3-mst-region]active region-configuration 
[sw3]int g0/0/1
[sw3-GigabitEthernet0/0/1]stp edged-port enable 
[sw3-GigabitEthernet0/0/1]stp bpdu-filter enable 
[sw3-GigabitEthernet0/0/1]int g0/0/2
[sw3-GigabitEthernet0/0/2]stp edged-port enable 
[sw3-GigabitEthernet0/0/2]stp bpdu-filter enable 
[sw3]stp bpdu-protection
[sw4]stp mode mstp
[sw4]stp enable 
[sw4]stp region-configuration 
[sw4-mst-region]region-name hcip 
[sw4-mst-region]instance 1 vlan 2 3 
[sw4-mst-region]instance 2 vlan 20 30
[sw4-mst-region]active region-configuration 
[sw4]int g0/0/1
[sw4-GigabitEthernet0/0/1]stp edged-port enable 
[sw4-GigabitEthernet0/0/1]stp bpdu-filter enable 
[sw4-GigabitEthernet0/0/1]int g0/0/2
[sw4-GigabitEthernet0/0/2]stp edged-port enable 
[sw4-GigabitEthernet0/0/2]stp bpdu-filter enable 
[sw4]stp bpdu-protection

(5)VRRP

[sw1-Vlanif2]vrrp vrid 1 virtual-ip 10.0.2.254
[sw1-Vlanif2]vrrp vrid 1 priority 120
[sw1-Vlanif2]vrrp vrid 1 preempt-mode timer delay 20
[sw1-Vlanif2]vrrp vrid 1 track interface GigabitEthernet0/0/5
[sw1-Vlanif3]vrrp vrid 1 virtual-ip 10.0.3.254
[sw1-Vlanif3]vrrp vrid 1 priority 120
[sw1-Vlanif3]vrrp vrid 1 preempt-mode timer delay 20
[sw1-Vlanif3]vrrp vrid 1 track interface GigabitEthernet0/0/5
[sw1-Vlanif20]vrrp vrid 1 virtual-ip 10.0.20.254
[sw1-Vlanif30]vrrp vrid 1 virtual-ip 10.0.30.254
[sw2-Vlanif2]vrrp vrid 1 virtual-ip 10.0.2.254
[sw2-Vlanif3]vrrp vrid 1 virtual-ip 10.0.3.254
[sw2-Vlanif20]vrrp vrid 1 virtual-ip 10.0.20.254
[sw2-Vlanif20]vrrp vrid 1 priority 120
[sw2-Vlanif20]vrrp vrid 1 preempt-mode timer delay 20
[sw2-Vlanif20]vrrp vrid 1 track interface GigabitEthernet0/0/5
[sw2-Vlanif30]vrrp vrid 1 virtual-ip 10.0.30.254
[sw2-Vlanif30]vrrp vrid 1 priority 120
[sw2-Vlanif30]vrrp vrid 1 preempt-mode timer delay 20
[sw2-Vlanif30]vrrp vrid 1 track interface GigabitEthernet0/0/5

 

 

(6)配置上层网络

sw1

[sw1]vlan batch 99
[sw1]interface v	
[sw1]interface Vlanif 99
[sw1-Vlanif99]ip add 10.0.0.1 30 
[sw1]int g0/0/5
[sw1-GigabitEthernet0/0/5]po li a
[sw1-GigabitEthernet0/0/5]po de v 99
[sw1-GigabitEthernet0/0/4]int g0/0/4
[sw1-GigabitEthernet0/0/4]po li t
[sw1-GigabitEthernet0/0/4]po t al v 2 3 20 30
[sw1-GigabitEthernet0/0/4]int g0/0/3
[sw1-GigabitEthernet0/0/3]po li t
[sw1-GigabitEthernet0/0/3]po t al v 2 3 20 30

sw2

[sw2]vlan batch 100
[sw2]interface v	
[sw2]interface Vlanif 100
[sw2-Vlanif99]ip add 10.0.0.5 30 
[sw2]int g0/0/5
[sw2-GigabitEthernet0/0/5]po li a
[sw2-GigabitEthernet0/0/5]po de v 100
[sw2-GigabitEthernet0/0/4]int g0/0/4
[sw2-GigabitEthernet0/0/4]po li t
[sw2-GigabitEthernet0/0/4]po t al v 2 3 20 30
[sw2-GigabitEthernet0/0/4]int g0/0/3
[sw2-GigabitEthernet0/0/3]po li t
[sw2-GigabitEthernet0/0/3]po t al v 2 3 20 30

r1

[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 10.0.0.2 30
[r1-GigabitEthernet0/0/1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 10.0.0.6 30
[r1-GigabitEthernet0/0/2]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 202.1.1.1 30

ISP

[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 202.1.1.2 30
[ISP]int LoopBack 1
[ISP-LoopBack1]ip add 100.100.100.100 24

(7)rip协议

使上层网络能够通讯

sw1

[sw1]rip 1
[sw1-rip-1]vers	
[sw1-rip-1]version 2
[sw1-rip-1]network 10.0.0.0
[sw1]ip route-static 0.0.0.0 0 10.0.0.2

sw2

[sw2]rip 1
[sw2-rip-1]vers	
[sw2-rip-1]version 2
[sw2-rip-1]network 10.0.0.0
[sw2]ip route-static 0.0.0.0 0 10.0.0.6

r1

[r1]rip 1
[r1-rip-1]net	
[r1-rip-1]network 10.0.0.0
[r1-rip-1]network 202.1.1.0

验证 

 (8)NAT

使内网能够访问外网

r1

[r1]ip route-static 0.0.0.0 0 202.1.1.2
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 10.0.0.0 0.0.255.255
[r1-acl-basic-2000]int g0/0/0
[r1-GigabitEthernet0/0/0]nat outbound 2000

验证

5.实验结果验证 

 此时断开rw3的0/0/3接口

 此时pc1还能访问


http://www.ppmy.cn/news/1558993.html

相关文章

Zookeeper下面的conf目录下面的zoo.cfg

zoo.cfg 是 ZooKeeper 安装目录下 conf 目录中的一个核心配置文件。这个文件包含了启动和运行 ZooKeeper 服务所需的所有配置信息。 zoo.cfg 文件中的内容通常包括以下部分: tickTime:这是 ZooKeeper 中最小的时间单位(以毫秒为单位&#xf…

微信流量主挑战:用户破16!新增文档转换(新纪元3)

朋友们,报告好消息!我的小程序用户数量已经涨到16个了!没错,真没拉朋友圈亲戚好友来撑场子,全靠实力(和一点点运气)吸引了16位陌生小伙伴光临!这波进步,连我自己都感动了…

利用 deepin-IDE 的 AI 能力,我实现了文件加密扩展

经过多轮迭代,deepin 文件管理器(dde-file-manager)的扩展功能已经趋于稳定,看到越来越丰富的文管新功能,作为一名技术爱好者,也想自己动手写个插件扩展一下文管的功能。 我选择的开发工具是 deepin-IDE&a…

Word表格另起一页解决办法

Word表格另起一页解决办法 表格设置根据内容自动调整,取消指定高度第1步 第2步

socket编程(C++/Windows)

相关文章推荐&#xff1a; Socket 编程基础 面试官&#xff0c;不要再问我三次握手和四次挥手 TCP的三次握手与四次挥手 参考视频&#xff1a; https://www.bilibili.com/video/BV1aW4y1w7Ui/?spm_id_from333.337.search-card.all.click TCP通信流程 服务端 #include<…

【vue】圆环呼吸灯闪烁效果(模拟扭蛋机出口处灯光)

效果图先发&#xff1a; 页面部分&#xff1a; <div ref"round" class"round"><div class"light" ref"light"/><div class"box"></div></div>js部分(控制圆环生成&#xff09;; setRound…

高斯核函数(深入浅出)

目录 定义及数学形式主要特点应用示例小结 高斯核函数&#xff08;Gaussian Kernel&#xff09;&#xff0c;又称径向基核&#xff08;Radial Basis Function Kernel&#xff0c;RBF Kernel&#xff09;&#xff0c;是机器学习与模式识别中最常用的核函数之一。它通过在高维空间…

Centos7.9自动封禁IP

原创作者&#xff1a;运维工程师 谢晋 Centos7.9自动封禁IP Centos7.9自动封禁IP Centos7.9自动封禁IP 运维时&#xff0c;经常有业务系统会被攻击&#xff0c;重复的在尝试登陆系统账号密码&#xff1b;为了系统安全添加了个脚本来禁用5次密码错误的IP&#xff0c;脚本如下…