Example for Configuring VLAN Aggregation
Networking Requirements
A company has many departments that reside on the same network segment. For security purposes, the company adds different departments to different VLANs. Users in different departments need to communicate with each other.
In Figure 5-27, VLAN 2 and VLAN 3 are assigned to different departments, SwitchA is the access device, and SwitchB is the gateway. Users in VLAN 2 and VLAN 3 need to communicate with each other.
Configuration Roadmap
You can configure VLAN aggregation on SwitchB and add VLANs of different departments to the super-VLAN so that users in different departments can access the Internet using the super-VLAN. Proxy ARP can be configured in the super-VLAN so that users in different departments can communicate with each other. The configuration roadmap is as follows:
Configure VLANs and interfaces on SwitchA and SwitchB, add users of different departments to different VLANs, and configure interfaces on SwitchA and SwitchB to transparently transmit packets from VLANs.
Configure a super-VLAN, a VLANIF interface, and a static route on SwitchB to provide Internet access for hosts.
Configure proxy ARP in the super-VLAN on SwitchB so that users in different departments can communicate at Layer 3.
Procedure
- Configure VLANs and interfaces on SwitchA and SwitchB, add users of different departments to different VLANs, and configure an interface to transparently transmit packets to SwitchB.
- Configure a super-VLAN and a VLANIF interface corresponding to the super-VLAN.
# Configure super-VLAN 4 on SwitchB and add VLAN 2 and VLAN 3 to super-VLAN 4 as sub-VLANs.
[~SwitchB] vlan 4 [~SwitchB-vlan4] aggregate-vlan [*SwitchB-vlan4] access-vlan 2 to 3 [*SwitchB-vlan4] quit [*SwitchB] commit
# Create and configure VLANIF 4 so that users in different departments can access the Internet using super-VLAN 4.
[~SwitchB] interface vlanif 4 [*SwitchB-Vlanif4] ip address 10.1.1.1 24 [*SwitchB-Vlanif4] quit [*SwitchB] commit
- Configure a static route.
# Configure the uplink interface 10GE1/0/1 on SwitchB to transparently transmit packets from the VLAN to which SwitchB and the router belong.
[~SwitchB] interface 10ge 1/0/1 [~SwitchB-10GE1/0/1] port link-type trunk [*SwitchB-10GE1/0/1] port trunk allow-pass vlan 10 [*SwitchB-10GE1/0/1] quit [*SwitchB] commit
# Create and configure VLANIF 10 and specify its IP address of VLANIF 10 as the IP address for connecting SwitchB and the router.
[~SwitchB] interface vlanif 10 [*SwitchB-Vlanif10] ip address 10.10.1.1 24 [*SwitchB-Vlanif10] quit [*SwitchB] commit
# On SwitchB, configure a static route to the router so that users can access the Internet.
[~SwitchB] ip route-static 0.0.0.0 0.0.0.0 10.10.1.2 [*SwitchB] commit
Configure the router interface connected to SwitchB and assign to it the IP address of 10.10.1.2. For details, see the router configuration manual.
- Assign IP addresses to servers.
Configure an IP address for each server. Ensure that the servers reside on the same network segment as VLAN 4.
After the preceding steps are complete, servers in each department can access the Internet. However, servers in VLAN 2 and VLAN 3 cannot ping each other. Proxy ARP needs to be configured on SwitchB.
- Configure proxy ARP.
# Configure proxy ARP in super-VLAN 4 on SwitchB so that users in different departments can communicate at Layer 3.
[~SwitchB] interface vlanif 4 [~SwitchB-Vlanif4] arp proxy inter-vlan enable [*SwitchB-Vlanif4] quit [*SwitchB] commit
- Verify the configuration.
After the configuration is complete, users in VLAN 2 and VLAN 3 can ping each other and access the Internet.
Configuration Files
- SwitchA configuration file
# sysname SwitchA # vlan batch 2 to 3 # interface 10GE1/0/1 port default vlan 2 # interface 10GE1/0/2 port default vlan 2 # interface 10GE1/0/3 port default vlan 3 # interface 10GE1/0/4 port default vlan 3 # interface 10GE1/0/5 port link-type trunk port trunk allow-pass vlan 2 to 3 # return
SwitchB configuration file
# sysname SwitchB # vlan batch 2 to 4 10 # vlan 4 aggregate-vlan access-vlan 2 to 3 # interface Vlanif4 ip address 10.1.1.1 255.255.255.0 arp proxy inter-vlan enable # interface Vlanif10 ip address 10.10.1.1 255.255.255.0 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 10 # interface 10GE1/0/5 port link-type trunk port trunk allow-pass vlan 2 to 3 # ip route-static 0.0.0.0 0.0.0.0 10.10.1.2 # return