LoginSignup
0
0

More than 1 year has passed since last update.

Macアドレス認証構築_Catalyst3560編

Last updated at Posted at 2023-04-13

Cisco機器でRadiusServerを使用したMacアドレス認証を設定します。

ダイナミックVLANについて

ポートに接続された機器の情報を元にVLANを決定する方式をダイナミックVLANという。
ダイナミックVLANの実装は下記の種類がある。

  • Web認証
    • Web認証とはユーザを個別に認識するためにユーザーIDを割り振り、パスワードを設定することで本人の認証をする仕組み。
  • IEEE802.1x認証
    • IEEE802.1Xは、有線/無線LANに接続してデータ通信を行うネットワーク端末を認証するための規格
認証方式 説明 認証方法
LEAP ・Windows PCで標準搭載
・チャレンジレスポンスによる認証
・サーバ認証なし、WEPキーは固定 
 クライアントとサーバ間でユーザIDとパスワードによる認証を行う。
EAP-FAST ・Cisco独自の認証方式
・辞書攻撃による脆弱性を解消
・セキュリティレベルが高く認証局も不要
クライアントとサーバ間でユーザIDとパスワードによる認証を行う際に、PACという独自フォーマットを使用して認証する
PEAP ・Windows PCで標準搭載
・ユーザIDと証明書のハイブリッド認証
・人気のある認証方式
クライアントはユーザIDとパスワードで認証を行い、サーバは電子証明で認証を行う
EAP-TLS ・Windows PC で標準搭載
・最もセキュリティレベルの高い方式
・証明書発行などのスキルが要求される
クライアントとサーバ双方が電子証明書で認証を行う
  • MACアドレス認証
    • LAN(構内ネットワーク)上で機器の認証を行う方式の一つで、機器に固有のMACアドレスを用いてアクセス制御を行う方式。

環境

  • Radiusサーバー情報

    • VMware ESXi 11
    • CentOS Linux 7.4.1708
    • freeradius-3.0.13-8.el7_4.x86_64
    • freeradius-utils-3.0.13-8.el7_4.x86_64
    • 192.0.2.1
  • RadiusClient情報

    • Cisco WS-C3560CG-8PC-S 12.2(55)EX3
    • 192.0.2.2
  • 端末

    • ノートPC
    • MAC:xx-xx-xx-yy-yy-yy

簡略図

簡略図.jpg

RadiusServer設定

インストール

sudo yum install freeradius freeradius-utils

auth は認証時のログ出力設定。
auth_badpass は認証失敗時にログ出力。
auth_goodpass は認証成功時にログ出力。

sudo vi /etc/raddb/radiusd.conf
log {
        auth = yes
        auth_badpass = yes
        auth_goodpass = yes
}

オーセンティケータが所属するセグメントとRadiusサーバに設定したのkeyを指定。

sudo vi /etc/raddb/clients.conf
client localhost {
    ipaddr = 127.0.0.1
    proto = *
    secret = testing123
    require_message_authenticator = no
    nas_type     = other
    limit {
        max_connections = 16
        lifetime = 0
        idle_timeout = 30
    }
}

client new {
  ipaddr = 192.0.2.0/24
  secret = radiusstring
}

機器ごとのMACアドレスや共通の通信用パスワードを設定。
「Tunnel-Private-Group-Id」は認証された端末に割り当てるVLAN指定する。

sudo vi /etc/raddb/users
xxxxxxyyyyyy Cleartext-Password := "xxxxxxyyyyyy"
        Tunnel-Type = 13 ,
        Tunnel-Medium-Type = 6 ,
        Tunnel-Private-Group-Id = 15

firewallにて、Radiusが使うUDP1812番と1813番を開放

sudo firewall-cmd --add-port=1812/udp --zone=public --permanent && sudo firewall-cmd --add-port=1813/udp --zone=public --permanent && sudo firewall-cmd --reload

SElinuxは無効化しておきます。

sudo vi /etc/selinux/config
SELINUX=disabled

再起動

shutdown -r now
sudo systemctl start radiusd.service && sudo systemctl enable radiusd.service

Catalyst設定

AAAの有効化

(config)# aaa new-model

Radiusサーバグループ作成して、IPアドレスを設定。

(config)#aaa group server radius RADgroup
(config-sg-radius)#server 192.0.2.1 auth-port 1812 acct-port 1813

/etc/raddb/client.confで設定したキーを指定。

(config)# radius-server host 192.0.2.1 auth-port 1812 acct-port 1813 key radiusstring

IEEE802.1X認証リストおよびネットワーク認可リスト設定

(config)# aaa authentication dot1x default group RADgroup
(config)# aaa authorization network default group RADgroup

グローバルでのIEEE802.1X認証の有効化

(config)# dot1x system-auth-control

認証された端末に割り当てるVLANを作成。

(config)#vlan 15
(config-vlan)#exit

インターフェイスに先程作成したVLANを関連付ける。

(config)#interface gi0/2
(config-if)#switchport access vlan 15
(config-if)#switchport mode access

IEEE802.1X認証の有効化

(config-if)# authentication port-control auto

認証オーダーおよび認証プライオリティの設定とMAC認証有効化

(config-if)# authentication order mab
(config-if)# authentication priority mab
(config-if)# mab

オーセンティケータとしてのみ動作させる設定

(config-if)# dot1x pae authenticator

設定の確認

Status「Authz Success」となっていること。

#show authentication sessions

Interface  MAC Address     Method   Domain   Status         Session ID
Gi0/2      xxxx.xxyy.yyyy  mab      DATA     Authz Success  0AB4C63800000BA72AB8DCAC
#show running-config
Building configuration...

Current configuration : 1868 bytes
!
! Last configuration change at 18:07:55 UTC Tue Apr 11 2023 by cisco
!
version 12.2
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Switch123
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$Ch59$kK.NMlf5Qv9jeleLu46n5/
enable password password
!
username cisco password 0 sshpass
!
!
aaa new-model
!
!
aaa group server radius RADgroup
 server 192.0.2.1 auth-port 1812 acct-port 1813
!
aaa authentication dot1x default group RADgroup
aaa authorization network default group RADgroup 
!
!
!
aaa session-id common
system mtu routing 1500
!
!
no ip domain-lookup
ip domain-name sample.com
!
!
!
dot1x system-auth-control
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
vlan internal allocation policy ascending
!
ip ssh version 2
!
!
interface GigabitEthernet0/1
 switchport access vlan 10
 switchport mode access
!
interface GigabitEthernet0/2
 switchport access vlan 15
 switchport mode access
 authentication order mab
 authentication priority mab
 authentication port-control auto
 mab
 dot1x pae authenticator
 dot1x timeout tx-period 3
 spanning-tree portfast
!
interface GigabitEthernet0/3
!
interface GigabitEthernet0/4
!
interface GigabitEthernet0/5
!
interface GigabitEthernet0/6
!
interface GigabitEthernet0/7
!
interface GigabitEthernet0/8
!
interface GigabitEthernet0/9
!
interface GigabitEthernet0/10
!         
interface Vlan1
 no ip address
!
interface Vlan10
 ip address 192.0.2.5 255.255.255.0
!
interface Vlan15
 no ip address
!
ip default-gateway 192.0.2.254
ip classless
ip http server
ip http secure-server
!
ip sla enable reaction-alerts
!
radius-server host 192.0.2.1 auth-port 1812 acct-port 1813 key radiusstring
!
!
line con 0
line vty 0 4
 password telnetpass
 transport input ssh
line vty 5 15
!
ntp server 192.0.2.3
end
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0