Vlan configuration example, Network requirements, Configuration procedure – H3C Technologies H3C S5120 Series Switches User Manual

Page 152

Advertising
background image

1-10

To do...

Use the command…

Remarks

[

interface-number

] ]

VLAN Configuration Example

Network requirements

z

Device A connects to Device B through a trunk port GigabitEthernet 1/0/1;

z

The default VLAN ID of GigabitEthernet 1/0/1 is 100;

z

GigabitEthernet 1/0/1 allows packets from VLAN 2, VLAN 6 through VLAN 50, and VLAN 100 to

pass through.

Figure 1-4 Network diagram for port-based VLAN configuration

Configuration procedure

1) Configure Device A

# Create VLAN 2, VLAN 6 through VLAN 50, and VLAN 100.

<DeviceA> system-view

[DeviceA] vlan 2

[DeviceA-vlan2] quit

[DeviceA] vlan 100

[DeviceA-vlan100] vlan 6 to 50

Please wait... Done.

# Enter GigabitEthernet 1/0/1 interface view.

[DeviceA] interface GigabitEthernet 1/0/1

# Configure GigabitEthernet 1/0/1 as a trunk port and configure its default VLAN ID as 100.

[DeviceA-GigabitEthernet1/0/1] port link-type trunk

[DeviceA-GigabitEthernet1/0/1] port trunk pvid vlan 100

# Configure GigabitEthernet 1/0/1 to deny the packets of VLAN 1 (by default, the packets of VLAN 1 are

permitted to pass through on all the ports).

[DeviceA-GigabitEthernet1/0/1] undo port trunk permit vlan 1

# Configure GigabitEthernet 1/0/1 to permit packets from VLAN 2, VLAN 6 through VLAN 50, and VLAN

100 to pass through.

[DeviceA-GigabitEthernet1/0/1] port trunk permit vlan 2 6 to 50 100

Please wait... Done.

[DeviceA-GigabitEthernet1/0/1] quit

[DeviceA] quit

2) Configure Device B as you configure Device A.

Advertising