[OpenWrt-Devel] [PATCH] hostapd: add RADIUS mac authentication

Cezary Jackiewicz cezary.jackiewicz at gmail.com
Wed Jul 15 12:49:08 EDT 2015


Allow to use radius server to mac authentication. 
Config section:
  ..
  option 'macfilter' 'radius'
  option 'auth_server' '192.168.1.100'
  option 'auth_secret' 'RadiusPassword'
  option 'auth_port' '1812'


Tested with freeradius and Coova/radproxy.

Signed-off-by: Cezary Jackiewicz <cezary.jackiewicz at gmail.com>  
---

diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index a3ffd93..bca9631 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -419,6 +419,22 @@ hostapd_set_bss_options() {
 			append bss_conf "macaddr_acl=0" "$N"
 			append bss_conf "deny_mac_file=$_macfile" "$N"
 		;;
+		radius)
+			append bss_conf "macaddr_acl=2" "$N"
+
+			json_get_vars auth_server auth_secret auth_port
+
+			# legacy compatibility
+			[ -n "$auth_server" ] || json_get_var auth_server server
+			[ -n "$auth_port" ] || json_get_var auth_port port
+			[ -n "$auth_secret" ] || json_get_var auth_secret key
+
+			set_default auth_port 1812
+
+			append bss_conf "auth_server_addr=$auth_server" "$N"
+			append bss_conf "auth_server_port=$auth_port" "$N"
+			append bss_conf "auth_server_shared_secret=$auth_secret" "$N"
+		;;
 		*)
 			_macfile=""
 		;;



-- 
Pozdrawiam,
 Cezary Jackiewicz
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list