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

    Sending DHCP Options to the JunosE Router

    Subscriber classification scripts support DHCP options conveyed through COPS. When COPS reports an address, the JunosE router sends DHCP options received for DHCP requests for that address. The DHCP options are available in the subscriber classification context for selecting the subscriber profile to load.

    The fields in Table 1 are in the classification context of subscriber classification scripts.

    Table 1: DHCP Options in UserClassificationContext Field

    DHCP Option

    UserClassificationContext Field

    Comments

    giAddr

    dhcp.giAddr

    Relay agent gateway address

    Option 82 data

    dhcp.getOption(82)

    Content is accessible with getSubOptions()

    Client ID

    dhcp.getOption(61).getString()

     

    Lease time

    dhcp.getOption(51).getInt()

     

    Client requested parameter list

    dhcp.getOption(55).getBytes()

     

    Domain name sent to client

    dhcp.getOption(12).getString()
    dhcp.getOption(15).getString()

    12 = HostName
    15 = DomainName

    DNS server address(es) sent to client

    dhcp.getOption(6).getIpAddresses()

     

    Subnet mask

    dhcp.getOption(1).getIpAddress()

     

    NetBios name server address(es) sent to client

    dhcp.getOption(44).getIpAddresses()

     

    NetBios node type

    dhcp.getOption(46).getBytes()

     

    Default router address(es) sent to client

    dhcp.getOption(3).getIpAddresses()

     

    The DHCP options are accessible to the subscriber classification script with the following syntax:

    dhcp.giAddr = “ match” # interpret option 61 as stringdhcp[61].string = “ match” # interpret option 1 (subnet) as dotted decimal IPdhcp[1].ipAddress = “ match” # option 82, suboption 1, interpreted as stringdhcp[82].subOptions[1].string = “ match”

    The received DHCP options are also stored in the UserSession and are available through the portal API (method User.getDhcpOptions).

    Modified: 2014-06-12