当前位置:网站首页>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
边栏推荐
- Golang interface interface
- 4年工作经验,多线程间的5种通信方式都说不出来,你信吗?
- Nanoprobes Ni-NTA-Nanogold——用于 His 标签标记和检测
- Forrester:行业云帮助中国企业更快适应未来的发展
- Golang structs & methods
- 北斗三号系统建成开通两周年:基础设施端核心技术已实现自主可控
- ECCV 2022 | AirDet: 无需微调的小样本目标检测方法
- An工具介绍之3D工具
- [Blue Bridge Cup Trial Question 48] Scratch Dance Machine Game Children's Programming Scratch Blue Bridge Cup Trial Question Explanation
- Insertion or Heap Sort
猜你喜欢
随机推荐
typedef关键字的用法
保健用品行业B2B电子商务系统:供采交易全链路数字化,助推企业管理精细化
设计思维 | 详看设计工作坊Workshop的11个关键技巧
PyTorch构建分类网络模型(Mnist数据集,全连接神经网络)
飞桨开源社区季度报告来啦,你想知道的都在这里
超大规模的产业实用语义分割数据集PSSL与预训练模型开源啦!
[Deep Learning] Overview of Efficient and Lightweight Semantic Segmentation
scala安装包
Yahoo!Answers - data set
使用Typora+EasyBlogImageForTypora写博客,无图床快速上传图片
软件测试面试(四)
An introduction to the camera
An工具介绍之钢笔工具、铅笔工具与画笔工具
【二叉树】从二叉树一个节点到另一个节点每一步的方向
PyTorch框架训练线性回归模型(CPU与GPU环境)
TensorFlow离线安装包
Golang 结构体&方法
将移位距离和假设外推到非二值化问题
Nanoprobes EnzMet - 酶金相相关介绍及应用
GameFi industry down but not out | June Report