当前位置:网站首页>VLAN 实验
VLAN 实验
2022-08-03 12:46:00 【橘子爱吃橘子】
一、实验要求
思路:
二、创建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
边栏推荐
- An introduction to basic tools for selecting line tools (package church)
- [Verilog] HDLBits Problem Solution - Verification: Writing Testbenches
- BOM系列之sessionStorage
- Database basics one (MySQL) [easy to understand]
- 【实战技能】单片机bootloader的CANFD,I2C,SPI和串口方式更新APP视频教程(2022-08-01)
- self-discipline
- ECCV 2022|通往数据高效的Transformer目标检测器
- An工具介绍之3D工具
- 【R】用grafify搞定统计绘图、方差分析、干预比较等!
- Byte's favorite puzzle questions, how many do you know?
猜你喜欢
随机推荐
The common problems in the futures account summary
Random forest project combat - temperature prediction
可视化图表设计Cookbook
业界新标杆!阿里开源自研高并发编程核心笔记(2022最新版)
链游NFT元宇宙游戏系统开发技术方案及源码
The components of the basis of An animation movie clip animation between traditional filling
Tinymce plugins [Tinymce扩展插件集合]
BOM系列之sessionStorage
Blog records life
2022 年 CISO 最关心的是什么?
Image fusion SDDGAN article learning
R语言使用zoo包中的rollapply函数以滚动的方式、窗口移动的方式将指定函数应用于时间序列、计算时间序列的滚动标准差(设置每个窗口不重叠)
R语言ggplot2可视化:使用ggpubr包的ggline函数可视化折线图、设置add参数为mean_se和dotplot可视化不同水平均值的折线图并为折线图添加误差线(se标准误差)和点阵图
Image fusion GAN-FM study notes
论文理解:“Gradient-enhanced physics-informed neural networks for forwardand inverse PDE problems“
Feature Engineering Study Notes
Five, the function calls
[Verilog] HDLBits Problem Solution - Circuits/Sequential Logic/Latches and Flip-Flops
An动画基础之散件动画原理与形状提示点
ECCV 2022 | AirDet: 无需微调的小样本目标检测方法