Created
April 9, 2021 23:10
-
-
Save facilita-tecnologia/1b330f8a541cb21c6a4dc89ee01da7ef to your computer and use it in GitHub Desktop.
Configurar Freeradius para Validar Mac e USUARIO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/freeradius/sites-available/ | |
Na guia post-auth | |
Inserir as seguintes linhas | |
# IMPLEMENTAÇÕES PERSONALIZADAS | |
if("%{sql:SELECT COUNT(*) FROM radmacauth WHERE macaddr = '%{Called-Station-Id}' AND username = '%{User-Name}'}" >= 1 ){ | |
ok | |
} | |
else{ | |
reject | |
} | |
Criar a seguinte tabela | |
CREATE TABLE `radmacauth` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`macaddr` varchar(255) DEFAULT NULL, | |
`username` varchar(255) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment