<div dir="ltr">As per the email I sent to you off-list, this should fix it:<div><br></div><div><div> if ( ADSL-Agent-Remote-Id =~ /\\001(.*)/ ){</div><div> update request {</div><div> ADSL-Agent-Remote-Id := "%{1}"</div>
<div> }</div><div> }</div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 4, 2014 at 12:02 PM, Simon Allard <span dir="ltr"><<a href="mailto:Simon.Allard@team.orcon.net.nz" target="_blank">Simon.Allard@team.orcon.net.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Freeradius list :-)<br>
<br>
I am have a bit of an issue with the stripping hex values from my ADSL-Agent-Remote-ID field in my Auth packet.<br>
<br>
I am using an Alcatel-Lucent 7750SR platform and for some reason they decided when converting a DHCPv6 packet into a radius packet it appends the Enterprise ID (which is a hex number) into the ADSL-Agent-Remote-ID.<br>
<br>
I end up with a packet looking like this:<br>
<br>
User-Name = "MDR-POLT01 eth 1/1/01/01/4/1/1:10"<br>
User-Password = ""<br>
NAS-IP-Address = 60.xxx.xxx.xxx<br>
ADSL-Agent-Circuit-Id = "MDR-POLT01 eth 1/1/01/01/4/1/1:10"<br>
ADSL-Agent-Remote-Id = "\000\000\000\001CHORUS1234567894"<br>
NAS-Port-Type = Ethernet<br>
NAS-Port-Id = "pw-2:1101.104"<br>
Calling-Station-Id = "\000\000\000\001CHORUS1234567894"<br>
NAS-Identifier = "bng"<br>
Acct-Session-Id = "E1F15900F37E74538D434C"<br>
<br>
The issue I seem to be running into, since \000 is a termination value, that freeradius sees the value of attribute ADSL-Agent-Remote-Id as blank. Example below.<br>
<br>
[sql] expand: %{Orcon-User-Name} -><br>
:<br>
User-Name = "MDR-POLT01 eth 1/1/01/01/4/1/1:10"<br>
User-Password = ""<br>
NAS-IP-Address = 60.xx.xx.xx<br>
ADSL-Agent-Circuit-Id = "MDR-POLT01 eth 1/1/01/01/4/1/1:10"<br>
ADSL-Agent-Remote-Id = "\000\000\000\001CHORUS1234567894"<br>
NAS-Port-Type = Ethernet<br>
NAS-Port-Id = "pw-2:1101.104"<br>
Calling-Station-Id = "\000\000\000\001CHORUS1234567894"<br>
NAS-Identifier = "bng1"<br>
Acct-Session-Id = "E1F15900F40272538D8D8E"<br>
+- entering group authorize {...}<br>
++[preprocess] returns ok<br>
[suffix] No '@' in User-Name = "MDR-POLT01 eth 1/1/01/01/4/1/1:10", looking up realm NULL<br>
[suffix] No such realm "NULL"<br>
++[suffix] returns noop<br>
[files] expand: %{ADSL-Agent-Circuit-Id} -> MDR-POLT01 eth 1/1/01/01/4/1/1:10<br>
++[files] returns noop<br>
[sane_dhcpv6_chorus] expand: \000\000\000\001 -> \000\000\000\001<br>
sane_dhcpv6_chorus: Does not match: ADSL-Agent-Remote-Id =<br>
sane_dhcpv6_chorus: Could not find value pair for attribute ADSL-Agent-Remote-Id<br>
++[sane_dhcpv6_chorus] returns ok<br>
<br>
<br>
My attr_rewrite code is:<br>
attr_rewrite sane_dhcpv6_chorus {<br>
attribute = ADSL-Agent-Remote-Id<br>
searchin = packet<br>
searchfor = "\\000\\000\\000\\001"<br>
replacewith = ""<br>
ignore_case = no<br>
new_attribute = no<br>
max_matches = 10<br>
<br>
## If set to yes then the replace string will be<br>
## appended to the original string<br>
append = no<br>
}<br>
<br>
I have raised the issue with the vendor, but I am not holding my breath for a fix anytime soon.<br>
<br>
Are there any other options in freeradius to get around this?<br>
<br>
<br>
-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br>
</blockquote></div><br></div>