Freeradius: 확인 실패 응답 메시지 없음

Freeradius: 확인 실패 응답 메시지 없음

MAC 기반 인증을 위해 RHEL 6.5 서버에서 freeradius를 구성했습니다. 이를 위해 저는 다음을 따랐습니다.이 가이드.

위 가이드에 따라 authorized_macs다음과 같이 유효한 MAC 주소에 대한 파일을 만들었습니다.

xx-xx-xx-xx-xx-xx    Reply-Message = "Device with MAC Address %{Calling-Station-Id} authorized for network access"
yy-yy-yy-yy-yy-yy    Reply-Message = "Device with MAC Address %{Calling-Station-Id} authorized for network access"

실패한 인증을 설정하기 위해 다음과 같이 authorize파일 섹션을 일부 변경해 보았습니다 ./etc/raddb/sites-available/defaultReply-Message

authorize {
  preprocess

  # if cleaning up the Calling-Station-Id...
  rewrite.calling_station_id

  # now check against the authorized_macs file
  authorized_macs
        if (!ok) {
        update control {
              Reply-Message := "Login Failed. MAC Address %{Calling-Station-ID} is NOT valid."
            }
            reject
        }
        else {
            # accept
        users
            update control {
              Auth-Type := Accept
            }
        }
}

테스트 구성을 사용할 때 radclient,

인증 성공:

> echo "Calling-Station-Id=xx-xx-xx-xx-xx-xx" | radclient -s localhost:1812 auth testing123

Received response ID 55, code 2, length = 93
        Reply-Message = "Device with MAC Address xx-xx-xx-xx-xx- authorized for network access"

           Total approved auths:  1
             Total denied auths:  0
               Total lost auths:  0

확인 실패:

 > echo "Calling-Station-Id=zz-zz-zz-zz-zz-zz" | radclient -s localhost:1812 auth testing123

Received response ID 220, code 3, length = 20

       Total approved auths:  0
         Total denied auths:  1
           Total lost auths:  0

확인에 실패하면 Reply-Message아니요가 표시됩니다.

액세스 거부 응답 메시지를 활성화해야 하면 어떻게 됩니까?

답변1

설정 Reply-Message하다update reply대신 블록을 update control사용하십시오.

        update reply {
              Reply-Message := "Login Failed. MAC Address %{Calling-Station-ID} is NOT valid."
            }

관련 정보