Example for Configuring GVRP
Networking Requirements
In Figure 8-6, Company A's headquarters and its branch are connected through multiple switches. The headquarters and its branch need to communicate. As businesses develop, Company A's sales department has business dealings with Company B's procurement department. GVRP needs to be used to enable Company B's procurement department (VLAN 100, VLANs 102 to 105) to communicate with Company A's sales department (VLAN 100, VLANs 102 to 105). Company B's other departments have no business dealings with Company A, and they do not need to communicate with Company A.
Configuration Roadmap
The configuration roadmap is as follows:
Enable GVRP on SwitchA, SwitchB, and SwitchC, and enable GVRP on connected interfaces to implement dynamic registration of VLANs.
Configure GVRP on all switches of Company A's headquarters and its branch and set the registration mode to normal to simplify configurations.
Configure GVRP on all switches of Company B and set the registration mode to fixed on the interface connected to Company A so that only the VLANs configured by Company B are allowed.
Procedure
- Configure SwitchA.
# Enable GVRP globally.
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] gvrp [*SwitchA] commit
# Configure 10GE1/0/1 as a trunk interface, configure 10GE1/0/1 to allow all VLANs, enable GVRP, and set the registration mode to normal.
[~SwitchA] interface 10ge 1/0/1 [~SwitchA-10GE1/0/1] port link-type trunk [*SwitchA-10GE1/0/1] port trunk allow-pass vlan all [*SwitchA-10GE1/0/1] gvrp [*SwitchA-10GE1/0/1] gvrp registration normal [*SwitchA-10GE1/0/1] commit [~SwitchA-10GE1/0/1] quit
# Configure 10GE1/0/2 as a trunk interface, configure 10GE1/0/2 to allow all VLANs, enable GVRP, and set the registration mode to normal.
[~SwitchA] interface 10ge 1/0/2 [~SwitchA-10GE1/0/2] port link-type trunk [*SwitchA-10GE1/0/2] port trunk allow-pass vlan all [*SwitchA-10GE1/0/2] gvrp [*SwitchA-10GE1/0/2] gvrp registration normal [*SwitchA-10GE1/0/2] commit [~SwitchA-10GE1/0/2] quit
The configuration of SwitchC is similar to the configuration of SwitchA, and is not mentioned here.
- Configure SwitchB.
# Enable GVRP globally and create VLAN 100 and VLANs 102 to 105.
<HUAWEI> system-view [~HUAWEI] sysname SwitchB [*HUAWEI] commit [~SwitchB] gvrp [*SwitchB] vlan batch 100 102 to 105 [*SwitchB] commit
# Configure 10GE1/0/1 as a trunk interface, configure 10GE1/0/1 to allow all VLANs, enable GVRP, and set the registration mode to fixed.
[~SwitchB] interface 10ge 1/0/1 [~SwitchB-10GE1/0/1] port link-type trunk [*SwitchB-10GE1/0/1] port trunk allow-pass vlan all [*SwitchB-10GE1/0/1] gvrp [*SwitchB-10GE1/0/1] gvrp registration fixed [*SwitchB-10GE1/0/1] commit [~SwitchB-10GE1/0/1] quit
# Configure 10GE1/0/2 as a trunk interface, configure 10GE1/0/2 to allow the VLAN that 10GE1/0/2 joins, enable GVRP, and set the registration mode to normal.
[~SwitchB] interface 10ge 1/0/2 [~SwitchB-10GE1/0/2] port link-type trunk [*SwitchB-10GE1/0/2] port trunk allow-pass vlan all [*SwitchB-10GE1/0/2] gvrp [*SwitchB-10GE1/0/2] gvrp registration normal [*SwitchB-10GE1/0/2] commit [~SwitchB-10GE1/0/2] quit
- Verify the configuration.
After the configuration is complete, employees of Company A and its branch can communicate. Employees of Company A in VLAN 100 and VLANs 102 to 105 can communicate with employees of Company B.
Run the display gvrp status command on SwitchA to check whether GVRP is enabled globally. The following information is displayed:
[~SwitchA] display gvrp status GVRP status: enabled.
Run the display gvrp statistics command on SwitchA to check GVRP statistics on the interface, including the GVRP status, number of GVRP registration failures, source MAC address of the last GVRP PDU, and registration type of each interface.
[~SwitchA] display gvrp statistics GVRP statistics on port 10GE1/0/1 GVRP status : Enabled GVRP registrations failed : 0 GVRP last PDU origin : 0000-0000-0000 GVRP registration type : Normal GVRP statistics on port 10GE1/0/2 GVRP status : Enabled GVRP registrations failed : 0 GVRP last PDU origin : 0000-0000-0000 GVRP registration type : Normal
The display on SwitchB and SwitchC is similar to SwitchA, and is not mentioned here.
Configuration Files
SwitchA configuration file
# sysname SwitchA # gvrp # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 2 to 4094 gvrp # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 2 to 4094 gvrp # return
SwitchB configuration file
# sysname SwitchB # vlan batch 100 102 to 105 # gvrp # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 2 to 4094 gvrp gvrp registration fixed # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 2 to 4094 gvrp # return
SwitchC configuration file
# sysname SwitchC # gvrp # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 2 to 4094 gvrp # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 2 to 4094 gvrp # return