锐捷网管交换机创建VLAN的相关操作

1、创建VLAN
在全局配置模式下,通过vlan { vlan-id | range vlan-range }命令创建普通静态VLAN,进入VLAN配置模式。

vlan-range可以包含一个或多个VLAN,当配置多个VLAN时,VLAN ID间用逗号隔开,连续的VLAN ID还可使用“-”头尾连接,无大小顺序要求。

# 创建VLAN 10,并进入VLAN 10的配置模式。

Hostname> enable

Hostname# configure terminal

Hostname(config)# vlan 10

Hostname(config-vlan)#

# 创建一组VLAN。

Hostname> enable

Hostname# configure terminal

Hostname(config)# vlan range 20,3,5,7-9,15-11

Hostname(config-vlan-range)#

2、配置VLAN名称
在VLAN配置模式下,通过name vlan-name命令配置VLAN名称。

# 配置VLAN 10的名称为office 10。

Hostname> enable

Hostname# configure terminal

Hostname(config)# vlan 10

Hostname(config-vlan)# name office 10

3、配置VLAN接口的IP地址
在SVI接口配置模式下,通过ip address ipv4-address { mask | mask-length }命令配置SVI接口的IP地址。

# 进入VLAN 10的SVI接口配置模式,配置SVI接口的IP地址。

Hostname> enable

Hostname# configure terminal

Hostname(config)# interface vlan 10

Hostname(config-if-VLAN 10)# ip address 10.10.29.1 255.255.255.0

4、将接口添加到指定VLAN

在二层以太网接口配置模式/二层聚合接口配置模式下,通过switchport mode access命令配置二层接口为Access口,通过switchport access vlan vlan-id命令配置Access口加入指定VLAN。

在VLAN配置模式下,通过add interface { interface-type interface-number | range interface-type interface-range }命令配置Access口加入本VLAN。

# 配置二层以太网接口为Access口并加入VLAN 2。(接口配置模式)

Hostname> enable

Hostname# configure terminal

Hostname(config)# interface gigabitethernet 0/1

Hostname(config-if-GigabitEthernet 0/1)# switchport

Hostname(config-if-GigabitEthernet 0/1)# switchport mode access

Hostname(config-if-GigabitEthernet 0/1)# switchport access vlan 2

 

# 配置二层以太网接口为Access口并加入VLAN 10。(VLAN配置模式)

Hostname> enable

Hostname# configure terminal

Hostname(config)# interface gigabitethernet 0/1

Hostname(config-if-GigabitEthernet 0/1)# switchport

Hostname(config-if-GigabitEthernet 0/1)# switchport mode access

Hostname(config-if-GigabitEthernet 0/1)# exit

Hostname(config)# vlan 10

Hostname(config-vlan)# add interface gigabitethernet 0/1

Hostname(config-vlan)# end

5、清除VLAN接口的IP地址

在SVI接口配置模式下,通过no ip address [ ipv4-address { mask | mask-length }命令清除VLAN接口的IP地址。

# 进入VLAN 2的SVI接口配置模式,清除SVI接口的IP地址。

Hostname> enable

Hostname# configure terminal

Hostname(config)# interface vlan 2

Hostname(config-if-VLAN 2)# no ip address

配置不同VLAN间进行通信,请参阅 :
锐捷网管交换机配置不同VLAN间进行通信的操作方法

ICP备案号:晋ICP备18007549号-1
站长微信:13613567205