Assigning a trunk port to a vlan – H3C Technologies H3C SecBlade NetStream Cards User Manual

Page 106

Advertising
background image

91

To do…

Use the command…

Remarks

Enter system view

system-view

Enter Layer 2 Ethernet interface
view

interface interface-type
interface-number

Configure the link type of the port
or ports as access

port link-type access

Optional
By default, the link type of a port is
access.

Assign the current access port(s) to
a VLAN

port access vlan vlan-id

Optional
By default, all access ports belong
to VLAN 1.

NOTE:

Before assigning an access port to a VLAN, create the VLAN first.

In VLAN view, only Layer 2 Ethernet interfaces can be assigned to the current VLAN.

The link type of Layer 2 Ethernet subinterfaces is fixed at access. You can assign them to a VLAN in
either of the preceding approaches.

Assigning a trunk port to a VLAN

A trunk port can carry multiple VLANs. You can assign it to a VLAN in Layer 2 Ethernet interface view

only .
Follow these steps to assign a trunk port to one or multiple VLANs:

To do…

Use the command…

Remarks

Enter system view

system-view

Enter Layer 2 Ethernet interface
view

interface interface-type
interface-number

Configure the link type of the port
or ports as trunk

port link-type trunk

Required

Assign the trunk port(s) to the
specified VLAN(s)

port trunk permit vlan { vlan-id-list
| all }

Required
By default, a trunk port carries only
VLAN 1.

Configure the default VLAN of the
trunk port(s)

port trunk pvid vlan vlan-id

Optional
By default, VLAN 1 is the default
VLAN.

NOTE:

To change the link type of a port from trunk to hybrid or vice versa, you must set the link type to access
first.

After configuring the default VLAN for a trunk port, you must use the port trunk permit vlan command
to configure the trunk port to allow packets from the default VLAN to pass through, so that the egress

port can forward packets from the default VLAN.

Advertising