在modules里面添加attr_rewrite,内容为
1 2 3 4 5 6 7 8 9 10 | attr_rewrite sanereplymessage { attribute = Reply-Message searchin = reply searchfor = "\n|\r" replacewith = "" ignore_case = no new_attribute = no max_matches = 10 append = no } |
在modules里面添加attr_rewrite,内容为
1 2 3 4 5 6 7 8 9 10 | attr_rewrite sanereplymessage { attribute = Reply-Message searchin = reply searchfor = "\n|\r" replacewith = "" ignore_case = no new_attribute = no max_matches = 10 append = no } |
FreeRADIUS 2.x默认在数据库只记录用户名,密码,认证时间等信息,但没有访问IP和连接VPN的IP,为了更好的监控,所以添加记录验证者的ip和连接vpn的IP。
首先给FreeRADIUS数据库的radpostauth表添加2个字段 calledstationid和nasipaddress。
然后修改 /usr/local/etc/raddb/sql/mysql/dialup.conf ,将最后的认证信息修改为:
1 2 3 4 5 6 | postauth_query = "INSERT INTO ${postauth_table} \ (username, pass, reply, authdate, calledstationid, nasipaddress) \ VALUES ( \ '%{User-Name}', \ '%{%{User-Password}:-%{Chap-Password}}', \ '%{reply:Packet-Type}', '%S', '%{Calling-Station-Id}', '%{NAS-IP-Address}')" |
重启FreeRADIUS就OK
昨晚在安装freeradius 3.0 的时候提示以下错误
1 | “Security advisory CVE-2014-0160 (Heartbleed)”. FreeRadius 3.0.3 would not allow to start radius server if you have openssl version in range 1.0.1 – 1.0.1f installed. |
原因是openssl漏洞,需要升级openssl。首先检查openssl的版本
1 2 3 4 5 6 7 8 | [root@Pandora ~]# openssl version -a OpenSSL 1.0.1e-fips 11 Feb 2013 built on: Wed Aug 13 19:13:02 UTC 2014 platform: linux-x86_64 options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM OPENSSLDIR: "/etc/pki/tls" engines: rdrand dynamic |
今天在安装freeradius 2.x和freeradius 3.x,测试连接都无法通过,错误如下
freeradius 2.x 提示的错误
1 2 | radclient:: Failed to find IP address for Excalibur radclient: Nothing to send. |
freeradius 3.x 提示的错误
1 | (0) Error parsing "-": ip_hton: Name or service not known |
解决方法很简单给/etc/hosts添加主机名解析就可以
(more…)