[RouterA-Vlanif10] quit
[RouterA] interface vlanif 30
[RouterA-Vlanif30] ip address 10.10.30.1 24
[RouterA-Vlanif30] quit
# Configure basic OSPF functions.
[RouterA] router id 1.1.1.1
[RouterA] ospf
[RouterA-ospf-1] area 0
[RouterA-ospf-1-area-0.0.0.0] network 10.10.10.0 0.0.0.255
[RouterA-ospf-1-area-0.0.0.0] network 10.10.30.0 0.0.0.255
[RouterA-ospf-1-area-0.0.0.0] quit
Step 2 Configure RouterB.
# Create VLANs.
<Huawei> system-view
[Huawei] sysname RouterB
[RouterB] vlan batch 10 30
# Add interfaces to the VLANs.
[RouterB] interface ethernet 2/0/2
[RouterB-Ethernet2/0/2] port link-type trunk
[RouterB-Ethernet2/0/2] port trunk allow-pass vlan 10
[RouterB-Ethernet2/0/2] quit
[RouterB] interface ethernet 2/0/1
[RouterB-Ethernet2/0/1] port link-type trunk
[RouterB-Ethernet2/0/1] port trunk allow-pass vlan 30
[RouterB-Ethernet2/0/1] quit
# Assign IP addresses to the VLANIF interfaces.
[RouterB] interface vlanif 10
[RouterB-Vlanif10] ip address 10.10.20.1 24
[RouterB-Vlanif10] quit
[RouterB] interface vlanif 30
[RouterB-Vlanif30] ip address 10.10.30.2 24
[RouterB-Vlanif30] quit
# Configure basic OSPF functions.
[RouterB] router id 2.2.2.2
[RouterB] ospf
[RouterB-ospf-1] area 0
[RouterB-ospf-1-area-0.0.0.0] network 10.10.20.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.0] network 10.10.30.0 0.0.0.255
[RouterB-ospf-1-area-0.0.0.0] quit
Step 3 Verify the configuration.
# On the computer on the Layer 2 network connected to RouterA, set the default gateway address
to the IP address of VLANIF 10 (10.10.10.1/24 in this example).
# On the computer on the Layer 2 network connected to RouterB, set the default gateway address
to the IP address of VLANIF 10 (10.10.20.1/24 in this example).
# After the configurations are complete, computers on the two Layer 2 networks are isolated at
Layer 2 and can communicate at Layer 3.
----End
Huawei AR530&AR550 Series Industrial Switch Routers
Configuration Guide - Ethernet Switching
3 VLAN Configuration
Issue 01 (2014-11-30) Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
115