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() | 12 = HostName |
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:
The received DHCP options are also stored in the UserSession and are available through the portal API (method User.getDhcpOptions).