》Huawei-R&S-网络工程师实验笔记20190608-VLAN划分基础(基于端口、MAC地址、子网地址、协议)

》》实验开始,先上拓扑图参考:

一、基于端口划分VLAN:

[SWA]vlan       //创建VLAN10,这一步是前提(设备默认只有VLAN 1)
[SWA-vlan10]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-vlan10]q [SWA]int g0//
[SWA-GigabitEthernet0//]port link-type ? //查询配置端口类型的命令
access Access port
dot1q-tunnel QinQ port
hybrid Hybrid port
trunk Trunk port [SWA-GigabitEthernet0//]port link-type access //配置端口为Access类型
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]port default vlan //将端口划分到VLAN 10
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is . [SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]port link-type access
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]port default vlan
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is . [SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]port link-type access
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]port def
[SWA-GigabitEthernet0//]port default vlan
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]q
[SWA]dis vlan //查看VLAN端口信息
The total number of vlans is :
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
-------------------------------------------------------------------------------- VID Type Ports
--------------------------------------------------------------------------------
common UT:GE0//(D) GE0//(D) GE0//(D) GE0//(D) //默认VLAN 1的端口
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) common UT:GE0//(U) GE0//(U) GE0//(U) //3个端口被划分进了VLAN 10 VID Status Property MAC-LRN Statistics Description
-------------------------------------------------------------------------------- enable default enable disable VLAN
enable default enable disable VLAN [SWA]dis port vlan active //查看VLAN端口信息,显示PVID和VLAN LIST
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port Link Type PVID VLAN List
-------------------------------------------------------------------------------
GE0// access U:
GE0// access U:
GE0// access U:
GE0// hybrid U:
GE0// hybrid U:
GE0// hybrid U:
GE0// hybrid U:
[SWA]

二、基于MAC地址划分VLAN:

[SWA]dis vlan         //检查VLAN状态信息
The total number of vlans is : //显示只有一个默认VLAN 1
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
common UT:GE0//(U) GE0//(U) GE0//(U) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D)
GE0//(D) GE0//(D) GE0//(D) GE0//(D) VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
enable default enable disable VLAN [SWA]vlan //创建VLAN 10 [SWA-vlan10]int g0//
[SWA-GigabitEthernet0//]port hybrid untagged vlan //在G0/0/1(默认Hybrid)端口下配置Untagged VLAN 10
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is . [SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]port hybrid untagged vlan 10 //在G0/0/2(默认Hybrid)端口下配置Untagged VLAN 10
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is . [SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]port hybrid untagged vlan 10 //在G0/0/3(默认Hybrid)端口下配置Untagged VLAN 10
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]q [SWA]dis port vlan active //检查VLAN端口激活状况(Hybrid端口的Untagged列表中默认只有VLAN 1)
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port Link Type PVID VLAN List
-------------------------------------------------------------------------------
GE0// hybrid U: //Hybrid端口的Untagged列表中配置增加了VLAN 10
GE0// hybrid U: //Hybrid端口的Untagged列表中配置增加了VLAN 10
GE0// hybrid U: //Hybrid端口的Untagged列表中配置增加了VLAN 10
GE0// hybrid U:
GE0// hybrid U:
GE0// hybrid U:
GE0// hybrid U:
[SWA]
[SWA]vlan
[SWA-vlan10]mac-vlan ?
mac-address MAC address
[SWA-vlan10]mac-vlan mac-address ?
H-H-H MAC address //指定与vlan10关联的MAC地址,常见格式xx:xx:xx:xx:xx:xx,此处xxxx-xxxx-xxxx(都是16进制)
[SWA-vlan10]mac-vlan mac-address -- ?
H-H-H Value of MAC address mask //指定MAC地址的掩码,格式还是xxxx-xxxx-xxxx(16进制)
INTEGER<-> Length of MAC address mask //指定MAC地址的掩码长度,整数型
priority Priority information //指定MAC地址对应vlan的802.1p优先级[0-7](默认为0,值越大、级越高)
<cr>
[SWA-vlan10]mac-vlan mac-address -- //在vlan10中绑定主机A的MAC地址
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-vlan10]mac-vlan mac-address -- //在vlan10中绑定主机B的MAC地址
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-vlan10]mac-vlan mac-address -- //在vlan10中绑定主机C的MAC地址
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is . [SWA-vlan10]int g0//
[SWA-GigabitEthernet0//]mac-vlan enable //开启G0/0/1端口下MAC-VLAN
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]mac-vlan enable //开启G0/0/2端口下MAC-VLAN
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]mac-vlan enable //开启G0/0/3端口下MAC-VLAN
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the
change loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]q
[SWA]
[SWA]dis mac-vlan mac-address all //检查vlan10中MAC地址绑定条目
---------------------------------------------------
MAC Address MASK VLAN Priority
---------------------------------------------------
-- ffff-ffff-ffff
-- ffff-ffff-ffff
-- ffff-ffff-ffff Total MAC VLAN address count:
[SWA]

三、基于子网地址划分VLAN:

[SWA]display vlan     //流程同上,先检查vlan和创建vlan10
---------
[SWA]vlan 10
---------
[SWA-vlan10]int g0/0/1 //再分别进入G0/0/1、2、3端口配置剥离vlan标签的功能
[SWA-GigabitEthernet0//]port hybrid untagged vlan
---------
[SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]port hybrid untagged vlan
---------
[SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]port hybrid untagged vlan
---------
[SWA-GigabitEthernet0//]vlan
[SWA-vlan10]
[SWA-vlan10]ip-subnet-vlan ? //根据子网信息绑定vlan
INTEGER<-> Ip-subnet index,ranging from integer to
ip IP address [SWA-vlan10]ip-subnet-vlan ip ?
X.X.X.X IP address [SWA-vlan10]ip-subnet-vlan ip 192.168.0.1 ?
INTEGER<-> Length of IP address mask
X.X.X.X IP address mask [SWA-vlan10]ip-subnet-vlan ip 192.168.0.1 //在vlan10中绑定主机A的IP地址
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-vlan10]ip-subnet-vlan ip 192.168.0.2 //在vlan10中绑定主机B的IP地址
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-vlan10]ip-subnet-vlan ip 192.168.0.3 //在vlan10中绑定主机C的IP地址
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is . [SWA-vlan10]dis this
#
vlan
ip-subnet-vlan ip 192.168.0.1 255.255.255.255
ip-subnet-vlan ip 192.168.0.2 255.255.255.255
ip-subnet-vlan ip 192.168.0.3 255.255.255.255
#
return
[SWA-vlan10]int g0//
[SWA-GigabitEthernet0//]ip-subnet-vlan enable //开启G0/0/1端口下ip-subnet-vlan
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]ip-subnet-vlan enable //开启G0/0/2端口下ip-subnet-vlan
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]ip-subnet-vlan enable //开启G0/0/3端口下ip-subnet-vlan
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the
change loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]quit [SWA]dis ip-subnet-vlan vlan all //检查vlan10中IP地址(子网)绑定条目
----------------------------------------------------------------
Vlan Index IpAddress SubnetMask Priority
----------------------------------------------------------------
192.168.0.1 255.255.255.255
192.168.0.2 255.255.255.255
192.168.0.3 255.255.255.255
----------------------------------------------------------------
ip-subnet-vlan count: total count:
[SWA]

四、基于协议划分VLAN:

[SWA]display vlan     //流程同上,先检查vlan和创建vlan10
---------                
[SWA]vlan 10
---------
[SWA-vlan10]int g0/0/1     //再分别进入G0/0/1、2、3端口配置剥离vlan标签的功能
[SWA-GigabitEthernet0/0/1]port hybrid untagged vlan 10
---------
[SWA-GigabitEthernet0/0/1]int g0/0/2
[SWA-GigabitEthernet0/0/2]port hybrid untagged vlan 10
---------
[SWA-GigabitEthernet0/0/2]int g0/0/3
[SWA-GigabitEthernet0/0/3]port hybrid untagged vlan 10
---------
[SWA-GigabitEthernet0/0/3]vlan 10
[SWA-vlan10]protocol-vlan ? //根据指定协议划分vlan(华为支持多种二层、三层协议)
INTEGER<-> Protocol index
at AT(AppleTalk Protocol) configuration information
ipv4 IPv4 configuration information
ipv6 IPv6 configuration information
ipx IPX(Internetwork Packet eXchange) configuration information
mode Other protocol mode configuration information [SWA-vlan10]protocol-vlan ipv4 //配置根据IPv4协议划分vlan
[SWA-vlan10]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-vlan10]int g0//
[SWA-GigabitEthernet0//]protocol-vlan vlan all //开启G0/0/1端口下protocol-vlan,关联vlan10,并引用所有配置协议
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]protocol-vlan vlan ?
INTEGER<-> Protocol index
all All the protocols of the VLAN
[SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]protocol-vlan vlan all //开启G0/0/2端口下protocol-vlan,关联vlan10,并引用所有配置协议
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]int g0//
[SWA-GigabitEthernet0//]protocol-vlan vlan all //开启G0/0/3端口下protocol-vlan,关联vlan10,并引用所有配置协议
[SWA-GigabitEthernet0//]
Jun ::-: SWA DS//DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
.191.3. configurations have been changed. The current change number is , the c
hange loop count is , and the maximum number of records is .
[SWA-GigabitEthernet0//]q
[SWA]
[SWA]dis protocol-vlan vlan all //查看vlan中绑定的协议
----------------------------------------------------------------
VLAN Protocol Index Protocol Type
----------------------------------------------------------------
ipv4

Huawei-R&S-网络工程师实验笔记20190608-VLAN划分基础(基于端口、MAC地址、子网地址、协议)的更多相关文章

  1. Huawei-R&S-网络工程师实验笔记20190525-设备登录、VRP基本配置、文件系统

    >Huawei-R&S-网络工程师实验笔记20190525-设备登录.VRP基本配置.文件系统(环回接口.telnet远程.AAA登录.命令行.时钟.banner.文件目录) >& ...

  2. Huawei-R&S-网络工程师实验笔记20190524-VRP的系统、接口视图下基本操作

    >Huawei-R&S-网络工程师实验笔记20190524-VRP的系统.接口视图下基本操作(重命名.配置IP.VLAN接口.双工模式.console口) >>实验开始,先上 ...

  3. Huawei-R&S-网络工程师实验笔记20190530-FTP上传下载、STelnet登录、SFTP登录

    >Huawei-R&S-网络工程师实验笔记20190530-FTP上传下载.STelnet登录.SFTP登录 >>实验开始,参考<Huawei-R&S-网络工程 ...

  4. Huawei-R&S-网络工程师实验笔记20190527-华为设备密码重置、设置web管理

    >Huawei-R&S-网络工程师实验笔记20190527-华为设备密码重置.设置web管理 >>实验开始(使用SecureCRT 等工具软件): 一.华为设备密码重置,通过 ...

  5. Huawei-R&S-网络工程师实验笔记20190607-STP生成树协议(基本配置、桥优先级、根桥选举、根端口、路径开销、边缘端口)

    >Huawei-R&S-网络工程师实验笔记20190607-STP生成树协议(基本配置.桥优先级.根桥选举.根端口.路径开销.边缘端口) >>实验开始,先上拓扑图参考: &l ...

  6. Huawei-R&S-网络工程师实验笔记20190615-IP基础(AR201上配置IP)

    >Huawei-R&S-网络工程师实验笔记20190615-IP基础(AR201上配置IP) >>实验开始,先上拓扑图参考: >>>一般正常配置IP操作如下 ...

  7. Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Hybrid端口)

    >Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Hybrid端口) >>实验开始,先上拓扑图参考: >>>实验目标:分别实现主 ...

  8. Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Access和Trunk端口)

    >Huawei-R&S-网络工程师实验笔记20190609-VLAN划分综合(Access和Trunk端口) >>实验开始,先上拓扑图参考: >>>实验目标 ...

  9. 网络对抗实验一 逆向及Bof基础实践

    网络对抗实验一 逆向及Bof基础实践 一.实验目的 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调用foo函数,foo函数会简单回显任何用户输入的字符串. ...

随机推荐

  1. 算法题:打印1到最大的n位数

    说明:本文仅供学习交流,转载请标明出处,欢迎转载!        今天看到剑指offer上的第12题,题目例如以下:        输入数字n.按顺序打印出从1到最大的n位十位数. 比方输入3,则打印 ...

  2. RAID5配置及服务器2003系统安装方法。2000系统的安装要使用7.9版本的引导盘

    服务器2003系统安装方法.2000系统的安装要使用7.9版本的引导盘 RAID5配置: 1.为新到的惠普DL380服务器装系统,首先要配置RAID阵列. 如下图进行配置. 启动到如上图阶段,按F8. ...

  3. 一些SQL高级函数

    一些SQL高级函数 Posted on 2010-08-08 21:34 moss_tan_jun 阅读(311) 评论(0) 编辑 收藏 长度与分析用 datalength(Char_expr) 返 ...

  4. openStack调试

  5. Appium + python -yaml配置文件

    在线安装:pip install yaml import yamlimport os # 获取当前脚本所在文件夹路径curpath = os.path.dirname(os.path.realpath ...

  6. sql 全站搜索

    SQL全站搜索 create proc Full_Search(@string varchar(50)) as begin declare @tbname varchar(50) declare tb ...

  7. celery定时执行ansible api返回为空的问题

    有两种方法解决这个问题,就是关闭assert:1.在celery 的worker启动窗口设置export PYTHONOPTIMIZE=1或打开celery这个参数-O OPTIMIZATION2.注 ...

  8. 【洛谷4396/BZOJ3236】[AHOI2013]作业(莫队+分块/树状数组/线段树)

    题目: 洛谷4396 BZOJ3236(权限) 这题似乎BZOJ上数据强一些? 分析: 这题真的是--一言难尽 发现题面里没说权值的范围,怕出锅就写了离散化.后来经过面向数据编程(以及膜神犇代码)知道 ...

  9. hbuilder中的 http://www.w3.org/TR/html4/frameset.dtd

    <!-- This is the HTML 4.01 Frameset DTD, which should be used for documents with frames. This DTD ...

  10. 学习c语言的感想

    其实个人认为无论学习什么语言,最重要的是掌握习编程思想,然而C语言一种学习编程思想的基础语言.所以,C语言的重要性不言而喻. 一.课本 无论用的是什么书,要学好C语言,把书上的每一个例题.习题的代码读 ...