質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

ネットワーク

ネットワークとは、複数のコンピューター間を接続する技術です。インターネットが最も主流なネットワークの形態で、TCP/IP・HTTP・DNSなどの様々なプロトコルや、ルータやサーバーなどの様々な機器の上に成り立っています。

Q&A

解決済

2回答

20088閲覧

freeradiusでのMAC認証で拒否される

naoyuki9

総合スコア7

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

ネットワーク

ネットワークとは、複数のコンピューター間を接続する技術です。インターネットが最も主流なネットワークの形態で、TCP/IP・HTTP・DNSなどの様々なプロトコルや、ルータやサーバーなどの様々な機器の上に成り立っています。

0グッド

0クリップ

投稿2015/12/16 04:26

編集2015/12/17 02:02

###freeradiusでのMAC認証
L2SWとfreeradiusにてポートベースMAC認証をしたいのですがうまく認証ができません。
freeradius上でのradtestでは問題なくACCEPTが返ってくるのですが、実際にRadiusクライアントを通してやってみるとRejectされてしまいます。

サーバー構築・運用すること自体経験が浅いので何か的はずれなことをしてるのかもしれませんがよろしくお願いします。

###環境

freeradiusサーバ 192.168.1.4/24
Radiusクライアント(L2SW) 192.168.1.240/24
サプリカント 192.168.1.12/24

・freeradisuはWindowsServer2012 64bitで動いているVMwareで仮想化されたUbunts(15.10)で動かしています
・RadiusクライアントはH3C(HP)のA5120-24G EI

###config
以下私が編集した部分を書きだしたものです。

users.conf

78e7d19d2846 Auth-Type:=Local, Cleartext-Password:="78e7d19d2846"

clients.conf

client 192.168.1.0/24 { secret = test }

radiusd.conf

user = root group = root port = 1812

###実行結果
radius.log

Fri Dec 4 16:29:32 2015 : Auth: Login incorrect: [78e7d19d2846] (from client 192.168.1.0/24 port 16805898 cli 78-E7-D1-9D-28-46)

tcpdumpでキャプチャした時の内容は以下の通りです。
イメージ説明

###2015/12/17 デバッグモードでの実行結果を追記

実環境での結果

rad_recv: Access-Request packet from host 192.168.1.2 port 5001, id=38, length=112 User-Name = "78e7d19d2846" User-Password = "78e7d19d2846" NAS-IP-Address = 192.168.1.2 NAS-Identifier = "000fe24540f5" NAS-Port = 16805898 NAS-Port-Type = Ethernet Service-Type = Call-Check Framed-Protocol = PPP Calling-Station-Id = "78e7-d19d-2846" # Executing section authorize from file /etc/freeradius/sites-enabled/default +- entering group authorize {...} ++[preprocess] returns ok [auth_log] expand: /var/log/freeradius/radacct/%{Client-IP-Address}/auth-detail-%Y%m%d -> /var/log/freeradius/radacct/192.168.1.2/auth-detail-20151217 [auth_log] /var/log/freeradius/radacct/%{Client-IP-Address}/auth-detail-%Y%m%d expands to /var/log/freeradius/radacct/192.168.1.2/auth-detail-20151217 [auth_log] expand: %t -> Thu Dec 17 10:20:24 2015 ++[auth_log] returns ok ++[chap] returns noop ++[mschap] returns noop ++[digest] returns noop [suffix] No '@' in User-Name = "78e7d19d2846", looking up realm NULL [suffix] No such realm "NULL" ++[suffix] returns noop [eap] No EAP-Message, not doing EAP ++[eap] returns noop [files] users: Matched entry DEFAULT at line 172 ++[files] returns ok rlm_checkval: Item Name: Calling-Station-Id, Value: 78e7-d19d-2846 rlm_checkval: Could not find attribute named Calling-Station-Id in check pairs ++[checkval] returns notfound ++[expiration] returns noop ++[logintime] returns noop [pap] WARNING! No "known good" password found for the user. Authentication may fail because of this. ++[pap] returns noop ERROR: No authenticate method (Auth-Type) found for the request: Rejecting the user Failed to authenticate the user. Login incorrect: [78e7d19d2846/78e7d19d2846] (from client client port 16805898 cli 78e7-d19d-2846) Using Post-Auth-Type Reject # Executing group from file /etc/freeradius/sites-enabled/default +- entering group REJECT {...} [attr_filter.access_reject] expand: %{User-Name} -> 78e7d19d2846 attr_filter: Matched entry DEFAULT at line 11 ++[attr_filter.access_reject] returns updated Delaying reject of request 3 for 1 seconds Going to the next request Waking up in 0.9 seconds. Sending delayed reject for request 3 Sending Access-Reject of id 38 to 192.168.1.2 port 5001 Waking up in 0.8 seconds. Cleaning up request 2 ID 37 with timestamp +249 Waking up in 4.1 seconds.

radtestでの結果(radtest 78e7d19d2846 78e7d19d2846 localhost 1812 test)

rad_recv: Access-Request packet from host 127.0.0.1 port 59230, id=109, length=82 User-Name = "78e7d19d2846" User-Password = "78e7d19d2846" NAS-IP-Address = 127.0.1.1 NAS-Port = 1812 Message-Authenticator = 0xc09c4655d8445950ceb2b86441e9d76c # Executing section authorize from file /etc/freeradius/sites-enabled/default +- entering group authorize {...} ++[preprocess] returns ok [auth_log] expand: /var/log/freeradius/radacct/%{Client-IP-Address}/auth-detail-%Y%m%d -> /var/log/freeradius/radacct/127.0.0.1/auth-detail-20151217 [auth_log] /var/log/freeradius/radacct/%{Client-IP-Address}/auth-detail-%Y%m%d expands to /var/log/freeradius/radacct/127.0.0.1/auth-detail-20151217 [auth_log] expand: %t -> Thu Dec 17 10:47:24 2015 ++[auth_log] returns ok ++[chap] returns noop ++[mschap] returns noop ++[digest] returns noop [suffix] No '@' in User-Name = "78e7d19d2846", looking up realm NULL [suffix] No such realm "NULL" ++[suffix] returns noop [eap] No EAP-Message, not doing EAP ++[eap] returns noop [files] users: Matched entry 78e7d19d2846 at line 235 ++[files] returns ok ++[expiration] returns noop ++[logintime] returns noop [pap] WARNING: Auth-Type already set. Not setting to PAP ++[pap] returns noop Found Auth-Type = PAP # Executing group from file /etc/freeradius/sites-enabled/default +- entering group PAP {...} [pap] login attempt with password "78e7d19d2846" [pap] Using clear text password "78e7d19d2846" [pap] User authenticated successfully ++[pap] returns ok Login OK: [78e7d19d2846/78e7d19d2846] (from client localhost port 1812) # Executing section post-auth from file /etc/freeradius/sites-enabled/default +- entering group post-auth {...} ++[exec] returns noop Sending Access-Accept of id 109 to 127.0.0.1 port 59230 Finished request 2. Going to the next request Waking up in 4.9 seconds. Cleaning up request 2 ID 109 with timestamp +192 Ready to process requests.

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

自己解決

ご回答有り難うございます。
radiusd -Xで確認したところ追記のような結果でした。
中身を見てみるとどうもusersファイル(もしくは参照箇所?)に問題があるように見えました。

実環境(Access-Reject)
[files] users: Matched entry DEFAULT at line 172
radtest(Access-Accpet)
[files] users: Matched entry 78e7d19d2846 at line 235

実環境とradtest、同じユーザー名でRequestを行っているのにMatchされている内容が違うことでRejectされているようです。

Rejectされた実環境でMatchしている172行目を見ると、以下の記述がありました。

DEFAULT Framed-Protocol == PPP Framed-Protocol == PPP Framed-Compression = Van-Jacobson-TCP-IP

なぜこの行にMatchしてしまったのかは不明ですがこの3行をコメントアウトすることで、正しいユーザ情報を記述してある235行目にMatchするようになり正しく認証できました。

投稿2015/12/17 02:21

編集2015/12/17 02:33
naoyuki9

総合スコア7

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

TaichiYanagiya

2015/12/17 02:24

L2SW から「Framed-Protocol = PPP」属性付きでリクエストが届いたため、users.conf の 172 行目の DEFAULT 設定にマッチしたのだと思います。
guest

0

L2SW から送られてくるパスワード文字列は合っていますでしょうか?
radiusd -X でフォアグラウンドで動かして出力を見るとか、radiusd.conf の log {} 箇所で下記のように設定すると、パスワード文字列がわかると思います。

log { (略) auth = yes auth_badpass = yes auth_goodpass = yes }

機器によっては、すべての MACアドレスで固定のパスワード文字列となるかもしれません。

また、users.conf に「Auth-Type:=Local」を設定していますが、authenticate {} 箇所に「Auth-Type Local」の定義はありますでしょうか。
手元の環境(CentOS 7, freeradius-3.0.4)には PAP, CHAP, MS-CHAP などはありましたが、Local はありませんでした。
radtest で問題ないとのことですので、関係ないのかもしれませんが。

投稿2015/12/16 05:28

TaichiYanagiya

総合スコア12146

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

naoyuki9

2015/12/17 02:23

ご回答ありがとうございます。 大変助かりました。 謎は残りましたが認証自体は通るようになりました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問