Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Using DHCP Relay Option 82 to Pass IEEE 802.1p Values to DHCP Servers

    This example shows how you can use the DHCP relay agent option 82 feature to enable the DHCP server to assign an IP address to provide the desired service to the DHCP client.

    Requirements

    This example uses the following software and hardware components:

    • JunosE Release 7.1.0 or higher-numbered releases
    • E Series router (ERX7xx models, ERX14xx models, the ERX310 router, the E120 router, or the E320 router)
    • ASIC-based line modules that support Fast Ethernet or Gigabit Ethernet

    Overview

    Using the DHCP relay agent option 82 feature, you can configure an environment in which a customized DHCP server assigns an IP address that provides the desired service to the DHCP client.

    The DHCP server uses information based on the IEEE 802.1p values, which are extracted from the DHCP packets using JunosE Software layer 2 policies, to determine the appropriate IP address to assign to the client.

    This type of environment, which is illustrated in Figure 1, includes the following components:

    • Layer 2 policy on the ingress interface (that is, the interface that receives the client's DHCP packet) that maps the 802.1p value from the packet to a user packet class (UPC.)

      Note: To ensure optimal performance when mapping 802.1p values to UPCs, order the classifier groups in the VLAN policy list with the most often used UPC values listed first.

    • DHCP relay agent option 82 configuration that enables Vendor-Specific suboption type 2 (User Packet Class) support and maps the Layer 2 policy user packet class to the option 82 user packet class suboption.
    • Customized DHCP server configuration that assigns IP addresses based on the option 82 user packet class suboption. The IP address is associated with the appropriate quality, type, or class of service for the user packet class specified in the option 82 suboption.

      Figure 1: Passing 802.1p Values to the DHCP Server

      Passing 802.1p Values to the DHCP Server

    Configuring DHCP Relay Option 82 to Pass IEEE 802.1p Values to DHCP Servers

    Step-by-Step Procedure

    The following example describes a sample procedure that creates an environment that passes 802.1p values to the DHCP server, which then assigns an IP address that enables the desired service to the DHCP client:

    1. Configure a layer 2 policy that maps 802.1p values to user packet class values for a VLAN interface.
      host1(config)# vlan classifier-list dot1p0 user-priority 0
      host1(config)# vlan classifier-list dot1p1 user-priority 1
      host1(config)# vlan classifier-list dot1p2 user-priority 2
      host1(config)# vlan classifier-list dot1p3 user-priority 3
      host1(config)# vlan classifier-list dot1p4 user-priority 4
      host1(config)# vlan classifier-list dot1p5 user-priority 5
      host1(config)# vlan classifier-list dot1p6 user-priority 6
      host1(config)# vlan classifier-list dot1p7 user-priority 7 
      host1(config)# vlan policy-list dot1pToUpc
      host1(config-policy-list)# classifier-group dot1p0
      host1(config-policy-list-classifier-group)# user-packet-class 0
      host1(config-policy-list-classifier-group)#exit
      host1(config-policy-list)# classifier-group dot1p1
      host1(config-policy-list-classifier-group)# user-packet-class 1
      host1(config-policy-list-classifier-group)#exit
      host1(config-policy-list)# classifier-group dot1p2
      host1(config-policy-list-classifier-group)# user-packet-class 2
      host1(config-policy-list-classifier-group)#exit
      host1(config-policy-list)# classifier-group dot1p3
      host1(config-policy-list-classifier-group)# user-packet-class 3
      host1(config-policy-list-classifier-group)#exit
      host1(config-policy-list)# classifier-group dot1p4
      host1(config-policy-list-classifier-group)# user-packet-class 4
      host1(config-policy-list-classifier-group)#exit
      host1(config-policy-list)# classifier-group dot1p5
      host1(config-policy-list-classifier-group)# user-packet-class 5
      host1(config-policy-list-classifier-group)#exit
      host1(config-policy-list)# classifier-group dot1p6
      host1(config-policy-list-classifier-group)# user-packet-class 6
      host1(config-policy-list-classifier-group)#exit
      host1(config-policy-list)# classifier-group dot1p7
      host1(config-policy-list-classifier-group)# user-packet-class 7
      host1(config-policy-list-classifier-group)#exit
      host1(config-policy-list)#exit
      host1(config)# profile atm1483BaseProfile
      host1(config-profile)# vlan policy input dot1pToUpc statistics enabled
      host1(config-profile)#exit
      host1(config)#
    2. (Optional) Verify the policy list configuration.
      host1(config)# run show policy-list dot1pToUpc
      
                                        Policy Table
                                        ------ -----
      VLAN Policy dot1pToUpc
         Administrative state: enable
         Reference count:      1
         Classifier control list: dot1p0, precedence 100
            user-packet-class 0
         Classifier control list: dot1p1, precedence 100
            user-packet-class 1
         Classifier control list: dot1p2, precedence 100
            user-packet-class 2
         Classifier control list: dot1p3, precedence 100
            user-packet-class 3
         Classifier control list: dot1p4, precedence 100
            user-packet-class 4
         Classifier control list: dot1p5, precedence 100
            user-packet-class 5
         Classifier control list: dot1p6, precedence 100
            user-packet-class 6
         Classifier control list: dot1p7, precedence 100
            user-packet-class 7
         Referenced by interface(s):
            None
         Referenced by profile(s):
            atm1483BaseProfile  input policy, statistics enabled
         Referenced by merged policies:
            None
    3. Configure the DHCP relay to use the option 82 suboptions. This configuration includes the command that specifies the mapping of the user packet class values from the layer 2 policy to the user-packet-class type in the option 82 Vendor-Specific suboption.
      host1(config)# set dhcp relay 192.168.32.1 proxy
      host1(config)# set dhcp relay 192.168.32.2
      host1(config)# set dhcp relay agent sub-option circuit-id
      host1(config)# set dhcp relay agent sub-option remote-id
      host1(config)# set dhcp relay agent sub-option vendor-specific 
      user-packet-class
      host1(config)# set dhcp relay agent sub-option vendor-specific 
      layer2-circuit-id
      host1(config)# set dhcp relay options hostname
      host1(config)# set dhcp relay options exclude-subinterface-id
      host1(config)# set dhcp relay inhibit-access-route-creation
      host1(config)# set dhcp relay trust-all
      host1(config)# set dhcp relay override agent-option
      
    4. (Optional) Verify the DHCP Relay configuration.
      host1(config)# run show dhcp relay
      
      DHCP Relay Configuration
      ------------------------
      Mode: Proxy
        Restore Client Timeout: 72
      Inhibit Access Route Creation: off
      Assign Giaddr to Source IP: off
      Layer 2 Unicast Replies: off
      Giaddr Selects Interface: off
      Relay Agent Information Option (82):
        Override Giaddr: off
        Override Option: on
        Trust All Clients: on
        Preserve Option From Trusted Clients: off
        Circuit-ID Sub-option (1): on
          select - hostname
          select - exclude-subinterface-id
        Remote-ID Sub-option (2): on
        Vendor-Specific Sub-option (9): on
          select - layer2-circuit-id
          select - user-packet-class
      DHCP Server Addresses
      ---------------------
      192.168.32.1
      192.168.32.2

    Published: 2014-08-20