The topology is as follows:
Configuration of SW1:
[H3C-GigabitEthernet1/0/1]vlan 10
[H3C-vlan10]port g1/0/1
[H3C-vlan10]vlan 20
[H3C-vlan20]port g1/0/2
[H3C-vlan20]vlan 30
[H3C-vlan30]port g1/0/3
[H3C-vlan30]private-vlan secondary 10 20
[H3C-vlan30]int vlan 30
[H3C-Vlan-interface30]ip add 1.1.1.1 24
[H3C-vlan30]int g0/0/1
[H3C-GigabitEthernet1/0/1]port private host
[H3C-GigabitEthernet1/0/1]int g1/0/2
[H3C-GigabitEthernet1/0/2]port private host
[H3C-GigabitEthernet1/0/2]int g1/0/3
[H3C-GigabitEthernet1/0/3]port private-vlan 30 promiscuous
SW2 configuration
[H3C]vlan 40
[H3C-vlan40]port g1/0/2
[H3C-vlan40]vlan 50
[H3C-vlan50]port g1/0/1
[H3C-vlan50]private-vlan primary
[H3C-vlan50]private-vlan secondary 40
[H3C-vlan50]int vlan 50
[H3C-Vlan-interface50]ip add 1.1.1.2 24
[H3C-Vlan-interface50]int g1/0/1
[H3C-GigabitEthernet1/0/1]port private-vlan 50 promiscuous
[H3C-GigabitEthernet1/0/1]int g1/0/2
[H3C-GigabitEthernet1/0/2]port private-vlan host
Check the configuration on each port of the SW1 port. As you can see in the figure, if private-vlan is configured, the port type will automatically become hybrid
Check the mac address table on SW1, as shown in the
summary
. Steps to configure private vlan
1. Create a vlan and add the corresponding interface to the vlan as access
2. In the primary vlan view, determine the primary vlan and establish the relationship with the secondary vlan
3. In the interface view, determine whether the port type is promiscuous or host