# 为VLAN10 指定一个描述字符串“connect to LAB1”。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 10
[Sysname-vlan10] description connect to LAB1

# 为Vlan-interface1 接口指定一个描述字符串“gateway of LAB1”
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface Vlan-interface 1
[Sysname-Vlan-interface1] description gateway of LAB1

# 显示所有已创建的VLAN 接口的相关信息。
<Sysname> display interface Vlan-interface 1
Vlan-interface1 current state :UP
Line protocol current state :UP
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc00-5191
Internet Address is 192.168.0.1/24 Primary
Internet Address is 10.1.1.1/24 Sub
Description : Vlan-interface1 Interface
The Maximum Transmit Unit is 1500

# 显示VLAN1 的信息。
<Sysname> display vlan 1
VLAN ID: 1
VLAN Type: static
Route Interface: configured
IP Address: 192.168.0.39
1-4
Subnet Mask: 255.255.255.0
Description: VLAN 0001
Name: VLAN 0001
Tagged Ports:
GigabitEthernet1/0/1
Untagged Ports:
GigabitEthernet1/0/2

# 为VLAN1 创建对应的VLAN 接口并进入Vlan-interface1 的接口视图。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface Vlan-interface 1
[Sysname-Vlan-interface1]

# 指定VLAN 2 的名称为“test vlan”。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 2
[Sysname-vlan2] name test vlan

# 关闭Vlan-interface2 接口。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface Vlan-interface 2
[Sysname-Vlan-interface2] shutdown

# 创建VLAN5 并进入VLAN5 的视图。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 5
[Sysname-vlan5]
# 删除VLAN 5。
[Sysname-vlan5] quit
[Sysname] undo vlan 5
# 创建VLAN 4 到VLAN 100。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 4 to 100
Please wait............. Done.
# 批量删除VLAN2 到VLAN9,其中VLAN 7 已经被配置为Voice VLAN。
[Sysname] undo vlan 2 to 9
Note:The VLAN kept by protocol, the voice VLAN, the default VLAN, the management VLAN and
the remote probe VLAN will not be deleted!
Please wait... Done.
[Sysname] display vlan
The following VLANs exist:
1(default), 7
以上信息表示,已经被配置为Voice VLAN 的VLAN 无法使用undo vlan 命令直接删除,其他VLAN
已经被正常删除。

# 显示当前系统存在的Hybrid 端口。
<Sysname> display port hybrid
The following hybrid ports exist:
GigabitEthernet1/0/1 GigabitEthernet1/0/2
以上信息表示当前系统有两个Hybrid 端口,分别为GigabitEthernet1/0/1 和GigabitEthernet1/0/2。

# 向VLAN 2 中加入从GigabitEthernet1/0/2 到GigabitEthernet1/0/4 的以太网端口。
1-9
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] vlan 2
[Sysname-vlan2] port GigabitEthernet 1/0/2 to GigabitEthernet 1/0/4

# 将GigabitEthernet1/0/1 端口加入到VLAN3 中。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface GigabitEthernet 1/0/1
[Sysname-GigabitEthernet1/0/1] port access vlan 3

# 将Hybrid 端口GigabitEthernet1/0/1 的缺省VLAN 设为100。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface GigabitEthernet 1/0/1
[Sysname-GigabitEthernet1/0/1] port link-type hybrid
[Sysname-GigabitEthernet1/0/1] port hybrid pvid vlan 100

# 将Hybrid 端口GigabitEthernet1/0/1 加入到VLAN2、VLAN4、VLAN50~VLAN100 中(假设指
定的VLAN 都已经创建),并且设置该端口在发送这些VLAN 的报文时将保留VLAN Tag。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface GigabitEthernet 1/0/1
[Sysname-GigabitEthernet1/0/1] port link-type hybrid
[Sysname-GigabitEthernet1/0/1] port hybrid vlan 2 4 50 to 100 tagged

# 将以太网端口GigabitEthernet1/0/1 设置为Trunk 端口。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface GigabitEthernet 1/0/1
1-12
[Sysname-GigabitEthernet1/0/1] port link-type trunk

# 将Trunk 端口GigabitEthernet1/0/1 加入到VLAN2、VLAN4、VLAN50~VLAN 100 中。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface GigabitEthernet 1/0/1
[Sysname-GigabitEthernet1/0/1] port link-type trunk
[Sysname-GigabitEthernet1/0/1] port trunk permit vlan 2 4 50 to 100
Please wait... Done.

# 将Trunk 端口GigabitEthernet1/0/1 的缺省VLAN 设为100。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface GigabitEthernet 1/0/1
[Sysname-GigabitEthernet1/0/1] port link-type trunk
[Sysname-GigabitEthernet1/0/1] port trunk pvid vlan 100

# 显示端口GigabitEthernet1 /0/1 和GigabitEthernet1/0/2 上所配置的协议信息及协议的索引。
<Sysname> display protocol-vlan interface GigabitEthernet 1/0/1 to GigabitEthernet 1/0/2
Interface: GigabitEthernet1/0/1
VLAN ID Protocol-Index Protocol-type
50 0 ip
80 1 ip
100 0 ip
100 1 ipx ethernetii
Interface: GigabitEthernet1/0/2
VLAN ID Protocol-Index Protocol-type
50 1 ipx raw
80 2 at
100 3 snap etype 0x0abc
100 4 llc dsap 0xac ssap 0xbd

# 显示VLAN10 到VLAN20 上所配置的协议信息及协议的索引。
<Sysname> display protocol-vlan vlan 10 to 20
VLAN ID: 10
VLAN Type: Protocol-based VLAN
Protocol-Index Protocol-Type
0 ip
1 ip
2 ipx ethernetii
3 at
VLAN ID: 15
VLAN Type: Protocol-based VLAN
Protocol-Index Protocol-Type
0 ip
1 snap etype 0x0abcd

# 将GigabitEthernet1/0/1 端口与协议VLAN 3 中索引值为0 到2 的协议模板进行绑定(假设相应
的协议模板已经创建)。
<Sysname> system-view
System View: return to User View with Ctrl+Z.
[Sysname] interface GigabitEthernet 1/0/1
[Sysname-GigabitEthernet1/0/1] port hybrid protocol-vlan vlan 3 0 to 2
# 取消GigabitEthernet1/0/1 端口与协议VLAN3 中索引值为1 到4 之间的协议模板的绑定关系。
[Sysname-GigabitEthernet1/0/1] undo port hybrid protocol-vlan vlan 3 1 to 4
Protocol index 1 does not exist in VLAN 3
Protocol index 4 does not exist in VLAN 3

vlan配置命令的更多相关文章

  1. H3C交换机配置命令(收集)

    1:配置登录用户,口令等 <H3C>                   //用户直行模式提示符,用户视图 <H3C>system-view        //进入配置视图 [ ...

  2. IB交换机配置命令总结

    串口通过远程CRT登录,波特率9600用户名和密码都是adminDo you want to use the wizard for initial configuration?选择no打开ip rou ...

  3. 思科Cisco 2960系列交换机配置命令

    配置密码: 2960>en :第一次密码为空 2960h#conf t :进入全局配置模式 2960(config)#hostname swa :设置交换机名 2960(config)#enab ...

  4. CISCO动态VLAN配置

    一.基于VMPS的动态VLAN配置实例 网络中VLAN实现分为静态 VLAN和动态VLAN.静态VLAN又被称为是基于端口的VLAN.顾名思义,就是明确指定各端口属于哪个VLAN的设定方法,交换机中某 ...

  5. CISCO3560 VLAN配置实例

    1.注意事项 1.1.交换机启动需要大约4-5分钟: 1.2.网线插入交换机接口从黄变为绿需要大约1-2分钟,即进入正常工作模式: 1.3.建议使用XP系统进行操作,2003默认没有安装超级终端,需要 ...

  6. [HCNA]VLAN配置Hybrid接口

    实验名称 VLAN配置Hybrid接口 日期 2018年4月13日 实验目的 1.掌握配置Hybrid接口的方法. 2.理解Hybrid接口处理Untagged数据帧过程 3.理解Hybrid接口处理 ...

  7. swconfig--交换接口配置命令

    swconfig是交换接口(switch)配置命令. swconfig list ; 列出可用的SWITCH设备信息(dev参数) Found: switch0 - ag71xx-mdio. swco ...

  8. HCNP学习笔记之史上最全华为路由器交换机配置命令大合集

    先来一张思科和华为命令的对照表: 史上最全华为路由器交换机配置命令大合集,熟练掌握下面的华为路由器交换机配置知识点,你只需花几分钟的时间就能明白华为路由器交换机配置.交换机的配置命令等等. 华为路由器 ...

  9. Linux 网桥配置命令:brctl

    Linux网关模式下将有线LAN和无线LAN共享网段实现局域网内互联: 思路其实很简单:就是将虚拟出一个bridge口,将对应的有线LAN和无线LAN都绑定在这个虚拟bridge口上,并给这个brid ...

随机推荐

  1. L03-Linux RHEL6.5系统中配置本地yum源

    1.将iso镜像文件上传到linux系统.注意要将文件放在合适的目录下,因为后面机器重启时还要自动挂载,所以此次挂载成功之后该文件也不要删除. 2.将iso光盘挂载到/mnt/iso目录下. (1)先 ...

  2. switch case执行顺序

    public class SwitchCase { public static void main(String[] args) { System.out.println(switchFun(4)); ...

  3. The Ugly Duckling

    THE UGLY DUCKLING   Chapter 1: The Ugly Duckling Hatches   A mother duck sits on many eggs.Crack! Cr ...

  4. 检查SQL语句是否合法

    昨天又有一个新的需求:验证文本框输入的SQL语法是否正确. 于是就开始百度,其实也挺简单的. 首先需要知道“SET PARSEONLY { ON | OFF }”. 当 SET PARSEONLY 为 ...

  5. redis 数据类型 Hash

    Redis 数据类型Hash:hash数据类型存储的数据和mysql数据库中存储的一条记录很类似. hash的一些操作: 比如数据库是user表,有id,name,age ,sex,可以建立与之对应的 ...

  6. javac的Resolve类解读

    方法1:isInitializer() /** An environment is an "initializer" if it is a constructor or * an ...

  7. exe4j安装及注册

    1 安装 1 下载 exe4j下载地址:http://www.ej-technologies.com/download/exe4j/files.php, 进入网址,选择需要的版本,点击下载就可以了. ...

  8. ActiveMQ:Exception occurred while processing this request, check the log for more information!

    出现上面错误的原因有以下两种 1 jdk的版本和activemq的版本不符 安装完ActiveMQ之后,通过http://IP:8161登陆到控制台. 通过测试代码给服务端发送队列消息,在控制台点击q ...

  9. manjaro 添加tash 快捷方式

    -In your home directory open /.local/share/applications/-Right click in this folder and create a emp ...

  10. spring之validation校验

    对于任何一个应用而言在客户端做的数据有效性验证都不是安全有效的,这时候就要求我们在开发的时候在服务端也对数据的有效性进行验证.SpringMVC自身对数据在服务端的校验有一个比较好的支持,它能将我们提 ...