AD+radius完成802.1X认证

您所在的位置:网站首页 ad服务器端口 AD+radius完成802.1X认证

AD+radius完成802.1X认证

2023-09-03 05:01| 来源: 网络整理| 查看: 265

目录 一、准备工作二、安装配置Active Direcotry三、安装配置samba、kerberos、winbind、freeradius3.1 安装samba、kerberos、winbind、freeradius3.2 配置samba3.3 配置Kerberos3.4 配置winbind3.5 配置freeradius3.6linux加入AD3.7其他 四、测试4.1 centos上测试验证4.2 交换机+无线AP管理器4.2.1有线接入交换机配置4.2.2 无线接入交换机配置4.2.3 AP管理器配置

一、准备工作

1.1 安装或关闭以下服务 关闭防火墙等

linux时间校对

1.2 本次安装环境

配置信息说明linux服务器IP地址192.168.1.10域控IP地址192.168.1.20linux系统版本CentOS7.4win系统版本win-2008-R2内核ml-3.10.0samba版本ml-3.10.0Kerberos版本ml-3.10.0AD域 DCtest.local

  FreeRADIUS通过基于交换机端口的访问控制提供身份验证。用户凭据通过使用 802.1X 验证协议进行验证。仅当用户凭据已通过FreeRADIUS 服务器身份验证时,才会向用户授予网络访问权限。未通过验证,交换机端口将关闭。   尽管交换机端口已关闭,但用户可以通过身份验证协议与 RADIUS 服务器通信。 RADIUS服务器能够在域控制器上检查用户是否存在以及其密码是否正确。验证通过,RADIUS服务器会告诉交换机打开端口,用户将获得对网络的访问权限。   FreeRADIUS部署在centos7上,需要将RADIUS服务器加入域控(加入域控需要安装samba)。安装samba是为了获取winbind、ntlm_auth,共享文件目录可以不用。 在这里插入图片描述

winbind,一个允许连接到Windows – NT环境的守护进程。ntlm_auth,一种使用 winbind 来评估 NTLM(NT Lan 管理器)请求的工具。此工具允许验证域控制器上的用户凭据,并返回成功或错误消息。Kerberos 是一种网络认证协议,其设计目标是通过密钥系统为客户机 / 服务器应用程序提供强大的认证服务。该认证过程的实现不依赖于主机操作系统的认证,无需基于主机地址的信任,不要求网络上所有主机的物理安全,并假定网络上传送的数据包可以被任意地读取、修改和插入数据。在以上情况下, Kerberos 作为一种可信任的第三方认证服务,是通过传统的密码技术(如:共享密钥)执行认证服务的。 二、安装配置Active Direcotry

由于在安装时,忘记截图。可以参考网上安装AD域流程。 在这里插入图片描述

三、安装配置samba、kerberos、winbind、freeradius 3.1 安装samba、kerberos、winbind、freeradius yum install samba samba-winbind samba-winbind-clients krb5-server krb5-workstation freeradius freeradius-utils -y 3.2 配置samba vim /etc/samba/smb.conf [global] workgroup = TEST password server = 192.168.1.20 #填写域服务器地址 realm = TEST.LOCAL #大写AD DC security = ads #指定samba服务器的工作模式为ads winbind use default domain = true winbind offline logon = false map to guest = bad user guest account = nobody unix charset = utf8 display charset = utf8 server string = FILE-SERVER bind interfaces only = Yes server signing = auto client use spnego = No load printers = No dns proxy = No 3.3 配置Kerberos vim /etc/krb5.conf [libdefaults] default_realm = test.local #去掉注释 [realms] #修改为AD信息 TEST.LOCAL = { default_domain = TEST.LOCAL kdc = 192.168.1.20:88 admin_server = 192.168.1.20:749 } [domain_realm] #修改为AD信息 .test.local = TEST.LOCAL test.local = TEST.LOCAL [kdc] profile = /var/kerberos/krb5kdc/kdc.conf [appdefaults] pam = { debug = false ticket_lifetime = 36000 renew_lifetime = 36000 forwardable = true krb4_convert = false } 3.4 配置winbind vim /etc/nsswitch.conf passwd: files sss winbind #添加winbind shadow: files sss winbind group: files sss winbind 3.5 配置freeradius vim /etc/raddb/clients.conf #client private-network-2 { # ipaddr = 198.51.100.0/24 # secret = testing123-2 #} client priveate-network { ipaddr = 192.168.1.0/24 #仅允许192.168.1.0/24网段访问 secret = testadmin #radius与交换机之间使用的密钥 } 3.6linux加入AD [root@localhost ~]# net ads join -U Administrator Enter Administrator's password: #需要输入AD服务器管理员密码 Using short domain name -- TEST Joined 'LOCALHOST' to dns domain 'test.local' No DNS domain configured for localhost. Unable to perform DNS Update.

ad中查看 在这里插入图片描述

3.7其他 radiusd -X #测试radiusd是否正常 systemctl enable radiusd #开机自启 systemctl enable smb systemctl enable winbind systemctl restart radiusd #重启服务 systemctl restart smb systemctl restart winbind 四、测试 4.1 centos上测试验证

AD域中配置该账号,配置完毕后centos上验证 在这里插入图片描述

wbinfo -a zhangsan%Abc1234 plaintext password authentication succeeded challenge/response password authentication succeeded 4.2 交换机+无线AP管理器

  实际部署中,AD域、radius,应在搭配交换机、无线路由器或AP,完成基于AD域验证通过有线和无线连接的802.1X认证。目前缺少单独的交换机、AP,无法实际测试。本次采取寻找华为交换机、AP产品文档添加相关配置,未经测试,不一定能通。

4.2.1有线接入交换机配置

全局配置

authentication-profile name p1 #身份验证配置文件名称”p1“,并在其上绑定802.1X接入模板“d1”、指定认证模板下用户的强制认证域为“test.com”、指定用户接入模式为多用户单独认证接入模式、最大接入用户数为100。 dot1x-access-profile d1 authentication mode multi-authen max-user 100 access-domain test.com force l2protocol-tunnel user-defined-protocol 802.1x protocol-mac 0180-c200-0003 group-mac 0100-0000-0002 #二层透明传输EAP报文 radius-server template test #配置RADIUS服务器模板 radius-server shared-key cipher testadmin #RADIUS服务器模板内的共享密钥和RADIUS服务器上配置保持一致 radius-server authentication 192.168.1.10 1812 weight 80 #配置RADIUS主用认证服务器和计费服务器的IP地址、端口 radius-server accounting 192.168.1.10 1812 weight 80 undo radius-server user-name domain-included #设备向RADIUS服务器发送的报文中的用户名不包含域名 aaa authentication-scheme test #配置认证方案test,认证模式为先进行RADIUS认证,后进行本地认证 authentication-mode radius local authentication-scheme default authentication-mode radius local authorization-scheme default authorization-mode local domain test #配置test域,在域下应用认证方案test、计费方案default、RADIUS服务器模板default。 authentication-scheme test accounting-scheme default radius-server default

上行接口配置

interface GigabitEthernet0/0/25 port link-type trunk port trunk allow-pass vlan 2 to 4094 l2protocol-tunnel user-defined-protocol 802.1x enable #接口的二层协议透明传输功能

下行接口配置

interface GigabitEthernet0/0/1 port link-type access port default vlan 10 authentication-profile p1 l2protocol-tunnel user-defined-protocol 802.1x enable 4.2.2 无线接入交换机配置

全局配置

aaa authentication-scheme default authentication-mode local authentication-scheme radius authentication-mode radius domain default authentication-scheme radius accounting-scheme default radius-server default

下行接口配置

interface GigabitEthernet0/0/1 port link-type trunk port trunk pvid vlan 10 port trunk allow-pass vlan 2 to 4094

上行接口配置

interface GigabitEthernet0/0/25 port link-type trunk port trunk allow-pass vlan 2 to 4094 4.2.3 AP管理器配置 authentication-profile name test_wifi dot1x-access-profile test_wifi authentication-scheme test_wifi radius-server default radius-server template default radius-server shared-key cipher testadmin radius-server authentication 192.168.1.10 1812 weight 80 radius-server user-name domain-included calling-station-id mac-format hyphen-split mode2 called-station-id wlan-user-format ac-ip include-ssid radius-server nas-identifier-format vlan-id radius-server ip-address 192.168.1.10 shared-key cipher testadmin vap-profile name test_wifi service-vlan vlan-id 10 ssid-profile test_wifi security-profile test_wifi traffic-profile test_wifi authentication-profile test_wifi aaa authentication-scheme test_wifi authentication-mode radius authentication-scheme radius authentication-mode radius domain default authentication-scheme default


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3