<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 25 Apr 2013, at 10:37, Arran Cudbard-Bell <<a href="mailto:a.cudbardb@freeradius.org">a.cudbardb@freeradius.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br>On 25 Apr 2013, at 08:54, Alan DeKok <<a href="mailto:aland@DEPLOYINGRADIUS.COM">aland@DEPLOYINGRADIUS.COM</a>> wrote:<br><br><blockquote type="cite">Franks Andy (RLZ) IT Systems Engineer wrote:<br><blockquote type="cite"> I have a hopefully fairly straightforward question. We have a network<br>switch, a procurve 5406 that we’re doing mac based port authentication<br>on. The switch sends radius attributes including the NAS-Port-ID. I want<br>to be able to reply with tagged and untagged vlans for the ports once<br>authenticated, but the combination depends on the port. Lots of ports<br>will likely have the same setup though, so I’d like to do something (I<br>guess in the users file) like<br><br>DEFAULT NAS-Port-ID == 1-12,<br></blockquote><br> That doesn't really work...<br><br><blockquote type="cite">This would work ok, but the ports are named modularly, i.e. A1, A2 etc,<br>up to usually F24 max, not just numerically. What’s the most elegant way<br>of doing this?<br></blockquote><br> Badly. There's really no good solution to this.<br></blockquote><br></blockquote><div><br></div><div><correction></div><br>authorize{<br><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span>if (!NAS-Port && ("%{tolower:NAS-Port-ID}" =~ /([a-z])([0-9]+)/i)) {<br><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>update request {<br><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>Tmp-String-0 := "%{1}"<br><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>}<br><blockquote type="cite"></blockquote><font color="#0f61c8"><br></font><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>update request {<br><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>Tmp-Integer-0 = "0x%{hex:Tmp-String-0}"<br><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>}<br><blockquote type="cite"></blockquote><font color="#0f61c8"><br></font><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>update request {<br><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>Nas-Port := "%{expr:( %{2} * 100 ) + %{Tmp-Integer-0}}"<br><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>}<br><blockquote type="cite"></blockquote><span class="Apple-tab-span" style="white-space: pre; "> </span>}<br><blockquote type="cite"></blockquote>}<br><blockquote type="cite"></blockquote><font color="#0f61c8"><br></font><blockquote type="cite"></blockquote>DEFAULT<span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>NAS-Port >= <bar>, NAS-Port <= <bar><br></div><br><div apple-content-edited="true">Arran Cudbard-Bell <<a href="mailto:a.cudbardb@freeradius.org">a.cudbardb@freeradius.org</a>><br>FreeRADIUS Development Team<br></div><br></body></html>