vlan常用的配置命令
时间: 2023-11-01 21:06:44 浏览: 43
1. 创建vlan:
```
vlan vlan-id
```
2. 配置vlan名称:
```
vlan vlan-id name vlan-name
```
3. 将端口加入vlan:
```
interface interface-id
switchport access vlan vlan-id
```
4. 配置trunk端口:
```
interface interface-id
switchport mode trunk
```
5. 允许vlan通过trunk:
```
interface interface-id
switchport trunk allowed vlan vlan-list
```
6. 配置VTP:
```
vtp mode {client | server | transparent}
vtp domain domain-name
vtp password password
```
7. 显示vlan信息:
```
show vlan
```
8. 显示端口vlan信息:
```
show interfaces interface-id switchport
```
相关问题
VLAN基本配置命令
以下是VLAN基本配置命令:
1. 创建VLAN并命名:
```shell
S1(config)#vlan 2
S1(config-vlan)#name VLAN2
```
2. 将端口划分到VLAN中:
```shell
1(config)#interface f0/1
S1(config-if)#switchport mode access
S1(config-if)#switchport access vlan 2
```
3. 配置Trunk链路上的Native VLAN:
```shell
S1(config)#interface f0/13
S1(config-if)#switchport trunk native vlan 2
```
4. 查看VLAN信息:
```shell
S1#show vlan brief
```
5. 删除VLAN:
```shell
S1(config)#no vlan 2
```
6. 配置VLAN间路由:
```shell
S1(config)#interface vlan 2
S1(config-if)#ip address 192.168.1.1 255.255.255.0
S1(config)#interface vlan 3
S1(config-if)#ip address 192.168.2.1 255.255.255.0
S1(config)#ip routing
```
enspvlan配置命令
以下是ensp中VLAN的配置命令:
1. 创建VLAN并进入VLAN视图
```
vlan vlan-id
```
2. 指定批量创建VLAN
```
vlan batch { vlan-id1 [ to vlan-id2 ] }
```
3. 退出VLAN视图
```
quit
```
4. 配置VLAN接口
```
interface interface-type interface-number
port link-type { access | trunk }
port default vlan vlan-id
```
5. 配置子接口
```
interface interface-type interface-number.subnum
port link-type { access | trunk }
port default vlan vlan-id
```
6. 配置VLAN间路由
```
ip routing
interface vlanif vlan-id
ip address ip-address { mask | mask-length }
```
7. 配置VLAN间ACL
```
acl [ number ] { name acl-name | id acl-id }
rule [ rule-id ] { deny | permit } [ icmp-type icmp-type | tcp | udp ] [ source { source-address source-mask | any } ] [ destination { destination-address destination-mask | any } ] [ tos tos ] [ precedence precedence ] [ time-range time-name ] [ log | alarm ] [ description text ]
```