Table of Contents

H3C VLAN Configuration Examples



Show

Operation Command
Show VLAN > display vlan all
Show Configuration including VLAN > display current-configuration

Create VLAN

<testsw-1> system-view
[testsw-1] vlan 2
[testsw-1-vlan2] quit
<testsw-1> system-view
[testsw-1] vlan 10 to 20


Access Port (1 VLAN)

<testsw-1> system-view
[testsw-1-vlan2] interface GigabitEthernet 1/0/1
[testsw-1-GigabitEthernet1/0/1] port link-type access
[testsw-1-GigabitEthernet1/0/1] port access vlan 2
[testsw-1-GigabitEthernet1/0/1] save
[testsw-1-GigabitEthernet1/0/1] quit
[testsw-1] quit
<testsw-1> quit
<testsw-1> system-view
[testsw-1] interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/10
[testsw-1-if-range] port link-type access
[testsw-1-if-range] port access vlan 2
[testsw-1-if-range] save
[testsw-1-if-range] quit
[testsw-1] quit
<testsw-1> quit

Delete Access VLAN

<testsw-1> system-view
[testsw-1-vlan2] interface GigabitEthernet 1/0/1
[testsw-1-GigabitEthernet1/0/1] undo port access vlan
[testsw-1-GigabitEthernet1/0/1] save
[testsw-1-GigabitEthernet1/0/1] quit
[testsw-1] quit
<testsw-1> quit


Tag VLAN (Multiple VLAN)

<testsw-1> system-view
[testsw-1] interface GigabitEthernet 1/0/1
[testsw-1-GigabitEthernet1/0/1] port link-type trunk
[testsw-1-GigabitEthernet1/0/1] undo port trunk permit vlan 1
[testsw-1-GigabitEthernet1/0/1] port trunk permit vlan 3 10 200
[testsw-1-GigabitEthernet1/0/1] save
[testsw-1-GigabitEthernet1/0/1] quit

VLAN Add

<testsw-1> system-view
[testsw-1] interface GigabitEthernet 1/0/1
[testsw-1-GigabitEthernet1/0/1] port trunk permit vlan 30
[testsw-1-GigabitEthernet1/0/1] save
[testsw-1-GigabitEthernet1/0/1] quit

VLAN Delete

<testsw-1> system-view
[testsw-1] interface GigabitEthernet 1/0/1
[testsw-1-GigabitEthernet1/0/1] undo port trunk permit vlan 30
[testsw-1-GigabitEthernet1/0/1] save
[testsw-1-GigabitEthernet1/0/1] quit


Delete Configuration

[test-sw-1-GigabitEthernet1/0/16]undo port link-type 
 Please wait........................................... Done.
[test-sw-1-GigabitEthernet1/0/16]

[test-sw-1-GigabitEthernet1/0/16]display current-configuration
(abbr)
#               
interface GigabitEthernet1/1/6
#
(abbr)


HPE(H3C) CLI Commands