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

交换综合实验

目录

一、实验拓扑

二、实验要求

三、实验步骤

1、链路聚合(配置Eth-trunk)

2、配置vlan(创建划分vlan,配置trunk干道)

3、MSTP配置

4、VRRP配置

5、DHCP配置

6、vlan互通

7、NAT配置(做ACL,内网访问公网)


一、实验拓扑

二、实验要求

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

2、sw1和sW2之间互为备份

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

4、所有PC均通过DHCP获取IP地址

5、ISP只能配置IP地址

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

三、实验步骤

1、链路聚合(配置Eth-trunk)

[SW1]interface Eth-Trunk 0
[SW1-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 0/0/2
[SW2]interface Eth-Trunk 0
[SW2-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 0/0/2

2、配置vlan(创建划分vlan,配置trunk干道)

[SW1]vlan batch 2 to 3
[SW1]int Eth-Trunk 0
[SW1-Eth-Trunk0]port link-type trunk 
[SW1-Eth-Trunk0]port trunk allow-pass vlan 2 3
[SW1-GigabitEthernet0/0/3]port link-type trunk 
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[SW1-GigabitEthernet0/0/4]port link-type trunk 
[SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3

[SW2]vlan batch 2 3
[SW2]port-group group-member g0/0/4 g0/0/3 Eth-Trunk 0
[SW2-port-group]port link-type trunk
[SW2-port-group]port trunk allow-pass vlan 2 3

[SW3]vlan batch 2 3
[SW3-GigabitEthernet0/0/1]p l a
[SW3-GigabitEthernet0/0/1]p d v 2
[SW3-GigabitEthernet0/0/2]p l a
[SW3-GigabitEthernet0/0/2]p d v 3
[SW3-GigabitEthernet0/0/3]p l t
[SW3-GigabitEthernet0/0/3]p t a v 2 3
[SW3-GigabitEthernet0/0/4]p l t
[SW3-GigabitEthernet0/0/4]p t a v 2 3

[SW4]vlan batch 2 3
[SW4-GigabitEthernet0/0/1]p l a
[SW4-GigabitEthernet0/0/1]p d v 2
[SW4-GigabitEthernet0/0/2]p l a
[SW4-GigabitEthernet0/0/2]p d v 3
[SW4-GigabitEthernet0/0/3]p l t
[SW4-GigabitEthernet0/0/3]p t a v 2 3
[SW4-GigabitEthernet0/0/4]p l t
[SW4-GigabitEthernet0/0/4]p t a v 2 3

3、MSTP配置

[SW1]stp region-configuration 
[SW1-mst-region]region-name aa
[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 

[SW2]stp region-configuration 
[SW2-mst-region]region-name aa
[SW2-mst-region] revision-level 1
[SW2-mst-region] instance 1 vlan 2
[SW2-mst-region] instance 2 vlan 3
[SW2-mst-region] active region-configuration

[SW3]stp region-configuration 
[SW3-mst-region]region-name aa
[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

[SW4]stp region-configuration 
[SW4-mst-region]region-name aa
[SW4-mst-region] revision-level 1
[SW4-mst-region] instance 1 vlan 2
[SW4-mst-region] instance 2 vlan 3
[SW4-mst-region] active region-configuration
[SW1]stp instance 1 root primary
[SW1]stp instance 2 root secondary 

[SW2]stp instance 1 root secondary 
[SW2]stp instance 2 root primary 

4、VRRP配置

[SW1]interface Vlanif 2
[SW1-Vlanif2]ip address 172.16.2.1 24
[SW2]interface Vlanif 2
[SW2-Vlanif2]ip add 172.16.2.2 24

[SW2]interface Vlanif 3
[SW2-Vlanif3]ip address 172.16.3.1 24
[SW1]int Vlanif 3
[SW1-Vlanif3]ip add 172.16.3.2 24


[SW1]int v 2
[SW1-Vlanif2]vrrp vrid 2 virtual-ip 172.16.2.254
[SW1-Vlanif2]vrrp vrid 2 priority 110
[SW2]int v 2
[SW2-Vlanif2]vrrp vrid 2 virtual-ip 172.16.2.254

[SW2-Vlanif3]vrrp vrid 3 virtual-ip 172.16.3.254
[SW2-Vlanif3]vrrp vrid 3 priority 110
[SW1-Vlanif3]vrrp vrid 3 virtual-ip 172.16.3.254

5、DHCP配置

[SW1]dhcp enable
[SW1]ip pool v2
[SW1-ip-pool-v2]network 172.16.2.0 mask 24
[SW1-ip-pool-v2]gateway-list 172.16.2.254
[SW1]ip pool v3
[SW1-ip-pool-v3]network 172.16.3.0 mask 24
[SW1-ip-pool-v3]gateway-list 172.16.3.254

[SW1]int v 2
[SW1-Vlanif2]dhcp select global
[SW1]int v 3
[SW1-Vlanif3]dhcp select global 

[SW2]dhcp enable
[SW2]ip pool v2
[SW2-ip-pool-v2]network 172.16.2.0 mask 24
[SW2-ip-pool-v2]gateway-list 172.16.2.254
[SW2]ip pool v3
[SW2-ip-pool-v3]network 172.16.3.0 mask 24
[SW2-ip-pool-v3]gateway-list 172.16.3.254

[SW2]int v 2
[SW2-Vlanif2]dhcp select global
[SW2]int v 3
[SW2-Vlanif3]dhcp select global 

6、vlan互通

[SW1]vlan 1000
[SW1]interface vlanif 1000
[SW1-Vlanif1000]ip add 172.16.0.1 30

[SW1]int g0/0/5
[SW1-GigabitEthernet0/0/5]port link-type access
[SW1-GigabitEthernet0/0/5]port default vlan 1000

[SW2]vlan 1000
[SW2]int v 1000
[SW2-Vlanif1000]ip add 172.16.1.1 30
[SW2-GigabitEthernet0/0/5]p d v 10
[SW2-GigabitEthernet0/0/5]p d v 1000
[AR1]int g0/0/1
[AR1-GigabitEthernet0/0/1]ip add 172.16.0.2 30
[AR1-GigabitEthernet0/0/1]int g0/0/2
[AR1-GigabitEthernet0/0/2]ip add 172.168.1.2 30
[AR1-GigabitEthernet0/0/2]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip add 12.0.0.1 24

[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip add 1.1.1.1 24
[AR1]ip route-static 0.0.0.0 0 12.0.0.2

[AR1]ospf 1 router-id 1.1.1.1
[AR1-ospf-1]a 0
[AR1-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[AR1-ospf-1-area-0.0.0.0]network 172.16.1.2 0.0.0.0

[SW1]ospf 1 router-id 2.2.2.2
[SW1-ospf-1]a 0
[SW1-ospf-1-area-0.0.0.0]network 172.16.2.1 0.0.0.0
[SW1-ospf-1-area-0.0.0.0]network 172.16.3.2 0.0.0.0
[SW1-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0

[SW2]ospf 1 router-id 3.3.3.3
[SW2-ospf-1]a 0
[SW2-ospf-1-area-0.0.0.0]network 172.16.2.2 0.0.0.0
[SW2-ospf-1-area-0.0.0.0]network 172.16.3.1 0.0.0.0
[SW2-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0

# 下发缺省
[AR1-ospf-1]default-route-advertise 

7、NAT配置(做ACL,内网访问公网)

[AR1]acl 2000
[AR1-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]nat outbound 2000


http://www.kler.cn/a/154663.html

相关文章:

  • 电脑长期不用,开不了机怎样解决
  • SOHO场景开局(小型,多子网):AP+管理型交换机+路由器+光猫
  • 【数据库取证】快速从服务器镜像文件中获取后台隐藏数据
  • 基于Matlab的碎纸片的自动拼接复原技术
  • react 中 useEffect Hook 作用
  • More effective C++:杂项
  • Redis hash表源码解析
  • 物联网开发(一)新版Onenet 基础配置
  • Hdoop学习笔记(HDP)-Part.16 安装HBase
  • C++11 类的新功能
  • 实验8 图的操作
  • LangChain(0.0.339)官方文档四:Prompts下——prompt templates的存储、加载、组合和部分格式化
  • 肖sir__mysql之单表练习题2__(2)
  • 吉利展厅 | 透明OLED拼接2x2:科技与艺术的完美融合
  • 西南科技大学模拟电子技术实验四(集成运算放大器的线性应用)预习报告
  • Java Web——动态Web开发核心-Servlet
  • TA-Lib学习研究笔记(八)——Momentum Indicators 中
  • TLS、对称/非对称加密、CA认证
  • Zabbix HA高可用集群搭建
  • Node.js 事件循环:定时任务、延迟任务和 I/O 事件的艺术
  • 编程实战:类C语法的编译型脚本解释器(五)
  • HarmonyOS——解决本地模拟器无法选择设备的问题
  • 编程实战:类C语法的编译型脚本解释器(三)
  • 2312skia,15vulkan及技巧
  • Go语言实现深度学习的正向传播和反向传播
  • 深入理解Servlet(上)