园区网综合拓扑实验

一、实验要求

实验拓扑图如上图所示

1、按照图示的VLAN及IP地址需求,完成相关配置

2、要求SW1为VLAN 2/3的主根及主网关

SW2为vlan 20/30的主根及主网关

SW1和SW2互为备份

3、可以使用super vlan(本实验未使用)

4、上层通过静态路由协议完成数据通信过程

5、AR1为企业出口路由器

6、要求全网可达

二、实验思路

1、先从交换机下手,将与PC连接的交换机SW3、SW4的VLAN相关配置先配好,然后再配置交换机间相连的配置(SW1、SW2),然后配置三层交换机(交换机与路由器之间的链路配置)

2、在SW1和SW2间的链路配置链路聚合

3、在交换机网络中,配置STP协议,防止链路成环

4、设置交换机的主根和主网关,以及它们的备份

5、配置VRRP、配置路由器的接口ip地址、自己的环回接口、还有静态路由

6、R1为出口路由器,故要在其出口接口配置NAT

7、完善其余步骤达到全网可通

三、实验步骤

1.在LSW3上:

LSW3上需要添加VLAN、划分接口等操作

LSW3\]vlan batch 2 3 20 30 \[LSW3\]INT G0/0/1 \[LSW3-GigabitEthernet0/0/1\]port link-type access \[LSW3-GigabitEthernet0/0/1\]port default vlan 2 \[LSW3-GigabitEthernet0/0/1\]int g0/0/2 \[LSW3-GigabitEthernet0/0/2\]port link-type access \[LSW3-GigabitEthernet0/0/2\]port default vlan 3 **将LSW3的接口0/0/3和0/0/4配置成trunk,并开通VLAN 2 3 20 30** \[LSW3-GigabitEthernet0/0/2\]int g0/0/3 \[LSW3-GigabitEthernet0/0/3\]port link-type trunk \[LSW3-GigabitEthernet0/0/3\]port trunk allow-pass vlan 2 3 20 30 \[LSW3-GigabitEthernet0/0/3\]int g0/0/4 \[LSW3-GigabitEthernet0/0/4\]port link-type trunk \[LSW3-GigabitEthernet0/0/4\]port trunk allow-pass vlan 2 3 20 40 ![](https://i-blog.csdnimg.cn/direct/a558f271a1be457188ac0bcff8d234ee.png) ##### 启动mstp并配置相同的预配置region-configuration \[LSW3\]stp enable \[LSW3\]stp mode mstp \[LSW3\]stp region-configuration \[LSW3-mst-region\]region-name 3 \[LSW3-mst-region\]revision-level 100 \[LSW3-mst-region\]instance 1 vlan 2 to 3 \[LSW3-mst-region\]instance 2 vlan 20 30 \[LSW3-mst-region\]active region-configuration ![](https://i-blog.csdnimg.cn/direct/b2774d8162574304897ebdf87e9e8e0c.png) ### 2.在LSW4上: LSW4上需要添加VLAN、划分接口等操作 \[LSW4\]vlan batch 2 3 20 30 \[LSW4\]int g0/0/2 \[LSW4-GigabitEthernet0/0/2\]port link-type access \[LSW4-GigabitEthernet0/0/2\]port default vlan 30 \[LSW4\]int g0/0/1 \[LSW4-GigabitEthernet0/0/1\]port link-type access \[LSW4-GigabitEthernet0/0/1\]port default vlan 20 \[LSW4\]int g0/0/4 \[LSW4-GigabitEthernet0/0/4\]port link-type trunk \[LSW4-GigabitEthernet0/0/4\]port trunk allow-pass vlan 2 3 20 30 \[LSW4\]int g0/0/3 \[LSW4-GigabitEthernet0/0/3\]port link-type trunk \[LSW4-GigabitEthernet0/0/3\]port trunk allow-pass vlan 2 3 20 30 ![](https://i-blog.csdnimg.cn/direct/f708643cdc3d4f3e8ea946da2da2a95a.png) ![](https://i-blog.csdnimg.cn/direct/babed1f58c2a445ead0a9c56f1d6ccf4.png) **启动mstp并配置相同的预配置region-configuration** \[LSW4\]stp enable \[LSW4\]stp mode mstp \[LSW4\]stp region-configuration \[LSW4-mst-region\]region-name 3 \[LSW4-mst-region\]revision-level 100 \[LSW4-mst-region\]instance 1 vlan 2 to 3 \[LSW4-mst-region\]instance 2 vlan 20 30 \[LSW4-mst-region\]active region-configuration ![](https://i-blog.csdnimg.cn/direct/535db70f4cf644c2b6f70962f4490f9c.png) ### 3.在LSW1上: LSW1上需要添加VLAN、划分接口等操作 \[LSW1\]vlan batch 2 3 20 30 \[LSW1\]int g 0/0/3 \[LSW1-GigabitEthernet0/0/3\]port link-type trunk \[LSW1-GigabitEthernet0/0/3\]port trunk allow-pass vlan 2 3 20 30 \[LSW1\]int g0/0/4 \[LSW1-GigabitEthernet0/0/4\]port link-type trunk \[LSW1-GigabitEthernet0/0/4\]port trunk allow-pass vlan 2 3 20 30 \[LSW1\]int Eth-Trunk 0 \[LSW1-Eth-Trunk0\]trunkport GigabitEthernet 0/0/1 to 0/0/2 \[LSW1-Eth-Trunk0\]port link-type trunk \[LSW1-Eth-Trunk0\]port trunk allow-pass vlan 2 3 20 30 ![](https://i-blog.csdnimg.cn/direct/6110066480f645568c99e96740afe581.png) ![](https://i-blog.csdnimg.cn/direct/4d51662dcc5142f39bc41c3e797d2f6d.png) **启动mstp并配置相同的预配置region-configuration** ![](https://i-blog.csdnimg.cn/direct/1bba95311a214d2ca381be946e32e980.png) ### 4.在LSW2上: LSW2上需要添加VLAN、划分接口等操作 \[LSW2\]vlan batch 2 3 20 30 \[LSW2\]int g0/0/3 \[LSW2-GigabitEthernet0/0/3\]port link-type trunk \[LSW2-GigabitEthernet0/0/3\]port trunk allow-pass vlan 2 3 20 30 \[LSW2-GigabitEthernet0/0/3\]int g0/0/4 \[LSW2-GigabitEthernet0/0/4\]port link-type trunk \[LSW2-GigabitEthernet0/0/4\]port trunk allow-pass vlan 2 3 20 30 \[LSW2\]int Eth-Trunk 0 \[LSW2-Eth-Trunk0\]trunkport GigabitEthernet 0/0/1 to 0/0/2 \[LSW2-Eth-Trunk0\]port link-type trunk \[LSW2-Eth-Trunk0\]port trunk allow-pass vlan 2 3 20 30 ![](https://i-blog.csdnimg.cn/direct/845c92bd5c8f473d82efa18fb3c39336.png) ![](https://i-blog.csdnimg.cn/direct/fe1f96e77e1e4c91b6f796fb0a0398b0.png) **启动mstp并配置相同的预配置region-configuration** ![](https://i-blog.csdnimg.cn/direct/4f7c89c360ea467f82117d32fdecc9dc.png) ### 主根与备份 LSW1成为主根 \[LSW1\]stp instance 1 root primary ![](https://i-blog.csdnimg.cn/direct/3f1b880b69b9454d896d5dd710384b6f.png) LSW2成为备份 \[LSW2\]stp instance 2 root secondary ![](https://i-blog.csdnimg.cn/direct/2350bfdc29e8471f8ff9192b892e2890.png) ### 配置LSW1的VLANIF 2/3(主根)、VLANIF 20/30(备份根) 在交换机上分别设置IP,依次递增,例如LSW1为vlan2 10.0.2.1/24等,LSW2为10.0.2.2/24等 VLAN 2-----\>10.0.2.0/24 VLAN 3-----\>10.0.3.0/24 VLAN 20----\>10.0.20.0/24 VLAN 30----\>10.0.30.0/24 **1.创建VLANif** **LSW1(只修改IP地址,剩下的相同)** \[LSW1\]int Vlanif 2 \[LSW1-Vlanif2\]ip address 10.0.2.1 24 --设置IP地址 \[LSW1-Vlanif2\]vrrp vrid 1 virtual-ip 10.0.2.254 --配置VRRP \[LSW1-Vlanif2\]vrrp vrid 1 priority 120 --设置优先级 \[LSW1-Vlanif2\]vrrp vrid 1 preempt-mode timer delay 20 --设置延迟时间 \[LSW1-Vlanif2\]vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30 --设置上行链路监控 ![](https://i-blog.csdnimg.cn/direct/46c204f0ac404572af5b04a44b0a99a1.png) ![](https://i-blog.csdnimg.cn/direct/4734b78ba8534feca658900d6aeb2226.png) **LSW1是VLAN 20和30的备份根,所以要配置的很少,就ip地址和虚拟IP** **\[LSW1\]interface Vlanif 20** **\[LSW1-Vlanif20\]ip address 10.0.20.1 24** **\[LSW1-Vlanif20\]vrrp vrid 1 virtual-ip 10.0.20.254** **\[LSW1\]int Vlanif 30** **\[LSW1-Vlanif30\]ip address 10.0.30.1 24** **\[LSW1-Vlanif30\]vrrp vrid 1 virtual-ip 10.0.30.254** ![](https://i-blog.csdnimg.cn/direct/23745c226e844c899e85578a7f6903b0.png) 使用display命令查看配置 ![](https://i-blog.csdnimg.cn/direct/d1938ceae17c451bb76655753d2869b2.png) ### 在LSW1的接口0/0/5上配置三层交换机 因为要与路由器R1进行连接,所以要进行额外的VLAN 配置 \[LSW1\]vlan 11 \[LSW1-vlan11\]int g0/0/5 \[LSW1-GigabitEthernet0/0/5\]port link-type access \[LSW1-GigabitEthernet0/0/5\]port default vlan 11 \[LSW1\]int Vlanif 11 \[LSW1-Vlanif11\]ip address 10.0.0.1 30 ![](https://i-blog.csdnimg.cn/direct/b5b437e2e1f2439ab0ab11f4ca34476a.png) ### 配置LSW2的VLANIF 20/30(主根)、VLANIF 2/3(备份根) **因为LSW2是VLAN 2/3的备份根,配置少** \[LSW2\]int Vlanif 2 \[LSW2-Vlanif2\]ip address 10.0.2.2 24 \[LSW2-Vlanif2\]vrrp vrid 1 virtual-ip 10.0.2.254 \[LSW2\]int Vlanif 3 \[LSW2-Vlanif3\]ip address 10.0.3.2 24 \[LSW2-Vlanif3\]vrrp vrid 1 virtual-ip 10.0.3.254 **LSW2为VLAN 20/30的主根,所以要配置优先级、延迟时间和上行链路监控** \[LSW2\]int Vlanif 20 \[LSW2-Vlanif20\]ip address 10.0.20.2 24 \[LSW2-Vlanif20\]vrrp vrid 1 virtual-ip 10.0.20.254 \[LSW2-Vlanif20\]vrrp vrid 1 priority 120 \[LSW2-Vlanif20\]vrrp vrid 1 preempt-mode timer delay 20 \[LSW2-Vlanif20\]vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30 \[LSW2\]int Vlanif 30 \[LSW2-Vlanif30\]ip address 10.0.30.2 24 \[LSW2-Vlanif30\]vrrp vrid 1 virtual-ip 10.0.30.254 \[LSW2-Vlanif30\]vrrp vrid 1 priority 120 \[LSW2-Vlanif30\]vrrp vrid 1 preempt-mode timer delay 20 \[LSW2-Vlanif30\]vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30 ![](https://i-blog.csdnimg.cn/direct/856658876dc044c1a053a9169d5c33e0.png) ![](https://i-blog.csdnimg.cn/direct/deb3b1ba877e451e89fc4f83085d6486.png) ### 在LSW2的接口0/0/5上配置三层交换机 \[LSW2\]vlan 12 \[LSW2-vlan12\]int g0/0/5 \[LSW2-GigabitEthernet0/0/5\]port link-type access \[LSW2-GigabitEthernet0/0/5\]port default vlan 12 \[LSW2\]int Vlanif 12 \[LSW2-Vlanif12\]ip address 10.0.0.5 30 ![](https://i-blog.csdnimg.cn/direct/ca2a80ce53494e2ba9d03fa009ec48a4.png) ### 配置OSPF 需要宣告VLAN2,3,20,30,LSW1宣告11,LSW2宣告12 \[LSW1\]ospf 1 \[LSW1-ospf-1\]area 0 \[LSW1-ospf-1-area-0.0.0.0\]network 10.0.2.1 0.0.0.0 --VLAN2 \[LSW1-ospf-1-area-0.0.0.0\]network 10.0.3.1 0.0.0.0 --VLAN3 \[LSW1-ospf-1-area-0.0.0.0\]network 10.0.20.1 0.0.0.0 ---VLAN20 \[LSW1-ospf-1-area-0.0.0.0\]network 10.0.30.1 0.0.0.0 --VLAN30 \[LSW1-ospf-1-area-0.0.0.0\]network 10.0.0.1 0.0.0.0 ---VLAN11 ![](https://i-blog.csdnimg.cn/direct/c8a43a19ac454ef0853745d983a722df.png) **LSW2:** ![](https://i-blog.csdnimg.cn/direct/7e926c8f160448c781981d6141951423.png) ### 配置静默接口 \[LSW1\]ospf 1 \[LSW1-ospf-1\]silent-interface Vlanif 2 \[LSW1-ospf-1\]silent-interface Vlanif 3 \[LSW1-ospf-1\]silent-interface Vlanif 20 \[LSW1-ospf-1\]silent-interface Vlanif 30 ![](https://i-blog.csdnimg.cn/direct/fff6ef0a674e4c47a344c4d2b86078ea.png) **LSW2:** ![](https://i-blog.csdnimg.cn/direct/58ef4372e65446ff85e41a70fdc9f39b.png) ### 配置LSW1,2和R1的专属VLAN13,并宣告 ![](https://i-blog.csdnimg.cn/direct/0a015e36ce904c748822cdac9d5bfc80.png) ![](https://i-blog.csdnimg.cn/direct/d497cc0822d34ebe8e34c008ce9131d9.png) ### 在ISP上 ##### 配置ISP的接口IP及其环回接口IP ![](https://i-blog.csdnimg.cn/direct/8d5323a39532415fa53225057a46efe8.png) ![](https://i-blog.csdnimg.cn/direct/944889a9b209492ca4a53420e214ff4f.png) ## 在R1上 ### 配置r1的接口ip \[r1\]int g0/0/1 \[r1-GigabitEthernet0/0/1\]ip address 10.0.0.2 30 \[r1-GigabitEthernet0/0/0\]int g0/0/2 \[r1-GigabitEthernet0/0/2\]ip ad 10.0.0.6 30 \[r1\]int g0/0/0 \[r1-GigabitEthernet0/0/0\]ip ad 202.1.1.1 30 ![](https://i-blog.csdnimg.cn/direct/a4dda68c9e724f5aa6a03649c31d9fae.png) ### 配置r1的ospf \[AR1\]ospf 1 \[AR1-ospf-1\]area 0 \[AR1-ospf-1-area-0.0.0.0\]network 10.0.0.2 0.0.0.0 \[AR1-ospf-1-area-0.0.0.0\]network 10.0.0.6 0.0.0.0 ![](https://i-blog.csdnimg.cn/direct/e666348b84b04252b57303d254dc9123.png) ### 配置缺省路由通到外网ISP \[R1\]ip route-static 0.0.0.0 0 202.1.1.2 ![](https://i-blog.csdnimg.cn/direct/1ebf823c16004e26be5a46d276a4af9e.png) ### **还需配置ospf的default-route-advertise** \[R1\]ospf 1 \[R1-ospf-1\]default-route-advertise ![](https://i-blog.csdnimg.cn/direct/c8f0274b35ba40e78c5dd2e739c698ab.png) ### 配置NAT 与 测试全网连通性 \[R1\]acl 2000 \[R1-acl-basic-2000\]rule permit source 10.0.0.0 0.0.255.255 \[R1\]int g0/0/0 \[R1-GigabitEthernet0/0/0\]nat outbound 2000 ![](https://i-blog.csdnimg.cn/direct/043a7eb68dcb40dbb20ccb0e30fc852f.png) 配置完成后就可以连接了 ![](https://i-blog.csdnimg.cn/direct/e93375f21fe84f2283a3d0f3abf21261.png)

相关推荐
神经毒素2 小时前
WEB安全--文件上传漏洞--一句话木马的工作方式
网络·安全·web安全·文件上传漏洞
慵懒学者2 小时前
15 网络编程:三要素(IP地址、端口、协议)、UDP通信实现和TCP通信实现 (黑马Java视频笔记)
java·网络·笔记·tcp/ip·udp
itachi-uchiha3 小时前
关于UDP端口扫描概述
网络·网络协议·udp
liulilittle3 小时前
Linux 高级路由策略控制配置:两个不同路由子网间通信
linux·网络·智能路由器
RadNIkMan4 小时前
Python学习(二)操作列表
网络·python·学习
HX科技4 小时前
Debian系统_主板四个网口1个配置为WAN,3个配置为LAN
linux·运维·网络·debian
Json20113155 小时前
Swoole 的 Hyperf 框架和 Go 的 Gin 框架高并发原理以及技术实现对比分析
网络·php·gin·swoole
kfepiza6 小时前
Debian/Ubuntu的networking的`/etc/network/interfaces`配置文件,如何配置route路由
linux·网络·tcp/ip·ubuntu·debian·ip·tcp
go_to_hacker6 小时前
AI进行全自动渗透
网络·web安全·网络安全·渗透测试·代码审计
斯~内克7 小时前
鸿蒙网络通信全解析:从网络状态订阅到高效请求实践
网络·php·harmonyos