8

Situation:

I am trying to get 802.1X working for me. I want RADIUS server to dynamically assign VLANs to ports based on RADIUS reply attribute for particular user. I have an HP E2620 switch and a FreeRADIUS server. The supplicant is a Windows 8.1 machine

I referred to this document on freeradius website.


What I've done so far:

On FreeRADIUS I created a user with such parameters:

dot1xtest    User-Password := "secret"
             Tunnel-Type = "VLAN",
             Tunnel-Medium-Type = "IEEE-802",
             Tunnel-Private-Group-ID = "100"

I also tried Tunnel-Pvt-Group-ID instead, but it doesn't work on FreeRADIUS, just barks at me (I saw this on resources for configuring on Microsoft NPS, one of these) . Also I tried values "802", 802, 6 for tunnel medium type.

Also I tried to use actual VLAN name instead of VLAN-ID as Group ID value. Anyway its datatype is string.

I configured the HP switch to use this RADIUS server for AAA and set this up for port 10:

aaa port-access gvrp-vlans
aaa authentication port-access eap-radius
aaa port-access authenticator 10
aaa port-access authenticator 10 auth-vid 150
aaa port-access authenticator 10 unauth-vid 200
aaa port-access authenticator active

VLANs:

VLAN 100 - VLAN which I want to get after authentication.
VLAN 150 - VLAN which I get now, because my config is not working
VLAN 200 - Unauthorized VLAN which is used on auth. failure

Notes:

  • Port 10 also has untagged VLAN 150 assigned to it: vlan 150 untagged 10. And I can't get rid of the static assignment

  • All VLANs listed above are present in switch's VLAN database.

  • Whenever I plug into this port it asks me for credentials; after I succeed with authentication it just sends me to VLAN150 and if I try to fail I get to VLAN200.

  • I enabled 802.1X authentication on Windows connection just like described here.

  • I tried enabling GVRP - it doesn't change anything


Diagnostic/show command output:

Static VLAN assignment for Port 10. VLAN 150 untagged

 SW # show vlans ports 10 detail

 Status and Counters - VLAN Information - for ports 10

  VLAN ID Name                             | Status     Voice Jumbo Mode
  ------- -------------------------------- + ---------- ----- ----- --------
  150     VLAN150                          | Port-based No    No    Untagged

In show logging I see this:

I 08/28/14 08:29:24 00077 ports: port 10 is now off-line
I 08/28/14 08:29:29 00435 ports: port 10 is Blocked by AAA
I 08/28/14 08:29:29 00435 ports: port 10 is Blocked by STP
I 08/28/14 08:29:29 00076 ports: port 10 is now on-line
I 08/28/14 08:29:29 00001 vlan: VLAN200 virtual LAN enabled
I 08/28/14 08:29:29 00435 ports: port 10 is Blocked by AAA
I 08/28/14 08:29:29 00002 vlan: UNUSED virtual LAN disabled
I 08/28/14 08:29:29 00435 ports: port 10 is Blocked by STP
I 08/28/14 08:29:29 00076 ports: port 10 is now on-line
I 08/28/14 08:29:29 00001 vlan: UNUSED virtual LAN enabled
I 08/28/14 08:29:47 00002 vlan: UNUSED virtual LAN disabled

show port-access authenticator output:

SW # show port-access authenticator

 Port Access Authenticator Status

  Port-access authenticator activated [No] : Yes
  Allow RADIUS-assigned dynamic (GVRP) VLANs [No] : Yes

       Auths/  Unauth  Untagged Tagged           % In  RADIUS Cntrl
  Port Guests  Clients VLAN     VLANs  Port COS  Limit ACL    Dir
  ---- ------- ------- -------- ------ --------- ----- ------ -----
  10   1/0     0       150      No     No        No    No     both

RADIUS user test:

Linux-server # radtest dot1xtest secret localhost 0 secretkey
Sending Access-Request of id 158 to 127.0.0.1 port 1812
        User-Name = "dot1xtest"
        User-Password = "secret"
        NAS-IP-Address = 127.0.0.1
        NAS-Port = 0
        Message-Authenticator = 0x00000000000000000000000000000000
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=158, length=37
        Tunnel-Type:0 = VLAN
        Tunnel-Medium-Type:0 = 802
        Tunnel-Private-Group-Id:0 = "100"

This is what I saw in TCPdump on the RADIUS server. I was capturing outgoing UDP traffic with source port 1812. It's what my switch gets (if it does actually, not sure how to check that...)

      Tunnel Type Attribute (64), length: 6, Value: Tag[Unused]#13
        0x0000:  0000 000d
      Tunnel Medium Attribute (65), length: 6, Value: Tag[Unused]802
        0x0000:  0000 0006
      Tunnel Private Group Attribute (81), length: 5, Value: 100
        0x0000:  3130 30

Debug:

debug security radius-server
debug security port-access authenticator
debug destination buffer

After that I unplugged and plugged in the cable and did show debug buffer and here is the copy-paste of it. It's weird, nothing is said about any attributed related to VLAN.


Questions:

What am I doing wrong?

I've read in a bunch of resources that if the RADIUS assigns a VLAN ID switch uses that in the first place. Then it falls back to Authorized VLAN configured for Port-Access Authenticator if authentication succeeds. If that is not present it assigns Untagged VLAN configured on the port. Why don't I get that behavior?

I kind of start to think the attribute Tunnel-Private-Group-Id is not supported on these switches. It seems every resource refers to Tunnel-Pvt-Group-Id instead (configuring on Microsoft). Too bad I don't have Windows Server to check.

Maybe it's firmware related? Didn't try to upgrade yet, I use RA_15_06_0009.swi and there's RA_15_14_0007.swi out there already


Update

Just tried on a 3500yl-24G-PWR model and still doesn't work. So.. I'd guess, switches just don't get the config from the RADIUS server (or did I use incorrect attributes or operators?). How can I troubleshoot that?

  • Do you have the port on vlan100 as tagged? – some_guy_long_gone Sep 5 '14 at 13:47
  • Been a while since I played on HP switches, but it seems to me there should be a aaa port-access authenticator 10 auth-vid 150 statement as well. IIRC, this would tell the switch to use 150 for authenticated devices unless it gets a different value from RADIUS. Without this, I suspect it will just use the configured port value. Not posting as an answer because I am working off memory and it often fails nowadays. If it works, let me know and I will post as answer. – YLearn Sep 5 '14 at 15:21
  • *legioxi, no the port is set to Untagged VLAN 150. *YLearn, I don't need it to assign a specific VLAN. I want it to assign a VLAN depending on what user authenticates. Auth-vid comes second in priority after RADIUS (which doesn't work). If no Auth-vid is set, then it does indeed choose configured untagged VLAN. – Alex Sep 9 '14 at 4:14
6
+50

Alex, hеllo there!

Ive builded test environmet for you, so i am using freeradius 2.1.12+dfsg-1.2 (on debian), and switch hp 2650. Ive just repeated your config, and have no problems with this. My test procurve ip 10.0.10.29, test freeradius ip 192.168.2.60.

procurve config:

Running configuration:

; J4899A Configuration Editor; Created on release #H.10.83

hostname "ProCurve Switch 2650"
interface 1
   no lacp
exit
interface 2
   no lacp
exit
interface 3
   no lacp
exit
interface 4
   no lacp
exit
interface 5
   no lacp
exit
interface 6
   no lacp
exit
interface 7
   no lacp
exit
interface 8
   no lacp
exit
interface 9
   no lacp
exit
interface 10
   no lacp
exit
snmp-server community "public" Unrestricted
vlan 1
   name "DEFAULT_VLAN"
   untagged 11-50
   ip address dhcp-bootp
   no untagged 1-10
   exit
vlan 100
   name "success"
   untagged 1-10
   exit
vlan 200
   name "fail"
   exit
aaa authentication port-access eap-radius
radius-server host 192.168.2.60 key test
aaa port-access authenticator 1-10
aaa port-access authenticator 1 unauth-vid 200
aaa port-access authenticator 2 unauth-vid 200
aaa port-access authenticator 3 unauth-vid 200
aaa port-access authenticator 4 unauth-vid 200
aaa port-access authenticator 5 unauth-vid 200
aaa port-access authenticator 6 unauth-vid 200
aaa port-access authenticator 7 unauth-vid 200
aaa port-access authenticator 8 unauth-vid 200
aaa port-access authenticator 9 unauth-vid 200
aaa port-access authenticator 10 unauth-vid 200
aaa port-access authenticator active

/etc/freeradius/users:

<...>
testuser User-Password := test
        Tunnel-Type = VLAN,
        Tunnel-Medium-Type = IEEE-802,
        Tunnel-Private-Group-Id = "100"
<...>

/etc/freeradius/radiusd.conf:

<...>
client switch {
        ipaddr          = 10.0.10.29
        secret          = test
        require_message_authenticator = no
        nastype     = other
}
<...>

And i`ve used this manual, to enable 8021x in windows:

http://windows.microsoft.com/en-us/windows/enable-802-1x-authentication#1TC=windows-7 

But, I`ve disabled usage of logged user creds.

So, if user creds are correct, i have this message in /var/log/freeradius/radius.log

tail -f /var/log/freeradius/radius.log
Fri Sep  5 12:54:14 2014 : Auth: Login OK: [testuser/<via Auth-Type = EAP>] (from client switch port 0 via TLS tunnel)
Fri Sep  5 12:54:14 2014 : Auth: Login OK: [testuser/<via Auth-Type = EAP>] (from client switch port 1 cli b4-99-ba-5a-bb-65)

and on my switch ive got:

ProCurve Switch 2650(eth-1)# sh vlans ports 1

 Status and Counters - VLAN Information - for ports 1

  802.1Q VLAN ID Name         Status       Voice
  -------------- ------------ ------------ -----
  100            success      Port-based   No

If creds are incorrect:

Fri Sep  5 12:56:06 2014 : Auth: Login incorrect: [sasdasd/<via Auth-Type = EAP>] (from client switch port 0 via TLS tunnel)
Fri Sep  5 12:56:06 2014 : Auth: Login incorrect: [sasdasd/<via Auth-Type = EAP>] (from client switch port 1 cli b4-99-ba-5a-bb-65)


ProCurve Switch 2650(eth-1)# sh vlans ports 1

 Status and Counters - VLAN Information - for ports 1

  802.1Q VLAN ID Name         Status       Voice
  -------------- ------------ ------------ -----
  200            fail         Port-based   No

maybe you havent enabled 8021x in windows? I hope this helps to you man.

  • Hey, man, thanks! That's much appreciated! However, I did everything to enable the dot1x on Windows. I notice you chose VLAN 100 as default untagged VLAN on the switchport you're trying to connect to. It works for me that way too. I get an untagged VLAN configured on a switchport when I succeed. But what If you set untagged VLAN for your port to 1 and try to assign VLAN 100 via RADIUS? Does that work for you? What if I have multiple different users with different Tunnel-Private-Group-Id values? – Alex Sep 5 '14 at 11:09
  • 1
    Understood :) I've just escaped from my job, if no one wouldn't help you, I'll try to do this on monday(when i can get access to my testlab, it isolated, unfortunately) – pyatka Sep 5 '14 at 11:33
  • 1
    there is no success yet... MAC-auth works great(port sets in any goal untagged vlan), but 8021x(or both with MAC-auth) not working - in any combinations of everything that can be tuned ;-) I`ll try to do the same with another client OS(not windows), maybe this is a key. Also, it looks very strange, because i have dumps of radius-traffic, and ihmo, all messages seems to be correct... – pyatka Sep 8 '14 at 13:41
2

Wow, I would have never though of this one. It was just a random solution.

So, the problem was with authorize section in my default site configuration at /etc/raddb/sites-enabled/default, it was kind of default. I don't really know what's up with that (if you, guys, know, comment on that, please), gonna do some research on that; here it is:

eap {
    ok = return
}

I commented this out and replaced with just:

eap

I was not hoping any more to ever get it working and then I reconnected and... it happened, just randomly and I'm so excited now! I got assigned a VLAN dynamically:

Debug:

0001:03:15:51.07 RAD  mRadiusCtr:ACCESS REQUEST id: 194 to 192.168.1.27,
   session: 56, access method: PORT-ACCESS, User-Name: dot1x,
   Calling-Station-Id: dead00-00beef, NAS-Port-Id: 10, NAS-IP-Address:
   192.168.100.17.
0001:03:15:51.10 RAD  tRadiusR:ACCESS ACCEPT id: 194 from 192.168.1.27 received.
0001:03:15:51.10 1X   m8021xCtrl:Port 10: received Success for client
   dead00-00beef, finished authentication session.
0001:03:15:51.10 1X   m8021xCtrl:Port: 10 MAC: dead00-00beef RADIUS Attributes,
   vid: 100.
0001:03:15:51.10 1X   m8021xCtrl:Port 10: starting session for client
   dead00-00beef.

SW # show port-access authenticator 10 vlan - still shows Unauthorized VLAN 200 and Authorized VLAN 150

Port Access Authenticator VLAN Configuration

  Port-access authenticator activated [No] : Yes
  Allow RADIUS-assigned dynamic (GVRP) VLANs [No] : No

       Access  Unauth  Auth
  Port Control VLAN ID VLAN ID
  ---- ------- ------- -------
  10   Auto    200     150

SW # show vlans ports 10 detail - And the untagged VLAN on port 10 got set to VLAN 100

 Status and Counters - VLAN Information - for ports 10

  VLAN ID Name                 | Status     Voice Jumbo Mode
  ------- -------------------- + ---------- ----- ----- --------
  100     VLAN100              | Port-based No    No    Untagged

SW # show port-access authenticator

  Port Access Authenticator Status

  Port-access authenticator activated [No] : Yes
  Allow RADIUS-assigned dynamic (GVRP) VLANs [No] : No

       Auths/  Unauth  Untagged Tagged           % In  RADIUS Cntrl
  Port Guests  Clients VLAN     VLANs  Port COS  Limit ACL    Dir
  ---- ------- ------- -------- ------ --------- ----- ------ -----
  10   1/0     0       100      No     No        No    No     both

Also, if you want it to work, you have to create all required VLANs on the switch, otherwise you'll get this kind of stuff:

W 09/12/14 12:47:57 02400 dca: 8021X client, RADIUS-assigned VID validation
            error. MAC DEAD0000BEEF port 10 VLAN-Id 0 or unknown.

and the Windows will just say: Authentication failed which is kind of confusing too.

Didn't quite get it to work with unknown VLANs in spite of the fact GVRP was enabled, aaa port-access gvrp-vlans was set and I also explicitly set unknown-vlans learn on interface 10, but oh well...nvm.

1

You need to add the following command:

aaa port-access authenticator 10 auth-vid 150

This would tell the switch that port 10 will use the auth-vid assigned VLAN for authenticated devices unless it gets a different value from RADIUS. Without this, it will just use the configured port value and ignore any RADIUS provided VLAN assignments.

I did some digging and found this tidbit in one of my saved HP docs:

If the RADIUS server specifies a VLAN for an authenticated supplicant connected to an 802.1X authenticator port, this VLAN assignment overrides any Authorized-Client VLAN assignment configured on the authenticator port. This is because both VLANs are untagged, and the switch allows only one untagged VLAN membership per-port. For example, suppose you configured port 4 to place authenticated suppli- cants in VLAN 20. If a RADIUS server authenticates supplicant “A” and assigns this supplicant to VLAN 50, then the port can access VLAN 50 for the duration of the client session. When the client disconnects from the port, then the port drops these assignments and uses only the VLAN memberships for which it is statically configured.

  • Unfortunately, it still doesn't work. I get VLAN 150 assigned and not the RADIUS one – Alex Sep 9 '14 at 8:30
  • Keep in mind that while troubleshooting an issue like this, there may be more than one error in the configuration. Does this change any of the other output (show logging or show port-access authenticator for example)? Have you combined this with some of the other changes you have tried previously? Perhaps one that you ruled out was needed, but was missing another piece as well before working. – YLearn Sep 9 '14 at 14:13
  • Yeah, I tried to combine.. Show commands still show the same behavior/output. Can't think of anything any more. I guess this specific command isn't the issue at all. It's just next in priority after RADIUS-assigned VLAN and doesn't change anything. The issue, IMO, is that switch either doesn't get RADIUS attributes for VLAN or they're not getting processed or somehow are incorrect. I mean, look how simple that config is: integratingit.wordpress.com/2012/07/05/… – Alex Sep 10 '14 at 5:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.