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

hcip二层综合实验

1、内网IP地址使用172.16.0.0/16分配
2、sW1和sw2之间互为备份
3、VRRP/STP/VLAN/Eth-trunk均使用
4、所有pc均通过oHcP获取IP地址
5、ISP只能配置IP地址
6、所有电脑可以正常访问IsP路由器环回

注:以下并非ensp内容,原实验配置较为混乱,补全错误,由AI做整理。

SW1

system-view sysname sw1 vlan batch 2 3 10 20 interface Eth-Trunk 0 trunkport GigabitEthernet 0/0/1 to 0/0/2 port link-type trunk port trunk allow-pass vlan 2 3 10 20 quit port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4 port link-type trunk port trunk allow-pass vlan 2 3 quit interface GigabitEthernet 0/0/5 port link-type access port default vlan 10 quit stp enable stp mode mstp stp region-configuration region-name aa instance 1 vlan 2 instance 2 vlan 3 active region-configuration quit stp instance 1 root primary interface Vlanif 2 ip address 172.16.0.1 255.255.255.192 vrrp vrid 1 virtual-ip 172.16.0.62 vrrp vrid 1 priority 120 vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30 quit interface Vlanif 3 ip address 172.16.0.65 255.255.255.192 vrrp vrid 2 virtual-ip 172.16.0.126 quit dhcp enable ip pool aa network 172.16.0.0 mask 255.255.255.192 gateway-list 172.16.0.62 dns-list 8.8.8.8 quit ip pool bb network 172.16.0.64 mask 255.255.255.192 gateway-list 172.16.0.126 dns-list 8.8.8.8 quit interface Vlanif 2 dhcp select global quit interface Vlanif 3 dhcp select global quit interface Vlanif 10 ip address 172.16.0.129 255.255.255.192 quit ip route-static 0.0.0.0 0.0.0.0 172.16.0.130 return

SW2

system-view sysname sw2 vlan batch 2 3 10 20 interface Eth-Trunk 0 trunkport GigabitEthernet 0/0/1 to 0/0/2 port link-type trunk port trunk allow-pass vlan 2 3 10 20 quit port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4 port link-type trunk port trunk allow-pass vlan 2 3 quit interface GigabitEthernet 0/0/5 port link-type access port default vlan 20 quit stp enable stp mode mstp stp region-configuration region-name aa instance 1 vlan 2 instance 2 vlan 3 active region-configuration quit stp instance 1 root secondary stp instance 2 root primary interface Vlanif 2 ip address 172.16.0.2 255.255.255.192 vrrp vrid 1 virtual-ip 172.16.0.62 quit interface Vlanif 3 ip address 172.16.0.66 255.255.255.192 vrrp vrid 2 virtual-ip 172.16.0.126 vrrp vrid 2 priority 120 vrrp vrid 2 track interface GigabitEthernet 0/0/5 reduced 30 quit dhcp enable ip pool aa network 172.16.0.0 mask 255.255.255.192 gateway-list 172.16.0.62 dns-list 8.8.8.8 quit ip pool bb network 172.16.0.64 mask 255.255.255.192 gateway-list 172.16.0.126 dns-list 8.8.8.8 quit interface Vlanif 2 dhcp select global quit interface Vlanif 3 dhcp select global quit interface Vlanif 20 ip address 172.16.0.193 255.255.255.192 quit ip route-static 0.0.0.0 0.0.0.0 172.16.0.194 return

SW3

system-view sysname sw3 vlan batch 2 3 interface GigabitEthernet 0/0/3 port link-type access port default vlan 2 quit interface GigabitEthernet 0/0/4 port link-type access port default vlan 3 quit port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2 port link-type trunk port trunk allow-pass vlan 2 3 quit stp enable stp mode mstp stp region-configuration region-name aa instance 1 vlan 2 instance 2 vlan 3 active region-configuration quit port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4 stp edged-port enable quit stp bpdu-protection return

SW4

system-view sysname sw4 vlan batch 2 3 interface GigabitEthernet 0/0/3 port link-type access port default vlan 2 quit interface GigabitEthernet 0/0/4 port link-type access port default vlan 3 quit port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2 port link-type trunk port trunk allow-pass vlan 2 3 quit stp enable stp mode mstp stp region-configuration region-name aa instance 1 vlan 2 instance 2 vlan 3 active region-configuration quit port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4 stp edged-port enable quit stp bpdu-protection return

R1

system-view sysname r1 interface GigabitEthernet 0/0/1 ip address 172.16.0.130 255.255.255.192 quit interface GigabitEthernet 0/0/0 ip address 172.16.0.194 255.255.255.192 quit interface GigabitEthernet 0/0/2 ip address 12.0.0.1 255.255.255.0 quit ip route-static 172.16.0.0 255.255.255.192 172.16.0.129 ip route-static 172.16.0.0 255.255.255.192 172.16.0.193 ip route-static 172.16.0.64 255.255.255.192 172.16.0.193 ip route-static 172.16.0.64 255.255.255.192 172.16.0.129 ip route-static 0.0.0.0 0.0.0.0 12.0.0.2 acl 2000 rule permit source 172.16.0.0 0.0.255.255 quit interface GigabitEthernet 0/0/2 nat outbound 2000 quit return

ISP

测试

http://www.jsqmd.com/news/1075204/

相关文章:

  • LinkSwift终极指南:如何优雅获取九大网盘直链下载地址
  • Ghostty + Fish + Starship + fzf + zoxide + Raycast
  • UEditor远程文件抓取漏洞解析:从原理到修复的Web安全实战
  • 赛博朋克2077存档编辑器:彻底掌控夜之城的终极工具
  • AI领域每日资讯报告(2026年6月24日)
  • AI科研画图
  • Mac上使用VScode优雅开发STM32
  • LED光学测量对产品的品质重要性
  • TFRecord写入最佳实践:从数据序列化到生产级稳定性
  • CountDownLatch
  • Kubernetes RBAC 实战指南
  • Cloudflare 发起回源连接断开,连不上 443 端口的原因
  • 终极窗口调整指南:如何用WindowResizer轻松掌控任意窗口尺寸
  • 香港国际资源型EMBA实测解析与2026选型指南
  • 卡美德生物科普Noggin(诺金蛋白):解析发育与修复的核心调控机制
  • 2026降AI率工具红黑榜:降AI率网站怎么选?这份榜单够用!
  • 【C 语言项目实战】基于链表与文件操作的标准化彩票管理系统设计与实现
  • 从C到C++:从结构体到类,面向对象初体验
  • AI+BI行业趋势:为什么给BI加个对话框,不等于真正实现了AI化
  • 适合新手的AI作曲工具推荐,零基础也能轻松生成原创旋律
  • 感知算法工程师最值钱的能力:处理异常场景
  • 为什么 React 和 Vue 不一样?
  • SQL注入漏洞实战:从原理到停车场系统漏洞挖掘与修复
  • 【操作系统】进程控制块PCB与上下文切换
  • 大模型微调缺数据?合成数据实战指南
  • FlyOOBE:为老旧硬件开启Windows 11升级新纪元的技术伙伴
  • UVa 599 The Forrest for the Trees
  • Strix Halo 内存带宽测试,大模型推理速度瓶颈分析
  • 1000 tokens/s 到底有多快?我用 8 次 API 请求,测了 4 款国产大模型
  • ICLR 2026 Oral 用 RL 训 Embedder 而非 LLM:Q-RAG 把多步检索成本砍到几乎免费