02-VLAN Configuration Guide HP Comware
02-VLAN Configuration Guide HP Comware
Network Diagram
Figure 1-1 Network diagram for port-based VLAN configuration
VLAN10
192.168.10.0/24
Server
Eth1/0/1
SwitchA
VLAN100
192.168.100.0/24
Eth1/0/2
Eth1/0/3
HostA
Eth1/0/10
SwitchB
Eth1/0/12
HostC
VLAN102
192.168.102.0/24
Eth1/0/11
HostB
VLAN101
192.168.101.0/24
1-1
Software version
Hardware version
S5600 series
All versions
S5100-SI/EI series
All versions
S3600-SI/EI series
All versions
S3100-EI series
All versions
All versions
S3100-52P
S3100-C-SI series
S3100-T-SI series
S3100-52P
The S3600-SI/EI series and S5600 series switches can operate as Switch A in Figure 1-1 for forwarding
packets at Layer 3 for VLANs. The other models in the table above do not support configuring multiple
VLAN interfaces for Layer-3 forwarding, and therefore, they can operate as only Switch B for Layer-2
isolation with VLANs, as shown in Figure 1-1.
Configuration Procedure
z
Configure Switch A
# Create VLAN 100 on Switch A and assign Ethernet 1/0/2 to VLAN 100.
[SwitchA] vlan 100
[SwitchA-vlan100] port Ethernet 1/0/2
[SwitchA-vlan100] quit
# Create VLAN-interface 10, VLAN-interface 100, VLAN-interface 101, and VLAN-interface 102, and
configure an IP address for each of these VLAN-interfaces.
[SwitchA] interface Vlan-interface 10
[SwitchA-Vlan-interface10] ip address 192.168.10.1 24
[SwitchA-Vlan-interface10] quit
[SwitchA] interface Vlan-interface 100
[SwitchA-Vlan-interface100] ip address 192.168.100.1 24
[SwitchA-Vlan-interface100] quit
[SwitchA] interface Vlan-interface 101
[SwitchA-Vlan-interface101] ip address 192.168.101.1 24
1-2
[SwitchA-Vlan-interface101] quit
[SwitchA] interface Vlan-interface 102
[SwitchA-Vlan-interface102] ip address 192.168.102.1 24
[SwitchA-Vlan-interface102] quit
# Configure Ethernet 1/0/3 of Switch A to be a trunk port and to permit the packets carrying the tag of
VLAN 101 or VLAN 102 to pass through.
[SwitchA] interface Ethernet 1/0/3
[SwitchA-Ethernet1/0/3] port link-type trunk
[SwitchA-Ethernet1/0/3] port trunk permit vlan 101 102
Configure Switch B
# Create VLAN 101 on Switch B, and assign Ethernet 1/0/11 to VLAN 101.
[SwitchB] vlan 101
[SwitchB-vlan101] port Ethernet 1/0/11
[SwitchB-vlan101] quit
# Create VLAN 102 on Switch B, and assign Ethernet 1/0/12 to VLAN 102.
[SwitchB] vlan 102
[SwitchB-vlan102] port Ethernet 1/0/12
[SwitchB-vlan102] quit
# Configure Ethernet 1/0/10 of Switch B to be a trunk port and to permit the packets carrying the tag of
VLAN 101 or VLAN 102 to pass through.
[SwitchB] interface Ethernet 1/0/10
[SwitchB-Ethernet1/0/10] port link-type trunk
[SwitchB-Ethernet1/0/10] port trunk permit vlan 101 102
Complete Configuration
Configuration on Switch A
#
vlan 10
#
vlan 100
#
vlan 101
#
vlan 102
#
interface Vlan-interface 10
ip address 192.168.10.1 255.255.255.0
#
interface Vlan-interface 100
ip address 192.168.100.1 255.255.255.0
#
interface Vlan-interface 101
ip address 192.168.101.1 255.255.255.0
#
interface Vlan-interface 102
1-3
Configuration on Switch B
#
vlan 101
#
vlan 102
#
interface Ethernet1/0/10
port link-type trunk
port trunk permit vlan 1 101 102
#
interface Ethernet1/0/11
port access vlan 101
#
interface Ethernet1/0/12
port access vlan 201
Precautions
z
After you assign the servers and the workstations to different VLANs, they cannot communicate
with each other. For them to communicate, you need to configure a Layer 3 VLAN interface for
each of them on the switches.
After you telnet to an Ethernet port on a switch to make configuration, do not remove the port from
its current VLAN. Otherwise, your Telnet connection will be disconnected.
1-4
Network Diagram
Figure 1-2 Network diagram for protocol-based VLAN configuration
IP Server
AppleTalk Server
Eth1/0/11
Eth1/0/12
Eth1/0/10
IP Host
AppleTalk Host
Workroom
Software version
Hardware version
S5600 series
All versions
S5100-SI/EI series
All versions
S3600-SI/EI series
All versions
S3100-EI series
All versions
S3100-52P
S3100-52P
Configuration Procedure
# Create VLAN 100 and assign Ethernet1/0/11 to VLAN 100.
[H3C] vlan 100
[H3C-vlan100] port Ethernet 1/0/11
1-5
[H3C-vlan200] quit
[H3C] vlan 100
[H3C-vlan100] protocol-vlan ip
Create a user-defined protocol template for VLAN 100 to carry ARP for IP communication, assuming
that Ethernet_II encapsulation is used.
[H3C-vlan100] protocol-vlan mode ethernetii etype 0806
Configure Ethernet 1/0/10 to be a hybrid port and to remove the outer VLAN tag when forwarding
packets of VLAN 100 and VLAN 200.
[H3C-vlan100] quit
[H3C] interface Ethernet 1/0/10
[H3C-Ethernet1/0/10] port link-type hybrid
[H3C-Ethernet1/0/10] port hybrid vlan 100 200 untagged
Bind Ethernet 1/0/10 to protocol template 0 and protocol template 1 of VLAN 100, and protocol template
0 of VLAN 200.
When configuring a protocol template, you can assign a number to the template. If you fail to do that, the
system automatically assigns the lowest available number to the template. Thus, in this configuration
example, the two protocol templates for VLAN 100 are automatically numbered 0 and 1, and the
protocol template for VLAN 200 is numbered 0.
Complete Configuration
#
vlan 100
protocol-vlan 0 ip
protocol-vlan 1 mode ethernetii etype 0806
#
vlan 200
protocol-vlan 0 at
#
interface Ethernet1/0/10
port link-type hybrid
port hybrid vlan 1 100 200 untagged
port hybrid protocol-vlan vlan 100 0
port hybrid protocol-vlan vlan 100 1
port hybrid protocol-vlan vlan 200 0
#
interface Ethernet1/0/11
port access vlan 100
#
interface Ethernet1/0/12
1-6
Precautions
z
At present, the S3100 series support only the standard templates of AppleTalk and IP, the standard
template of IPX encapsulated in Ethernet II format, and the user-defined templates matching the
Ethernet II encapsulation format. Protocol templates matching 802.2/802.3 encapsulation formats
and their extended encapsulation formats are not supported on the S3100 series currently.
Because IP depends on ARP for address resolution in Ethernet, you are recommended to
configure the IP and ARP templates in the same VLAN and associate them with the same port to
prevent communication failure.
1-7