122
[SwitchA] interface vlan-interface 5
[SwitchA-Vlan-interface5] ip address 192.168.0.10 24
[SwitchA-Vlan-interface5] quit
# Create VLAN-interface 10 and configure its IP address as 192.168.1.20/24.
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] ip address 192.168.1.20 24
[SwitchA-Vlan-interface10] return
2.
Configure the default gateway of PC A as 192.168.0.10.
3.
Configure the default gateway of PC B as 192.168.1.20.
Verifying the configurations
1.
The PCs can ping each other.
2.
Display brief information about Layer 3 interfaces on Switch A to verify the configuration.
<SwitchA> display ip interface brief
*down: administratively down
(s): spoofing
Interface Physical Protocol IP Address Description
Vlan-interface5 up up 192.168.0.10 Vlan-inte...
Vlan-interface10 up up 192.168.1.20 Vlan-inte...
Configuring port-based VLANs
Introduction to port-based VLAN
Port-based VLANs group VLAN members by port. A port forwards traffic for a VLAN only after it is
assigned to the VLAN.
Port link type
You can configure the link type of a port as access, trunk, or hybrid. The link types use the following
VLAN tag handling methods:
•
An access port belongs to only one VLAN and sends traffic untagged. It is usually used to connect
a terminal device unable to identify VLAN tagged-packets or when separating different VLAN
members is unnecessary.
•
A trunk port can carry multiple VLANs to receive and send traffic for them. Except traffic from the
port VLAN ID (PVID), traffic sent through a trunk port will be VLAN tagged. Usually, ports that
connect network devices are configured as trunk ports.
•
Like a trunk port, a hybrid port can carry multiple VLANs to receive and send traffic for them. Unlike
a trunk port, a hybrid port allows traffic of all VLANs to pass through VLAN untagged. You can
configure a port connected to a network device or user terminal as a hybrid port.
PVID
By default, VLAN 1 is the PVID for all ports. You can configure the PVID for a port as required.
When you configure the PVID on a port, use the following guidelines:
•
An access port can join only one VLAN. The VLAN to which the access port belongs is the PVID of
the port.
•
A trunk or hybrid port can join multiple VLANs. You can configure a PVID for the port.