Different databases with single freeradius

Alan DeKok aland at deployingradius.com
Thu Feb 8 15:45:35 CET 2018


On Feb 8, 2018, at 9:19 AM, Emrah Yıldırım <emrah.yldrm81 at gmail.com> wrote:
> 
> I have entered two separate NAS information for DB1 and DB2 databases. I
> hooked up two separate PF-se captive portals to the NAS tables in the DB1
> and DB2 databases. Two separate captive portal Internet users will
> authenticate and provide access to the Internet. The panel operators who
> enter the management panel I have made (the PF sense) will see the users on
> their own databases (DB1 or DB2) on the Internet with the captive portal
> separately.

  OK, that's a good description.

  The solution is simple then.  Separate the users by NAS-IP-Address.  You need to find out which table the NAS is in, and use that.  Something like this should work:

	if ("%{sql: SELECT nas from table1 where nas_ip = %{NAS-IP-Address}" != "") {
		# user is in table 1
		sql1
	}
	else {
		# user is in table 2
		sql2
	}

  Put that into both the "authorize" and "accounting" sections.  The user information will then be separated.

  The only remaining thing is that you must customize the SELECT query yourself.

> Panel administrators who don't recognize each other can open
> the same user name and password in the Radcheck table. Internet users with
> the same user name in separate databases can have separate Internet speeds.
> I need to separate the accounting. I may not be able to express myself, but
> I'm sure you are a humble and helpful person... Maybe you want to connect
> with team Viwer.

  That's not going to happen. 

> I'm writing the panel with Ruby on Rails. The rails attribute and the words
> of a team are using their own. He wants me to put an "s" at the end of the
> names of the MVC model tables.

  You don't have to follow bad requests.

  Alan DeKok.




More information about the Freeradius-Users mailing list