One-to-one and many-to-one VLAN mapping configuration example

Network requirements

As shown in Figure 79:

To isolate traffic of the same service type from different households, configure one-to-one VLAN mappings on the wiring-closet switches. This feature assigns one VLAN to each type of traffic from each household.

To save VLAN resources, configure many-to-one VLAN mappings on the campus switch (Switch C). This feature transmits the same type of traffic from different households in one VLAN. Use VLANs 501, 502, and 503 for PC, VoD, and VoIP traffic, respectively.

Table 20: VLAN mappings for each service

Service

VLANs on home gateways

VLANs on wiring-closet switches (Switch A and Switch B)

VLANs on campus switch (Switch C)

PC

VLAN 1

VLANs 101, 102, 103, 104

VLAN 501

VoD

VLAN 2

VLANs 201, 202, 203, 204

VLAN 502

VoIP

VLAN 3

VLANs 301, 302, 303, 304

VLAN 503

Figure 79: Network diagram

Configuration procedure

  1. Configure Switch A:

    # Create the original VLANs.

    <SwitchA> system-view
    [SwitchA] vlan 2 to 3
    

    # Create the translated VLANs.

    [SwitchA] vlan 101 to 102
    [SwitchA] vlan 201 to 202
    [SwitchA] vlan 301 to 302
    

    # Configure customer-side port HundredGigE 1/0/1 as a trunk port.

    <SwitchA> system-view
    [SwitchA] interface hundredgige 1/0/1
    [SwitchA-HundredGigE1/0/1] port link-type trunk
    

    # Assign HundredGigE 1/0/1 to all original VLANs and translated VLANs.

    [SwitchA-HundredGigE1/0/1] port trunk permit vlan 1 2 3 101 201 301
    

    # Configure one-to-one VLAN mappings on HundredGigE 1/0/1 to map VLANs 1, 2, and 3 to VLANs 101, 201, and 301, respectively.

    [SwitchA-HundredGigE1/0/1] vlan mapping 1 translated-vlan 101
    [SwitchA-HundredGigE1/0/1] vlan mapping 2 translated-vlan 201
    [SwitchA-HundredGigE1/0/1] vlan mapping 3 translated-vlan 301
    [SwitchA-HundredGigE1/0/1] quit
    

    # Configure customer-side port HundredGigE 1/0/2 as a trunk port.

    [SwitchA] interface hundredgige 1/0/2
    [SwitchA-HundredGigE1/0/2] port link-type trunk
    

    # Assign HundredGigE 1/0/2 to all original VLANs and translated VLANs.

    [SwitchA-HundredGigE1/0/2] port trunk permit vlan 1 2 3 102 202 302
    

    # Configure one-to-one VLAN mappings on HundredGigE 1/0/2 to map VLANs 1, 2, and 3 to VLANs 102, 202, and 302, respectively.

    [SwitchA-HundredGigE1/0/2] vlan mapping 1 translated-vlan 102
    [SwitchA-HundredGigE1/0/2] vlan mapping 2 translated-vlan 202
    [SwitchA-HundredGigE1/0/2] vlan mapping 3 translated-vlan 302
    [SwitchA-HundredGigE1/0/2] quit
    

    # Configure the network-side port (HundredGigE 1/0/3) as a trunk port.

    [SwitchA] interface hundredgige 1/0/3
    [SwitchA-HundredGigE1/0/3] port link-type trunk
    

    # Assign HundredGigE 1/0/3 to the translated VLANs.

    [SwitchA-HundredGigE1/0/3] port trunk permit vlan 101 201 301 102 202 302
    [SwitchA-HundredGigE1/0/3] quit
    
  2. Configure Switch B in the same way Switch A is configured. (Details not shown.)

  3. Configure Switch C:

    # Enable DHCP snooping.

    <SwitchC> system-view
    [SwitchC] dhcp snooping enable
    

    # Create the original VLANs and translated VLANs, and enable ARP detection for these VLANs.

    [SwitchC] vlan 101
    [SwitchC-vlan101] arp detection enable
    [SwitchC-vlan101] vlan 201
    [SwitchC-vlan201] arp detection enable
    [SwitchC-vlan201] vlan 301
    [SwitchC-vlan301] arp detection enable
    [SwitchC-vlan301] vlan 102
    [SwitchC-vlan102] arp detection enable
    [SwitchC-vlan102] vlan 202
    [SwitchC-vlan202] arp detection enable
    [SwitchC-vlan202] vlan 302
    [SwitchC-vlan302] arp detection enable
    [SwitchC-vlan302] vlan 103
    [SwitchC-vlan103] arp detection enable
    [SwitchC-vlan103] vlan 203
    [SwitchC-vlan203] arp detection enable
    [SwitchC-vlan203] vlan 303
    [SwitchC-vlan303] arp detection enable
    [SwitchC-vlan303] vlan 104
    [SwitchC-vlan104] arp detection enable
    [SwitchC-vlan104] vlan 204
    [SwitchC-vlan204] arp detection enable
    [SwitchC-vlan204] vlan 304
    [SwitchC-vlan304] arp detection enable
    [SwitchC-vlan304] vlan 501
    [SwitchC-vlan501] arp detection enable
    [SwitchC-vlan501] vlan 502
    [SwitchC-vlan502] arp detection enable
    [SwitchC-vlan502] vlan 503
    [SwitchC-vlan503] arp detection enable
    [SwitchC-vlan503] quit
    

    # Configure customer-side port HundredGigE 1/0/1 as a trunk port.

    [SwitchC] interface hundredgige 1/0/1
    [SwitchC-HundredGigE1/0/1] port link-type trunk
    

    # Assign HundredGigE 1/0/1 to all original VLANs and translated VLANs.

    [SwitchC-HundredGigE1/0/1] port trunk permit vlan 101 102 201 202 301 302 501 to 503
    

    # Configure many-to-one VLAN mappings on HundredGigE 1/0/1 to map VLANs for PC, VoD, and VoIP traffic to VLANs 501, 502, and 503, respectively.

    [SwitchC-HundredGigE1/0/1] vlan mapping uni range 101 to 102 translated-vlan 501
    [SwitchC-HundredGigE1/0/1] vlan mapping uni range 201 to 202 translated-vlan 502
    [SwitchC-HundredGigE1/0/1] vlan mapping uni range 301 to 302 translated-vlan 503
    

    # Enable DHCP snooping entry recording on HundredGigE 1/0/1.

    [SwitchC-HundredGigE1/0/1] dhcp snooping binding record
    [SwitchC-HundredGigE1/0/1] quit
    

    # Configure customer-side port HundredGigE 1/0/2 as a trunk port.

    [SwitchC] interface hundredgige 1/0/2
    [SwitchC-HundredGigE1/0/2] port link-type trunk
    

    # Assign HundredGigE 1/0/2 to all original VLANs and translated VLANs.

    [SwitchC-HundredGigE1/0/2] port trunk permit vlan 103 104 203 204 303 304 501 to 503
    

    # Configure many-to-one VLAN mappings on HundredGigE 1/0/2 to map VLANs for PC, VoD, and VoIP traffic to VLANs 501, 502, and 503, respectively.

    [SwitchC-HundredGigE1/0/2] vlan mapping uni range 103 to 104 translated-vlan 501
    [SwitchC-HundredGigE1/0/2] vlan mapping uni range 203 to 204 translated-vlan 502
    [SwitchC-HundredGigE1/0/2] vlan mapping uni range 303 to 304 translated-vlan 503
    

    # Enable recording of client information in DHCP snooping entries on HundredGigE 1/0/2.

    [SwitchC-HundredGigE1/0/2] dhcp snooping binding record
    [SwitchC-HundredGigE1/0/2] quit
    

    # Configure the network-side port HundredGigE 1/0/3 as a trunk port.

    [SwitchC-HundredGigE1/0/3] port link-type trunk
    

    # Assign HundredGigE 1/0/3 to the translated VLANs.

    [SwitchC-HundredGigE1/0/3] port trunk permit vlan 501 to 503
    

    # Configure HundredGigE 1/0/3 as a DHCP snooping trusted and ARP trusted port.

    [SwitchC-HundredGigE1/0/3] dhcp snooping trust
    [SwitchC-HundredGigE1/0/3] arp detection trust
    [SwitchC-HundredGigE1/0/3] quit
    
  4. Configure Switch D:

    # Create the translated VLANs.

    <SwitchD> system-view
    [SwitchD] vlan 501 to 503
    

    # Configure HundredGigE 1/0/1 as a trunk port.

    <SwitchD> system-view
    [SwitchD] interface hundredgige 1/0/1
    [SwitchD-HundredGigE1/0/1] port link-type trunk
    

    # Assign HundredGigE 1/0/1 to the translated VLANs.

    [SwitchD-HundredGigE1/0/1] port trunk permit vlan 501 to 503
    [SwitchD-HundredGigE1/0/1] quit
    

Verifying the configuration

# Verify VLAN mapping information on the wiring-closet switches, for example, Switch A.

[SwitchA] display vlan mapping
Interface HundredGigE1/0/1:
  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN
  1             N/A           101                      N/A
  2             N/A           201                      N/A
  3             N/A           301                      N/A
Interface HundredGigE1/0/2:
  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN
  1             N/A           102                      N/A
  2             N/A           202                      N/A
  3             N/A           302                      N/A

# Verify VLAN mapping information on Switch C.

[SwitchC] display vlan mapping
Interface HundredGigE1/0/1:
  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN
  101-102       N/A           501                      N/A
  201-202       N/A           502                      N/A
  301-302       N/A           503                      N/A
Interface HundredGigE1/0/2:
  Outer VLAN    Inner VLAN    Translated Outer VLAN    Translated Inner VLAN
  103-104       N/A           501                      N/A
  203-204       N/A           502                      N/A
  303-304       N/A           503                      N/A