A local DHCPv4/v6 server is used for address/prefix assignment, which implies a 7x50 DHCP relay scenario (as opposed to a 7x50 DHCP
proxy scenario where the IP address/prefix is assigned via a RADIUS server or an LUDB).
•
|
RADIUS/LUDB — In this model the IP address/prefix is assigned via a RADIUS server. or an LUDB and the 7x50 internal or external behaves as a proxy 1 between the DHCP client and the non-DHCP aware RADIUS/LUDB.
|
Alc-Default-Router (26-6527-18)
config>router>dhcp>server>pool>subnet>options# default-router
config>service>router>dhcp>server>pool>subnet>options# default-router
config>subscr-mgmt>ludb>ipoe>host>options# default-router
config>router>dhcp>server>pool>options# custom-option
config>router>dhcp>server>pool>subnet>options# custom-option
config>router>dhcp6>server>pool>options# custom-option
config>router>dhcp6>server>pool>prefix>options# custom-option
config>service>vprn>dhcp>server>pool>options# custom-option
config>service>vprn>dhcp>server>pool>subnet>options# custom-option
config>service>vprn>dhcp6>server>pool>options# custom-option
config>service>vprn>dhcp6>server>pool>prefix>options# custom-option
config>subscriber-mgmt>ludb>ipoe>host>options# custom-option
Alc-ToClient-Dhcp-Options
Alc-ToClient-Dhcp6-Options
The focus of this example is to demonstrate how the raw DHCP options are formatted via RADIUS. The messages can be optionally pre/post-processed by a Python script in the 7x50 before they are passed on to the DHCP client.
Table 46:
RADIUS Inserted Raw Options
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The RADIUS injected raw options are prepended by the DHCP relay agent in the 7x50 to any existing DHCP options already present in the DHCP message before being sent to the client. The existing options could be generated by the DHCP server (internal or external) or by the LUDB. No check is performed on the outgoing DHCP message towards the client in order to verify whether any of the RADIUS inserted options are already present in the DHCP message. This could potentially lead to duplication of DHCP options in the outgoing DHCP messages in case that the same option is inserted via the DHCP server and via RADIUS. To prove the point, this example supplies the same DHCP option (with different values) via multiple sources (RADIUS and CLI).
Since this eliminates RADIUS as a source of the DHCPv4 lease-time, an alternate method operating on the raw level is used to influence the automatic selection of the lease-time in the DHCPv4 server. This alternate method relies on the fact that the DHCPv4 server accepts hints received from the client as to what the desired lease-time should be. In other words, if the client sends the option 51 (lease-time) with a specific value, the 7x50 DHCPv4 server will honor this hint
2. To demonstrate this behavior, a Python script is invoked upon receipt of a DHCPv4 Request message during the IP address assignment process (DORA – Discover-Offer-Request-Ack). The Python script inserts a new option 51 with the desired value for the lease-time. The DHCPv4 server honors this hint from the client and it returns the requested lease-time back to the client. This scenario is shown in
Figure 403:.
By default the local 7x50 DHCP server does not inject Renew (T1) and Rebind (T2) times so these two timers can still be supplied via RADIUS without duplication by the local 7x50 DHCP server.
DHCPv6 lease related timers are not DHCP options. Instead, they are parameters within the IPv6 addressing option. An IPv6 address or prefix is assigned to the client via the IA-NA or IA-PD option, which contains additional parameters (which are not considered options) such as the IP address/prefix and the lease related timers.
Figure 404 shows the IA-NA option that carries the T1/T2 parameters.
configure port 1/1/5
ethernet
mode access
encap-type qinq
exit
no shutdown
configure service vpls 10
sap 1/1/5:1.* capture-sap create
description "circuit-id authentication"
trigger-packet dhcp dhcp6
dhcp-python-policy "acg"
dhcp6-python-policy "acg"
authentication-policy "rad"
Alc-MSAP-Policy = "msaps"
configure subscriber-mgmt msap-policy “msaps”
sub-sla-mgmt
sub-ident-policy “sub_ident_pol”
multi-sub-sap limit 500
exit
ies-vprn-only-sap-parameters
anti-spoof nh-mac
exit
configure service vprn 1
subscriber-interface "int1-1" create
address 10.10.10.254/24 # Numbered IPv4 subscriber interface.
ipv6
delegated-prefix-len 54
subscriber-prefixes
prefix 2001:db8:3::/48 pd # Numbered IPv6 subscriber interface.
prefix 2001:db8:4::/48 wan-host # Numbered IPv6 subscriber interface.
exit
exit
group-interface "g1-1" create
ipv6
router-advertisements
no shutdown
exit
dhcp6
python-policy "acg" # Python script for DHCPv6 messages.
relay
server 2001:db8::1001 # IPv6 address of the DHCPv6 server.
client-applications dhcp
no shutdown
exit
exit
exit
dhcp
python-policy "acg” # Python script for DHCPv4 messages.
option
action keep # Keep option82 in the received DHCP packet.
vendor-specific-option
pool-name # Pool-name obtained via RADIUS (or LUDB) will be passed
# via DHCP relay to the local DHCP server. This name
# will be used for pool selection in DHCPv4 server.
exit
exit
server 192.168.100.1 # IPv4 address of the DHCPv4 server.
lease-populate 100 # Maximum number of DHCPv4 lease under each
# SAP of the group-interface.
client-applications dhcp
no shutdown
exit
authentication-policy "rad" # RADIUS authentication policy.
exit
exit
configure service vprn 1
interface "loopback1-1" create
address 192.168.100.1/32 # IPv4 address of the DHCPv4 server.
ipv6
address 2001:db8::1001/128 # IPv6 address of the DHCPv6 server.
local-dhcp-server "v6" # Binding of the DHCPv6 server
# to this interface.
exit
local-dhcp-server "v4" # Binding of the DHCPv4 server
# to this interface.
loopback
exit
configure service vprn 1
dhcp
local-dhcp-server "v4"
use-pool-from-client # Pool-name received in the DHCP messages
# sent by the DHCP relay. The pool-name
# is used in pool selection.
pool "non-shared-left"
options
dns-server 172.22.250.253 # DHCPv4 option passed on to the client.
custom-option 231 string "dhcp server injected custom option 231"
exit # DHCPv4 option passed on to the client.
subnet 10.10.10.0/24 create
address-range 10.10.10.5 10.10.10.100 # IPv4 address range available
# for address allocation.
exit
exit
exit
exit
dhcp6
local-dhcp-server "v6"
use-pool-from-client
pool "pd-left" create
options
dns-server 2001:db8:1:1:1:1:1:3
custom-option 232 string "v6 custom option 232"
exit
prefix 2001:db8:4::/48 pd # IPv6 prefix range available for delegated
# prefix allocation by this DHCPv6 server.
preferred-lifetime min 20 # Preferred lifetime of the allocated
# delegated prefix.
rebind-timer min 15 # Rebind (T2) time of the allocated
# delegated prefix.
renew-timer min 10 # Renew (T1) time of the allocated
# delegated prefix.
valid-lifetime min 20 # Valid lifetime of the allocated
# delegated prefix.
exit
exit
pool "wan-left" create
options
dns-server 2001:db8:1:1:1:1:1:3
custom-option 232 string "v6 custom option 232"
exit
prefix 2001:db8:3::/56 wan-host
preferred-lifetime min 20 # Preferred lifetime of the
# allocated IPv6 address.
rebind-timer min 15 # Rebind (T2) time of the
# allocated IPv6 address.
renew-timer min 10 # Renew (T1) time of the
# allocated IPv6 address.
valid-lifetime min 20 # Valid lifetime of the
# allocated IPv6 address.
exit
exit
no shutdown
exit
exit
authentication-policy "rad" create
password "ALU" hash2
radius-authentication-server
router "Base"
server 1 address 192.168.114.1 secret "ALU" hash2
exit
user-name-format circuit-id
include-radius-attribute
circuit-id
remote-id
nas-port-id
nas-identifier
exit
exit
The subscriber-identification policy in this example defines a mapping method between the subscriber strings and the predefined subscriber profiles (sub and
sla) locally configured on the 7x50. In our example the subscriber strings (
sub and
sla) are provided via RADIUS and are directly mapped to the preconfigured sub-profiles and sla-profiles with the matching names.
sub-ident-policy "sub_ident_pol" create
sub-profile-map
use-direct-map-as-default
exit
sla-profile-map
use-direct-map-as-default
exit
sla-profile "sla-profile-1" create
ingress
qos 2
exit
exit
egress
qos 2
exit
exit
exit
sub-profile "sub-profile-1" create
exit
python-script "acg" create
action-on-fail passthrough # In case of python script failure, do not drop the message
but instead continue with message processing in 7750.
primary-url "ftp://a.b.c.d/pub/configs/alu/SIMS/acg.py"
no shutdown
exit
python-script "acg6" create
action-on-fail passthrough
primary-url "ftp://a.b.c.d/pub/configs/alu/SIMS/acg6.py"
no shutdown
exit
python-policy "acg" create # Python policy that is applied under the capture-sap and
under the group-interface.
dhcp request direction ingress script "acg"
dhcp6 relay-forward direction ingress script "acg6"
exit
from alc import dhcpv4
try:
myopt = dhcpv4.getOptionList()
if myopt != []:
print "option-list ", repr(myopt)
print "\n"
except Exception:
print "Can't retrieve DHCP options"
#lease 500s 8min 20sec
try:
dhcpv4.set(51,('\x00\x00\x01\xf4', # Insert the lease-time (opt51) in the incoming
DHCPv4 request as a hint to the DHCPv4 server.
except Exception:
print "Can't set time lease"
from alc import dhcpv6
import struct
packet = dhcpv6.get_relaymsg()# Extract the original DHCPv6 packet within LDRA.
msgType = ord(packet.msg_type) # Get the message type.
ia_na = packet.get_iana() # Store the IA-NA option for further processing later on.
ia_pd = packet.get_iapd() # Store the IA-PD option for further processing later on.
if msgType == 3: # If the message in the LDRA packet is DHCPv6 Request, insert the lease related times in address/prefic options.
ia_na[0][1] = '\x00\x00\x07\xd0'# Set the renew time (T1) in IA-NA to 2000sec.
ia_na[0][2] = '\x00\x00\x0b\xb8'# Set the rebind time (T2) in IA-NA to 3000sec.
ia_na[0][3][5][0][1] = '\x00\x00\x0f\xa0’ # Set the preferred time in IA-NA to
# 4000sec.
ia_na[0][3][5][0][2] = '\x00\x00\x0f\xa0'# Set the valid time in IA-NA to 4000sec.
packet.set_iana(ia_na) # Update the stored packet with the new values for IA-NA.
ia_pd[0][1] = '\x00\x00\x07\xd0'# Set the renew time (T1) in IA-PD to 2000sec.
ia_pd[0][2] = '\x00\x00\x0b\xb8'# Set the rebind time (T2) in IA-PD to 3000sec.
ia_pd[0][3][26][0][0] = '\x00\x00\x0f\xa0’ # Set the preferred time in IA-PD to
# 4000sec.
ia_pd[0][3][26][0][1] = '\x00\x00\x0f\xa0'# Set the valid time in IA-PD to 4000sec.
packet.set_iapd(ia_pd) # Update the stored packet with the new values for IA-PD.
dhcpv6.set_relaymsg(packet) # Insert the packet in the LDRA message.
Sending Access-Accept of id 66 to 192.168.114.2 port 64384
Alc-Subsc-Prof-Str = "sub-profile-1"
Alc-SLA-Prof-Str = "sla-profile-2"
Alc-MSAP-Interface = "g1-1"
Alc-MSAP-Policy = "msaps"
Alc-MSAP-Serv-Id = 1
Framed-Pool = "non-shared-left"
Framed-IPv6-Pool = "wan-left"
Alc-Delegated-IPv6-Pool = "pd-left"
Alc-ToClient-Dhcp-Options += 0x03040a0a0afe
Alc-ToClient-Dhcp-Options += 0x0608ac16fafaac16fafb
Alc-ToClient-Dhcp-Options += 0x0f0b616c636174656c2e636f6d
Alc-ToClient-Dhcp-Options += 0xe612637573746f6d2074657374206f7074696f6e
Alc-ToClient-Dhcp-Options += 0x3a040000012c
Alc-ToClient-Dhcp-Options += 0x3b0400000190
Alc-ToClient-Dhcp6-Options += 0x0011001a0000197f00e60012637573746f6d2074657374206f7074696f6e
Alc-ToClient-Dhcp6-Options += 0x0017002020010db800010001000100010001000120010db8000100010001000100010002
Alc-ToClient-Dhcp6-Options += 0x0018001e0e616c636174656c2d6c7563656e7403636f6d00047465737403636f6d
*A:BNG1# configure log
*A:BNG1>config>log# info
----------------------------------------------
log-id 50 # Capturing and displaying debug output is configured via log.
from debug-trace # Capture debug output.
to session # Output the debug to the current tcp/ssh session.
exit
----------------------------------------------
*A:BNG1>config>log# show debug
debug
router "1"
ip
dhcp
detail-level high
mode egr-ingr-and-dropped
exit
dhcp6
mode egr-ingr-and-dropped
detail-level high
exit
exit
local-dhcp-server "v4"
detail-level high
mode egr-ingr-and-dropped
exit
local-dhcp-server "v6"
detail-level high
mode egr-ingr-and-dropped
exit
exit
Option [82] is partially added by the access-node (relay-agent —> circuit-id and remote-id) and partially by the internal 7x50 DHCP-relay (pool name).
32830 2014/07/24 03:02:46.44 WEST MINOR: DEBUG #2001 vprn1 DHCP server
"DHCP server: v4
Rx DHCP Request
ciaddr: 0.0.0.0 yiaddr: 0.0.0.0
siaddr: 0.0.0.0 giaddr: 10.10.10.254
chaddr: 00:00:65:01:03:01 xid: 0x159dd536
DHCP options:
[82] Relay agent information: len = 42
[1] Circuit-id: ds-left
[2] Remote-id: remote0
[9] Vendor-Specific info: len = 22
Enterprise [6527] : len = 17
[13] dhcpPool: non-shared-left
[53] Message type: Request
[54] DHCP server addr: 192.168.100.1
[50] Requested IP addr: 10.10.10.34
[51] Lease time: 500
[255] End
The remaining options (with the exception of the end [255] option) are provided by RADIUS and they appear in the exact same order as they appear in the RADIUS Alc-ToClient-Dhcp-Options attributes (
Table 46).
32834 2014/07/24 03:02:46.44 WEST MINOR: DEBUG #2001 vprn1 PIP
"PIP: DHCP
instance 2 (1), interface index 11 (g1-1),
transmitted DHCP Boot Reply to Interface g1-1 (1/1/5:1.3) Port 68
H/W Type: Ethernet(10Mb) H/W Address Length: 6
ciaddr: 0.0.0.0 yiaddr: 10.10.10.34
siaddr: 192.168.100.1 giaddr: 10.10.10.254
chaddr: 00:00:65:01:03:01 xid: 0x159dd536
DHCP options:
[82] Relay agent information: len = 18
[1] Circuit-id: ds-left
[2] Remote-id: remote0
[53] Message type: Ack
[54] DHCP server addr: 192.168.100.1
[51] Lease time: 500
[1] Subnet mask: 255.255.255.0
[6] Domain name server: 172.22.250.253
[231] Unknown option: len = 38, value = 64 68 63 70 20 73 65 72 76 65 72
20 69 6e 6a 65 63 74 65 64 20 63 75 73 74 6f 6d 20 6f 70 74 69 6f 6e 20 32
33 31
[3] Router: 10.10.10.254
[6] Domain name server: length = 8
172.22.250.250
172.22.250.251
[15] Domain name: alcatel.com
[230] Unknown option: len = 18, value = 63 75 73 74 6f 6d 20 74 65 73 74
20 6f 70 74 69 6f 6e
[58] Renew timeout: 300
[59] Rebind timeout: 400
[255] End
*A:BNG1# show service id 1 dhcp lease-state detail
===============================================================================
DHCP lease states for service 1
===============================================================================
Service ID : 1
IP Address : 10.10.10.34
Client HW Address : 00:00:65:01:03:01
Subscriber-interface : int1-1
Group-interface : g1-1
SAP : [1/1/5:1.3]
Up Time : 0d 00:10:46
Remaining Lease Time : 0d 00:07:35
Remaining SessionTime: N/A
Persistence Key : N/A
Sub-Ident : "ds-left"
Sub-Profile-String : "sub-profile-1"
SLA-Profile-String : "sla-profile-2"
App-Profile-String : ""
Lease ANCP-String : ""
Lease Int Dest Id : ""
Category-Map-Name : ""
Lease Info origin : DHCP
Ip-Netmask : 255.255.255.0
Broadcast-Ip-Addr : N/A
Default-Router : N/A
Primary-Dns : 172.22.250.253
Secondary-Dns : N/A
Primary-Nbns : N/A
Secondary-Nbns : N/A
ServerLeaseStart : 07/24/2014 03:02:46
ServerLastRenew : 07/24/2014 03:12:46
ServerLeaseEnd : 07/24/2014 03:21:06
Session-Timeout : N/A
Lease-Time : 0d 00:08:20
DHCP Server Addr : 192.168.100.1
Relay Agent Information
Circuit Id : ds-left
Remote Id : remote0
Radius User-Name : "ds-left"
-------------------------------------------------------------------------------
Number of lease states : 1
===============================================================================
32877 2014/07/24 03:15:28.32 WEST MINOR: DEBUG #2001 vprn1 DHCP server
"DHCP server: v6
Rx DHCPv6 RELAY_FORW
Hop Count : 1
Link Addr : 2001:db8:4::
Peer Addr : fe80::200:65ff:fe01:301
Option : RELAY_MSG (9), Length : 184
Msg Type : RELAY_FORW (12)
Hop Count : 0
Link Addr : ::
Peer Addr : fe80::200:65ff:fe01:301
Option : INTERFACE_ID (18), Length : 7
Interface Id : 64732d6c656674 (ds-left)
Option : RELAY_MSG (9), Length : 135
Msg Type : REQUEST (3)
Trans Id : 0x060000
Option : ELAPSED_TIME (8), Length : 2
Time : 0 seconds
Option : CLIENTID (1), Length : 10
LL : HwTyp=0001,LL=000065010301
00030001000065010301
Option : SERVERID (2), Length : 10
LL : HwTyp=0001,LL=d896ff000000
00030001d896ff000000
Option : ORO (6), Length : 4
Requested Option : IA_NA (3)
Requested Option : IA_PD (25)
Option : IA_NA (3), Length : 40
IAID : 0
Time1: 2000 seconds
Time2: 3000 seconds
Option : IAADDR (5), Length : 24
Address : 2001:db8:3:1::1
Preferred Lifetime : 4000 seconds
Valid Lifetime : 4000 seconds
Option : IA_PD (25), Length : 41
IAID : 0
Time1: 2000 seconds
Time2: 3000 seconds
Option : IAPREFIX (26), Length : 25
Prefix : 2001:db8:4:400::/54
Preferred Lifetime : 4000 seconds
Valid Lifetime : 4000 seconds
Option : VENDOR_OPTS (17), Length : 37
Enterprise : 0000197f
Option : WAN_POOL (1), Length : 8
wan-left
Option : PFX_POOL (2), Length : 7
pd-left
Option : PFX_LEN (3), Length : 1
The hinted DHCPv6 lease-times are not honored by the 7x50 DHCPv6 server and instead the 7x50 DHCPv6 server default values are inserted in the outgoing DHCPv6 Reply message towards the client as shown in the output below.
32885 2014/07/24 03:15:28.32 WEST MINOR: DEBUG #2001 vprn1 TIP
"TIP: DHCP6_PKT
Outgoing DHCP6 Msg : RELAY_REPLY (13)
to itf g1-1
Hop Count : 0
Link Addr : ::
Peer Addr : fe80::200:65ff:fe01:301
Option : RELAY_MSG (9), Length : 265
Msg Type : REPLY (7)
Trans Id : 0x060000
Option : SERVERID (2), Length : 10
LL : HwTyp=0001,LL=d896ff000000
00030001d896ff000000
Option : CLIENTID (1), Length : 10
LL : HwTyp=0001,LL=000065010301
00030001000065010301
Option : IA_NA (3), Length : 40
IAID : 0
Time1: 600 seconds
Time2: 900 seconds
Option : IAADDR (5), Length : 24
Address : 2001:db8:3:1::1
Preferred Lifetime : 1200 seconds
Valid Lifetime : 1200 seconds
Option : IA_PD (25), Length : 41
IAID : 0
Time1: 600 seconds
Time2: 900 seconds
Option : IAPREFIX (26), Length : 25
Prefix : 2001:db8:4:400::/54
Preferred Lifetime : 1200 seconds
Valid Lifetime : 1200 seconds
Option : DNS_NAME_SRVR (23), Length : 16
Server : 2001:db8:1:1:1:1:1:3
Option : UNKNOWN (232), Length : 20
763620637573746f6d206f7074696f6e20323332
Option : VENDOR_OPTS (17), Length : 26
Enterprise : 0000197f
Option : UNKNOWN (230), Length : 18
637573746f6d2074657374206f7074696f6e
Option : DNS_NAME_SRVR (23), Length : 32
Server : 2001:db8:1:1:1:1:1:1
Server : 2001:db8:1:1:1:1:1:2
Option : DOM_SRCH_LIST (24), Length : 30
SearchList : .alcatel-lucent.com..test.com.
Option : INTERFACE_ID (18), Length : 7
Interface Id : 64732d6c656674 (ds-left)
*A:BNG1# show service id 1 dhcp6 lease-state detail
===============================================================================
DHCP lease states for service 1
===============================================================================
Service ID : 1
IP Address : 2001:db8:3:1::1/128
Client HW Address : 00:00:65:01:03:01
Subscriber-interface : int1-1
Group-interface : g1-1
SAP : [1/1/5:1.3]
Up Time : 0d 00:02:41
Remaining Lease Time : 0d 00:17:18
Remaining SessionTime: N/A
Persistence Key : N/A
Sub-Ident : "ds-left"
Sub-Profile-String : "sub-profile-1"
SLA-Profile-String : "sla-profile-2"
App-Profile-String : ""
Lease ANCP-String : ""
Lease Int Dest Id : ""
Category-Map-Name : ""
Dhcp6 ClientId (DUID): 00030001000065010301
Dhcp6 IAID : 0
Dhcp6 IAID Type : non-temporary
Dhcp6 Client Ip : fe80::200:65ff:fe01:301
Primary-Dns : N/A
Secondary-Dns : N/A
Pool Name : "wan-left"
Dhcp6 Server Addr : 2001:db8::1001
Dhcp6 ServerId (DUID): 00030001d896ff000000
Dhcp6 InterfaceId : ds-left
Dhcp6 RemoteId : N/A
Lease Info origin : DHCP
ServerLeaseStart : 07/24/2014 03:15:28
ServerLastRenew : 07/24/2014 03:15:28
ServerLeaseEnd : 07/24/2014 03:35:27
Session-Timeout : N/A
Radius User-Name : "ds-left"
-------------------------------------------------------------------------------
Service ID : 1
IP Address : 2001:db8:4:400::/54
Client HW Address : 00:00:65:01:03:01
Subscriber-interface : int1-1
Group-interface : g1-1
SAP : [1/1/5:1.3]
Up Time : 0d 00:02:41
Remaining Lease Time : 0d 00:17:18
Remaining SessionTime: N/A
Persistence Key : N/A
Sub-Ident : "ds-left"
Sub-Profile-String : "sub-profile-1"
SLA-Profile-String : "sla-profile-2"
App-Profile-String : ""
Lease ANCP-String : ""
Lease Int Dest Id : ""
Category-Map-Name : ""
Dhcp6 ClientId (DUID): 00030001000065010301
Dhcp6 IAID : 0
Dhcp6 IAID Type : prefix
Dhcp6 Client Ip : fe80::200:65ff:fe01:301
Primary-Dns : N/A
Secondary-Dns : N/A
Pool Name : "pd-left"
Dhcp6 Server Addr : 2001:db8::1001
Dhcp6 ServerId (DUID): 00030001d896ff000000
Dhcp6 InterfaceId : ds-left
Dhcp6 RemoteId : N/A
Lease Info origin : DHCP
ServerLeaseStart : 07/24/2014 03:15:28
ServerLastRenew : 07/24/2014 03:15:28
ServerLeaseEnd : 07/24/2014 03:35:27
Session-Timeout : N/A
Radius User-Name : "ds-left"
-------------------------------------------------------------------------------
Number of lease states : 2
===============================================================================
from alc import dhcpv4
myopt = dhcpv4.getOptionList()
print "option-list =", repr(myopt)
#lease 500s 8min 20sec
dhcpv4.set(51,('\x00\x00\x01\xf4',))
32826 2014/07/24 03:02:46.44 WEST MINOR: DEBUG #2001 Base Python Output
"Python Output: acg
option-list (53, 54, 50, 82, 255)
"
32827 2014/07/24 03:02:46.44 WEST MINOR: DEBUG #2001 Base Python Result
"Python Result: acg
DHCPv4 Option 51, SET
'\x00\x00\x01\xf4'
"
from alc import dhcpv6
import struct
packet = dhcpv6.get_relaymsg()
msgTop = ord(dhcpv6.msg_type)
msgBot = ord(packet.msg_type)
ia_na = packet.get_iana()
ia_pd = packet.get_iapd()
print 'ia-na = ', ia_na
print '\n'
print 'ia-pd = ', ia_pd
print '\n'
print 'msg type Top = ', msgTop
print 'msg type Bot = ', msgBot
msgType = struct.unpack('B',packet.msg_type)[0]
print "relay packet: ", msgType
# in relay request insert DHCPv6 lease times
if msgBot == 3:
ia_na[0][1] = '\x00\x00\x07\xd0'
ia_na[0][2] = '\x00\x00\x0b\xb8'
ia_na[0][3][5][0][1] = '\x00\x00\x0f\xa0'
ia_na[0][3][5][0][2] = '\x00\x00\x0f\xa0'
packet.set_iana(ia_na)
ia_pd[0][1] = '\x00\x00\x07\xd0'
ia_pd[0][2] = '\x00\x00\x0b\xb8'
ia_pd[0][3][26][0][0] = '\x00\x00\x0f\xa0'
ia_pd[0][3][26][0][1] = '\x00\x00\x0f\xa0'
packet.set_iapd(ia_pd)
dhcpv6.set_relaymsg(packet)
32873 2014/07/24 03:15:28.32 WEST MINOR: DEBUG #2001 Base Python Output
"Python Output: acg6
ia-na = [['\x00\x00\x00\x00', '\x00\x00\x02X', '\x00\x00\x03\x84', {5: [[' \x01
\r\xb8\x00\x03\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01', '\x00\x00\x04\xb0', '\x
00\x00\x04\xb0', {}]]}]]
ia-pd = [['\x00\x00\x00\x00', '\x00\x00\x02X', '\x00\x00\x03\x84', {26: [['\x00
\x00\x04\xb0', '\x00\x00\x04\xb0', '6', ' \x01\r\xb8\x00\x04\x04\x00\x00\x00\x00
\x00\x00\x00\x00\x00', {}]]}]]
msg type Top = 12
msg type Bot = 3
relay packet: 3
"
32874 2014/07/24 03:15:28.32 WEST MINOR: DEBUG #2001 Base Python Result
"Python Result: acg6
DHCPv6 Option 9, SET
'\x03\x06\x00\x00\x00\x08\x00\x02\x00\x00\x00\x01\x00\n\x00\x03\x00\x01\x00\x00
e\x01\x03\x01\x00\x02\x00\n\x00\x03\x00\x01\xd8\x96\xff\x00\x00\x00\x00\x06\x00\
x04\x00\x03\x00\x19\x00\x03\x00(\x00\x00\x00\x00\x00\x00\x07\xd0\x00\x00\x0b\xb8
\x00\x05\x00\x18 \x01\r\xb8\x00\x03\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\
x00\x0f\xa0\x00\x00\x0f\xa0\x00\x19\x00)\x00\x00\x00\x00\x00\x00\x07\xd0\x00\x00
\x0b\xb8\x00\x1a\x00\x19\x00\x00\x0f\xa0\x00\x00\x0f\xa06 \x01\r\xb8\x00\x04\x04
\x00\x00\x00\x00\x00\x00\x00\x00\x00'
"
Similarly, RADIUS provides the means to pass the DHCP options destined to the client in the form of option specific RADIUS attributes (lease-time, etc). For less common options, two Alcatel-Lucent specific RADIUS attributes are provided: Alc-ToClient-Dhcp-Options and
Alc-ToClient-Dhcp6-Options. These two attributes allow the operator to encode client destined DHCP options using hexadecimal notation. Although this process requires manual encoding it provides a very flexible way of providing options to the client.