R3303-HP HSR6800 Routers Layer 2 - LAN Switching Configuration Guide

108
Configure Router to transmit packets over separate VLANs based on their source IP addresses.
Figure 40 Network diagram
Configuration considerations
Create VLANs 100 and 200.
Associate IP subnets with the VLANs.
Assign ports to the VLANs.
Configuration procedure
# Associate IP subnet 192.168.5.0/24 with VLAN 100.
<Router> system-view
[Router] vlan 100
[Router-vlan100] ip-subnet-vlan ip 192.168.5.0 255.255.255.0
[Router-vlan100] quit
# Associate IP subnet 192.168.50.0/24 with VLAN 200.
[Router] vlan 200
[Router-vlan200] ip-subnet-vlan ip 192.168.50.0 255.255.255.0
[Router-vlan200] quit
# Configure interface GigabitEthernet 4/0/11 to permit packets of VLAN 100 to pass through.
[Router] interface GigabitEthernet 4/0/11
[Router-GigabitEthernet4/0/11] port link-type hybrid
[Router-GigabitEthernet4/0/11] port hybrid vlan 100 tagged
Please wait... Done.
[Router-GigabitEthernet4/0/11] quit
# Configure interface GigabitEthernet 4/0/12 to permit packets of VLAN 200 to pass through.
Device A Device B
Office
192.168.5.0/24 192.168.50.0/24
Router
VLAN 100 VLAN 200
GE4/0/11 GE4/0/12
GE4/0/1