vlan常用的配置命令
时间: 2023-11-10 09:06:50 浏览: 56
1. 创建VLAN:
vlan vlan-id
2. 删除VLAN:
no vlan vlan-id
3. 配置VLAN名称:
vlan vlan-id name vlan-name
4. 配置VLAN接口:
interface interface-type interface-number
switchport access vlan vlan-id
5. 配置VLAN trunk接口:
interface interface-type interface-number
switchport mode trunk
switchport trunk allowed vlan vlan-id
6. 配置VLAN管理IP地址:
interface vlan vlan-id
ip address ip-address subnet-mask
7. 配置VLAN间路由:
interface vlan vlan-id
ip routing
8. 显示VLAN信息:
show vlan
9. 显示VLAN接口信息:
show interfaces switchport
10. 显示VLAN管理IP地址信息:
show ip interface brief
相关问题
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 ]
```
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)