[Contents] [Prev] [Next] [Index] [Report an Error]

## 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 6 are in the classification context of subscriber classification scripts.

Table 6: 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 string
dhcp[61].string = “ match”
# interpret option 1 (subnet) as dotted decimal IP
dhcp[1].ipAddress = “ match”
# option 82, suboption 1, interpreted as string
dhcp[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).

#### Related Topics

- Selecting DHCP Parameters
- Classifying DHCP Subscribers (SRC CLI)
- Creating DHCP Profiles (C-Web Interface)
- DHCP Options Supported on the SAE

[Contents] [Prev] [Next] [Index] [Report an Error]