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:

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 13, includes the following components:

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

Related Documentation