当前位置:网站首页>VLAN experiment
VLAN experiment
2022-08-03 13:36:00 【oranges love oranges】
一、实验要求

思路:

二、创建VLAN
lsw1:
[lsw1]vlan batch 2 to 6---批量创建VLAN
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw1]
lw2:
[lsw2]vlan batch 2 to 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw2]
lsw3:
[lsw3]vlan batch 2 to 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw3]
三、将接口划入VLAN
lsw1:
[lsw1]int g 0/0/1
[lsw1-GigabitEthernet0/0/1]port link-type access----接口类型为access类型
[lsw1-GigabitEthernet0/0/1]port default vlan 2----接口划入VLAN 2
[lsw1-GigabitEthernet0/0/1]
[lsw1-GigabitEthernet0/0/1]int g 0/0/2
[lsw1-GigabitEthernet0/0/2]port link-type hybrid ----使用混杂模式
[lsw1-GigabitEthernet0/0/2]port hybrid pvid vlan 3 ---将接口划入VLAN 3
[lsw1-GigabitEthernet0/0/2]port hybrid untagged vlan 3 4 5 6----3、4、5、6不带标签,
[lsw1-GigabitEthernet0/0/2]
[lsw1-GigabitEthernet0/0/2]int g 0/0/3
[lsw1-GigabitEthernet0/0/3]port link-type trunk ---使用trunk接口
[lsw1-GigabitEthernet0/0/3]port trunk allow-pass vlan all ---允许所有的VLAN通过
[lsw1-GigabitEthernet0/0/3]
[lsw1-GigabitEthernet0/0/3]int g 0/0/4
[lsw1-GigabitEthernet0/0/4]port link-type hybrid
[lsw1-GigabitEthernet0/0/4]port hybrid tagged vlan 2----VLAN 2 带上标签
[lsw1-GigabitEthernet0/0/4]port hybrid untagged vlan 3 4 5 6
[lsw1-GigabitEthernet0/0/4]
lsw2:
[lsw2]int g 0/0/1
[lsw2-GigabitEthernet0/0/1]port link-type access
[lsw2-GigabitEthernet0/0/1]port default vlan 2
[lsw2-GigabitEthernet0/0/1]
[lsw2]int g 0/0/1
[lsw2-GigabitEthernet0/0/1]port link-type access
[lsw2-GigabitEthernet0/0/1]port default vlan 2
[lsw2-GigabitEthernet0/0/1]int g 0/0/2
[lsw2-GigabitEthernet0/0/2]port link-type hybrid
[lsw2-GigabitEthernet0/0/2]port hybrid pvid vlan 4
[lsw2-GigabitEthernet0/0/2]port hybrid untagged vlan 3 4 5
[lsw2-GigabitEthernet0/0/2]int g 0/0/3
[lsw2-GigabitEthernet0/0/3]port link-type trunk
[lsw2-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[lsw2-GigabitEthernet0/0/3]
[lsw2]int g 0/0/4
[lsw2-GigabitEthernet0/0/4]port link-type trunk
[lsw2-GigabitEthernet0/0/4]port trunk allow-pass vlan all
[lsw2-GigabitEthernet0/0/4]
lsw3:
[lsw3]int g 0/0/1
[lsw3-GigabitEthernet0/0/1]port link-type hybrid
[lsw3-GigabitEthernet0/0/1]port hybrid pvid vlan 5
[lsw3-GigabitEthernet0/0/1]port hybrid untagged vlan 3 4 5
[lsw3-GigabitEthernet0/0/1]
[lsw3-GigabitEthernet0/0/1]int g 0/0/2
[lsw3-GigabitEthernet0/0/2]port link-type hybrid
[lsw3-GigabitEthernet0/0/2]port hybrid pvid vlan 6
[lsw3-GigabitEthernet0/0/2]port hybrid untagged vlan 3 6
[lsw3-GigabitEthernet0/0/2]
[lsw3-GigabitEthernet0/0/2]int g 0/0/3
[lsw3-GigabitEthernet0/0/3]port link-type trunk
[lsw3-GigabitEthernet0/0/3]port trunk allow-pass vlan all
R1:
[r1]int g 0/0/0.1----创建子接口
[r1-GigabitEthernet0/0/0.1]ip address 192.168.1.1 24
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2---划入VLAN 2 的范围
[r1-GigabitEthernet0/0/0.1]arp broadcast enable ----开启广播
[r1-GigabitEthernet0/0/0.1]
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.2.1 24
四、通过DHCP获取IP地址
[r1]dhcp enable ----开启DHCP
[r1]ip pool aa---创建aa的地址池
[r1-ip-pool-aa]network 192.168.1.0 mask 24
[r1-ip-pool-aa]gateway-list 192.168.1.1
[r1-ip-pool-aa]dns-list 114.114.114.114
[r1-ip-pool-aa]
[r1-ip-pool-aa]q
[r1]ip pool bb
[r1-ip-pool-bb]network 192.168.2.0 mask 24
[r1-ip-pool-bb]gateway-list 192.168.2.1
[r1-ip-pool-bb]dns-list 114.114.114.114
[r1]int g 0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global ----开启全局模式
[r1-GigabitEthernet0/0/0.1]q
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]dhcp select global
点击DHCP,选择应用:






五、ping结果检测
PC1访问PC2/3/4/5/6
PC2访问PC4/5/6
PC3访问PC2/1/4/5/6

PC4可以访问PC5,但是不能访问PC6
PC5不能访问PC6
边栏推荐
- 类和对象(中下)
- [Blue Bridge Cup Trial Question 48] Scratch Dance Machine Game Children's Programming Scratch Blue Bridge Cup Trial Question Explanation
- An工具介绍之骨骼工具
- HCIP 第十六天笔记(SVI、生成树协议)
- 可视化图表设计Cookbook
- 如何让history历史记录前带时间戳
- The components of the basis of An animation movie clip animation between traditional filling
- 投资75亿卢比!印度宣布建首座存储芯片组装和封测工厂,将于12月量产
- PyTorch构建神经网络预测气温(数据集对比,CPU与GPU对比)
- An animation based button animation combined with basic code
猜你喜欢

客户:我们系统太多,能不能实现多账号互通?

将移位距离和假设外推到非二值化问题

【框架】idea找不到xxx依赖项怎么办

typedef关键字的用法

An工具介绍之骨骼工具

An工具介绍之形状工具及渐变变形工具

中国手机品牌争论谁是国内第一,而它已成为中国手机在海外的代表

Classes and objects (upper)

How to disable software from running in the background in Windows 11?How to prevent apps from running in the background in Windows 11
![[Practical skills] APP video tutorial for updating APP in CANFD, I2C, SPI and serial port mode of single-chip bootloader (2022-08-01)](/img/df/69dc3cb061cd4544d1aae5a88c7b00.png)
[Practical skills] APP video tutorial for updating APP in CANFD, I2C, SPI and serial port mode of single-chip bootloader (2022-08-01)
随机推荐
[Blue Bridge Cup Trial Question 48] Scratch Dance Machine Game Children's Programming Scratch Blue Bridge Cup Trial Question Explanation
厨卫电器行业数字化集采管理系统:优化产业供应结构,实现采购业务流程集中管控
An introduction to the camera
GameFi industry down but not out | June Report
Multithreading in Redis 6
飞桨开源社区季度报告来啦,你想知道的都在这里
【OpenCV】 书本视图矫正 + 广告屏幕切换 透视变换图像处理
Nanoprobes 金纳米颗粒标记试剂丨1.4 nm Nanogold 标记试剂
Notepad++ install jsonview plugin
优思学院|2022年获美质协ASQ和ILSSI奖项的《精益六西格玛的十条戒律》
An工具介绍之骨骼工具
软件测试考证:ISTQB、软件评测师
4年工作经验,多线程间的5种通信方式都说不出来,你信吗?
Nanoprobes金脂质偶联物的相关应用
使用百度EasyDL实现施工人员安全装备检测
An动画基础之元件的影片剪辑动画与传统补间
[Microservice] Multi-level cache
OpenCV 透视变换
硬件业务收入下滑,为了赚钱,苹果暧昧对待流氓软件和增加广告了
Golang sync.WaitGroup