VLAN基本配置命令
时间: 2023-12-02 12:40:27 浏览: 139
以下是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
```
阅读全文