news 2026/6/26 16:22:26

第三次作业—二层综合实验

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
第三次作业—二层综合实验

实验要求:

1、内网IP地址使用172.16.0.0/16分配、

2、sWa和sw2之间互为备份

3、VRRP/STP/VLAN/Eth-trunk均使用

4、所有pc均通过oHcP获取IP地址

5、ISP只能配置IP地址GE 0/0/5GE0/0/5

6、所有电脑可以正常访问IsP路由器环回

一、搭建拓扑

二、配置设备

1、ar2

<Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sysname AR2 [AR2]int g0/0/0 [AR2-GigabitEthernet0/0/0]ip address 10.0.0.2 255.255.255.252 Jun 25 2026 11:30:51-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [AR2-GigabitEthernet0/0/0]undo shutdown Info: Interface GigabitEthernet0/0/0 is not shutdown. [AR2-GigabitEthernet0/0/0]q [AR2]int l0 [AR2-LoopBack0]ip address 2.2.2.2 255.255.255.255 [AR2-LoopBack0]q [AR2]ip route-static 172.16.0.0 255.255.0.0 10.0.0.1

2、ar1

<Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sysname r1 [r1]int g0/0/0 [r1-GigabitEthernet0/0/0]ip address 10.0.0.1 255.255.255.252 [r1-GigabitEthernet0/0/0]undo shutdown [r1-GigabitEthernet0/0/0]int g0/0/1 [r1-GigabitEthernet0/0/1]ip address 172.16.1.1 255.255.255.252 [r1-GigabitEthernet0/0/1]int g0/0/2 [r1-GigabitEthernet0/0/2]ip address 172.16.1.5 255.255.255.252 [r1-GigabitEthernet0/0/2]undo shutdown [r1-GigabitEthernet0/0/2]q [r1]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2 [r1]ospf 1 router-id 1.1.1.1 [r1-ospf-1]area 0.0.0.0 [r1-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.3 [r1-ospf-1-area-0.0.0.0]network 172.16.1.4 0.0.0.3 [r1-ospf-1-area-0.0.0.0]q [r1-ospf-1]default-route-advertise

3、LSW1

<SW1>sys Enter system view, return user view with Ctrl+Z. [SW1]interface Eth-Trunk1 [SW1-Eth-Trunk1]description TO_LSW2 [SW1-Eth-Trunk1] port link-type trunk [SW1-Eth-Trunk1]port trunk allow-pass vlan 2 3 [SW1-Eth-Trunk1]interface GigabitEthernet0/0/1 [SW1-GigabitEthernet0/0/1]eth-trunk 1 [SW1-GigabitEthernet0/0/1]int g0/0/2 [SW1-GigabitEthernet0/0/2]eth-trunk 1 [SW1-GigabitEthernet0/0/2]int g0/0/3 [SW1-GigabitEthernet0/0/3]eth-trunk 1 [SW1-GigabitEthernet0/0/3]int g0/0/5 [SW1-GigabitEthernet0/0/5]port link-type access [SW1]vlan 100 [SW1-vlan100]q [SW1]interface Vlanif 100 [SW1-Vlanif100]ip address 172.16.1.2 255.255.255.252 [SW1-Vlanif100]q [SW1]int g0/0/4 [SW1-GigabitEthernet0/0/4]port link-type trunk [SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3 [SW1-GigabitEthernet0/0/4]q [SW1]stp enable [SW1]stp mode mstp [SW1]stp region-configuration [SW1-mst-region]region-name NET [SW1-mst-region]q [SW1]stp region-configuration [SW1-mst-region]revision-level 1 [SW1-mst-region]instance 1 vlan 2 [SW1-mst-region]instance 2 vlan 3 [SW1-mst-region]active region-configuration [SW1-mst-region]q [SW1]stp instance 1 root primary [SW1]q <SW1>undo terminal monitor Info: Current terminal monitor is off. <SW1>sys Enter system view, return user view with Ctrl+Z. [SW1]stp instance 2 root secondary [SW1]interface Vlanif 2 [SW1-Vlanif2] ip address 172.16.2.1 255.255.255.0 [SW1-Vlanif2]vrrp vrid 1 virtual-ip 172.16.2.254 [SW1-Vlanif2]vrrp vrid 1 priority 120 [SW1-Vlanif2]vrrp vrid 1 preempt-mode timer delay 5 [SW1-Vlanif2]vrrp vrid 1 track interface GigabitEthernet0/0/5 reduced 30 [SW1-Vlanif2]dhcp select global Error: Please enable DHCP in the global view first. [SW1-Vlanif2]q [SW1]dhcp e [SW1]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done. [SW1]interface Vlanif 2 [SW1-Vlanif2]dhcp select global [SW1-Vlanif2]interface Vlanif 3 [SW1-Vlanif3]ip address 172.16.3.1 255.255.255.0 [SW1-Vlanif3]vrrp vrid 2 virtual-ip 172.16.3.254 [SW1-Vlanif3]vrrp vrid 2 priority 100 [SW1-Vlanif3]dhcp select global [SW1-Vlanif3]q [SW1]ip pool vlan2 Info:It's successful to create an IP address pool. [SW1-ip-pool-vlan2]gateway-list 172.16.2.254 [SW1-ip-pool-vlan2]network 172.16.2.0 mask 255.255.255.0 [SW1-ip-pool-vlan2]excluded-ip-address 172.16.2.254 Error:Only idle or expired IP address can be disabled. [SW1-ip-pool-vlan2]dns-list 8.8.8.8 [SW1-ip-pool-vlan2]q [SW1]ip pool vlan3 Info:It's successful to create an IP address pool. [SW1-ip-pool-vlan3]gateway-list 172.16.3.254 [SW1-ip-pool-vlan3]network 172.16.3.0 mask 255.255.255.0 [SW1-ip-pool-vlan3]excluded-ip-address 172.16.3.254 Error:Only idle or expired IP address can be disabled. [SW1-ip-pool-vlan3]dns-list 8.8.8.8 [SW1-ip-pool-vlan3]q [SW1]ospf 1 router-id 2.2.2.2 [SW1-ospf-1]area 0.0.0.0 [SW1-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.3 [SW1-ospf-1-area-0.0.0.0]network 172.16.2.0 0.0.0.255 [SW1-ospf-1-area-0.0.0.0]network 172.16.3.0 0.0.0.255 [SW1-ospf-1-area-0.0.0.0]q [SW1-ospf-1]q [SW1]

4、LSW2

The device is running! <Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sysn [Huawei]sysname sw2 [sw2]interface Eth-Trunk1 [sw2-Eth-Trunk1] Jun 25 2026 12:26:30-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25 .191.3.1 configurations have been changed. The current change number is 4, the c hange loop count is 0, and the maximum number of records is 4095. [sw2-Eth-Trunk1]q [sw2]q <sw2>undo t m Info: Current terminal monitor is off. <sw2>sys Enter system view, return user view with Ctrl+Z. [sw2]description TO_LSW1 ^ Error: Unrecognized command found at '^' position. [sw2]interface Eth-Trunk1 [sw2-Eth-Trunk1]description TO_LSW1 [sw2-Eth-Trunk1]port link-type trunk [sw2-Eth-Trunk1]port trunk allow-pass vlan 2 3 [sw2-Eth-Trunk1]interface GigabitEthernet0/0/1 [sw2-GigabitEthernet0/0/1]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment...done. [sw2-GigabitEthernet0/0/1]interface GigabitEthernet0/0/2 [sw2-GigabitEthernet0/0/2]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment...done. [sw2-GigabitEthernet0/0/2]interface GigabitEthernet0/0/3 [sw2-GigabitEthernet0/0/3]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment...done. [sw2-GigabitEthernet0/0/3]interface GigabitEthernet0/0/5 [sw2-GigabitEthernet0/0/5]port link-type access [sw2-GigabitEthernet0/0/5] port default vlan 200 Error: The VLAN does not exist. [sw2-GigabitEthernet0/0/5]q [sw2]vlan 200 [sw2-vlan200]q [sw2]int g0/0/5 [sw2-GigabitEthernet0/0/5]port default vlan 200 [sw2-GigabitEthernet0/0/5]interface Vlanif 200 [sw2-Vlanif200] ip address 172.16.1.6 255.255.255.252 [sw2-Vlanif200]interface GigabitEthernet0/0/4 [sw2-GigabitEthernet0/0/4] port link-type trunk [sw2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3 [sw2-GigabitEthernet0/0/4]q [sw2]stp e [sw2]stp edged-port ^ Error:Incomplete command found at '^' position. [sw2]stp edged-port [sw2]stp edged-port [sw2]stp ena [sw2]stp enable [sw2]stp mod [sw2]stp mode ms [sw2]stp mode mstp [sw2]stp region-configuration [sw2-mst-region]reg [sw2-mst-region]region-name NET [sw2-mst-region]rev [sw2-mst-region]revision-level 1 [sw2-mst-region]ins [sw2-mst-region]instance 1 v 2 [sw2-mst-region]ins [sw2-mst-region]instance 2 v 3 [sw2-mst-region]actl [sw2-mst-region]ac [sw2-mst-region]active [sw2-mst-region]active re [sw2-mst-region]active region-configuration Info: This operation may take a few seconds. Please wait for a moment...done. [sw2-mst-region]q [sw2]stp is [sw2]stp ins [sw2]stp instance 1 r [sw2]stp instance 1 root se [sw2]stp instance 1 root secondary [sw2]stp ins [sw2]stp instance 2 r [sw2]stp instance 2 root p [sw2]stp instance 2 root primary [sw2]int [sw2]interface v [sw2]interface Vlanif 2 Error: The VLAN does not exist. [sw2]q <sw2>sys Enter system view, return user view with Ctrl+Z. [sw2]vla [sw2]vlan b [sw2]vlan batch 2 3 200 Info: This operation may take a few seconds. Please wait for a moment...done. [sw2]int [sw2]interface v [sw2]interface Vlanif 2 [sw2-Vlanif2]ip address 172.16.2.2 255.255.255.0 [sw2-Vlanif2] vrrp vrid 1 virtual-ip 172.16.2.254 [sw2-Vlanif2]vrrp vrid 1 priority 100 [sw2-Vlanif2]dhcp select global Error: Please enable DHCP in the global view first. [sw2-Vlanif2]q [sw2]dhcp ^ Error:Incomplete command found at '^' position. [sw2]dhcp [sw2]dhcp-snooping [sw2]dhcp en [sw2]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done. [sw2]dhcp select global ^ Error: Unrecognized command found at '^' position. [sw2]int v [sw2]int Vlanif 2 [sw2-Vlanif2]dhcp select global [sw2-Vlanif2]q [sw2]ip rool vlan2 ^ Error: Unrecognized command found at '^' position. [sw2]ip pool vlan2 Info:It's successful to create an IP address pool. [sw2-ip-pool-vlan2]ga [sw2-ip-pool-vlan2]gateway-list 172.16.2.254 [sw2-ip-pool-vlan2]net [sw2-ip-pool-vlan2]network 172.16.2.0 mask 255.255.255.0 [sw2-ip-pool-vlan2]dns [sw2-ip-pool-vlan2]dns-list 8.8.8.8 [sw2-ip-pool-vlan2]q [sw2]ospf 1r [sw2]ospf 1 r [sw2]ospf 1 router-id 3.3.3.3 [sw2-ospf-1]ar [sw2-ospf-1]area 0.0.0.0 [sw2-ospf-1-area-0.0.0.0]ney [sw2-ospf-1-area-0.0.0.0]net [sw2-ospf-1-area-0.0.0.0]network 172.16.1.4 0.0.0.3 [sw2-ospf-1-area-0.0.0.0]network 172.16.2.0 0.0.0.255 [sw2-ospf-1-area-0.0.0.0]network 172.16.3.0 0.0.0.255 [sw2-ospf-1-area-0.0.0.0]q [sw2-ospf-1]q [sw2]q <sw2>save The current configuration will be written to the device. Are you sure to continue?[Y/N]y Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]: <sw2> <sw2>

LSW3

<Huawei> <Huawei>SYS Enter system view, return user view with Ctrl+Z. [Huawei]SYSn [Huawei]sysname sw3 [sw3] Jun 25 2026 12:37:54-08:00 sw3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25 .191.3.1 configurations have been changed. The current change number is 4, the c hange loop count is 0, and the maximum number of records is 4095.v ^ Error:Ambiguous command found at '^' position. [sw3] [sw3]q <sw3> Jun 25 2026 12:38:00-08:00 sw3 %%01PHY/1/PHY(l)[0]: GigabitEthernet0/0/4: cha nge status to downun Jun 25 2026 12:38:01-08:00 sw3 %%01PHY/1/PHY(l)[1]: GigabitEthernet0/0/4: cha nge status to up ^ Error:Ambiguous command found at '^' position. <sw3>undo t m Info: Current terminal monitor is off. <sw3>sys Enter system view, return user view with Ctrl+Z. [sw3]vl [sw3]vlan b 2 3 Info: This operation may take a few seconds. Please wait for a moment...done. [sw3]int g0/0/1 [sw3-GigabitEthernet0/0/1]description TO_LSW1 [sw3-GigabitEthernet0/0/1]port link-type trunk [sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3 [sw3-GigabitEthernet0/0/1]int g0/0/3 [sw3-GigabitEthernet0/0/3]description TO_PC1 [sw3-GigabitEthernet0/0/3]port link-type access [sw3-GigabitEthernet0/0/3]port default vlan 2 [sw3-GigabitEthernet0/0/3]stp edged-port enable [sw3-GigabitEthernet0/0/3]interface GigabitEthernet0/0/4 [sw3-GigabitEthernet0/0/4]description TO_PC2 [sw3-GigabitEthernet0/0/4] port link-type access [sw3-GigabitEthernet0/0/4]port default vlan 3 [sw3-GigabitEthernet0/0/4]stp edged-port enable [sw3-GigabitEthernet0/0/4]q [sw3]stp enable [sw3]stp mode mstp [sw3]stp region-configuration [sw3-mst-region]region-name NET [sw3-mst-region] revision-level 1 [sw3-mst-region] instance 1 vlan 2 [sw3-mst-region] instance 2 vlan 3 [sw3-mst-region] active region-configuration Info: This operation may take a few seconds. Please wait for a moment...done. [sw3-mst-region]q [sw3]q <sw3>sys Enter system view, return user view with Ctrl+Z. [sw3]sys [sw3]sysname LSW3

LSW4

<Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sys LSW4 [LSW4] Jun 25 2026 12:41:22-08:00 LSW4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2 5.191.3.1 configurations have been changed. The current change number is 4, the change loop count is 0, and the maximum number of records is 4095. [LSW4]quit <LSW4>undo t m Info: Current terminal monitor is off. <LSW4>int g0/0/1 ^ Error: Unrecognized command found at '^' position. <LSW4>sys Enter system view, return user view with Ctrl+Z. [LSW4]vlan b 2 3 Info: This operation may take a few seconds. Please wait for a moment...done. [LSW4]int g0/0/1 [LSW4-GigabitEthernet0/0/1]de [LSW4-GigabitEthernet0/0/1]des [LSW4-GigabitEthernet0/0/1]description to [LSW4-GigabitEthernet0/0/1]description to_LSW2 [LSW4-GigabitEthernet0/0/1]pr [LSW4-GigabitEthernet0/0/1]protocol-vlan [LSW4-GigabitEthernet0/0/1]port link-type trunk [LSW4-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 3 [LSW4-GigabitEthernet0/0/1]interface GigabitEthernet0/0/3 [LSW4-GigabitEthernet0/0/3]description TO_PC3 [LSW4-GigabitEthernet0/0/3] port link-type access [LSW4-GigabitEthernet0/0/3] port default vlan 2 [LSW4-GigabitEthernet0/0/3] stp edged-port enable [LSW4-GigabitEthernet0/0/3]interface GigabitEthernet0/0/4 [LSW4-GigabitEthernet0/0/4]description TO_PC4 [LSW4-GigabitEthernet0/0/4] port link-type access [LSW4-GigabitEthernet0/0/4] port default vlan 3 [LSW4-GigabitEthernet0/0/4] stp edged-port enable [LSW4-GigabitEthernet0/0/4]q [LSW4]stp en [LSW4]stp enable [LSW4]stp mode mstp [LSW4]stp region-configuration [LSW4-mst-region]region-name NET [LSW4-mst-region] revision-level 1 [LSW4-mst-region] instance 1 vlan 2 [LSW4-mst-region] instance 2 vlan 3 [LSW4-mst-region] active region-configuration Info: This operation may take a few seconds. Please wait for a moment...done. [LSW4-mst-region] [LSW4-mst-region] [LSW4-mst-region]q [LSW4]q <LSW4>save The current configuration will be written to the device. Are you sure to continue?[Y/N]y Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]: Now saving the current configuration to the slot 0. Save the configuration successfully. <LSW4> <LSW4>
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/26 16:18:21

技术解析:如何通过秒传脚本实现百度网盘文件的永久分享

技术解析&#xff1a;如何通过秒传脚本实现百度网盘文件的永久分享 【免费下载链接】rapid-upload-userscript-doc 秒传链接提取脚本 - 文档&教程 项目地址: https://gitcode.com/gh_mirrors/ra/rapid-upload-userscript-doc 在数字资源分享的日常实践中&#xff0c…

作者头像 李华
网站建设 2026/6/26 16:15:31

QueryExcel终极指南:5分钟掌握跨Excel文件批量查询的完整解决方案

QueryExcel终极指南&#xff1a;5分钟掌握跨Excel文件批量查询的完整解决方案 【免费下载链接】QueryExcel 多Excel文件内容查询工具。 项目地址: https://gitcode.com/gh_mirrors/qu/QueryExcel 你是否曾为在几十个Excel文件中寻找特定信息而烦恼&#xff1f;当财务数据…

作者头像 李华
网站建设 2026/6/26 16:12:09

社区版真能替代旗舰版吗?——反向压力测试报告:在Spring Cloud微服务+K8s本地调试+数据库反向工程场景下,社区版崩溃率高达63.8%

更多请点击&#xff1a; https://kaifayun.com 第一章&#xff1a;社区版真能替代旗舰版吗&#xff1f;——反向压力测试报告的核心结论 在为期六周的反向压力测试中&#xff0c;我们刻意将社区版置于旗舰版典型负载场景下运行&#xff1a;高并发API调用&#xff08;峰值 12,0…

作者头像 李华
网站建设 2026/6/26 16:12:01

chrome浏览器安装vue Devtools 要同时兼容vue2,vue3

chrome下源代码编译打包失败&#xff0c;搞半天&#xff0c;又通不外墙。建议调试看值&#xff0c;直接用火狐&#xff1a;可以国内网络直接按钮v6,v7&#xff0c;根据需要切换版本即可。现在调试vue2的项目&#xff0c;将v7禁用&#xff0c;打开v6,重启一下即可&#xff0c;在…

作者头像 李华
网站建设 2026/6/26 16:11:47

树莓派安全加固实战:从系统更新到入侵防御的完整指南

1. 树莓派安全加固&#xff1a;从基础到实战的运维安全指南如果你和我一样&#xff0c;把树莓派当作一个7x24小时运行的小型服务器&#xff0c;用来跑点家庭自动化、个人网盘或者开发测试环境&#xff0c;那你肯定也琢磨过一件事&#xff1a;这玩意儿就这么连着网&#xff0c;安…

作者头像 李华
网站建设 2026/6/26 16:08:30

网盘下载速度太慢?这款开源工具让你体验真正的宽带速度

网盘下载速度太慢&#xff1f;这款开源工具让你体验真正的宽带速度 【免费下载链接】Online-disk-direct-link-download-assistant 一个基于 JavaScript 的网盘文件下载地址获取工具。基于【网盘直链下载助手】修改 &#xff0c;支持 百度网盘 / 阿里云盘 / 中国移动云盘 / 天翼…

作者头像 李华