rdcore
rdcore copied to clipboard
NAS on the latest version
Hi.
On the latest version of RADIUSdesk, I can create RADIUS clients, but do not seem to be able to create a NAS now, with its own key. Is this still possible, and if not, If I manually insert an entry into the SQL nas table, will this still work?
I can't add NAS Direct (fixed IP).
Add "+" only can add NAS Dynamic.
RD OVA VirtualBox.
@dirkvanderwalt Hi, you can help us?
Hi,
I need to check if the code paw ported to CakePHPv3. If so, its probably just commented out and we can add maybe a config file setting so it can be displayed.
Nudge me again if I have not replied in 24 hours :-)
Thanks. I need direct NAS to setup POD/COA 3799, because currently I can't kill user connected to Coova.
Please add timezone "America/Chile" now GMT-4 and DST with GMT-3.
I don't undestand the values of the table "timezone".
I think it would be better to read the timezones of the O.S.
;)
Hi @dirkvanderwalt
could you check the code?
Please add timezone "America/Chile" now GMT-4 and DST with GMT-3.
I don't undestand the values of the table "timezone".
I think it would be better to read the timezones of the O.S.
;)
Solved, I added into DB. GMT-4.
Hi,
I need to check if the code paw ported to CakePHPv3. If so, its probably just commented out and we can add maybe a config file setting so it can be displayed.
Nudge me again if I have not replied in 24 hours :-)
Any luck with allowing the static NAS definitions?
@dirkvanderwalt ?
Hi everyone,
I checked the code and it is there
https://github.com/RADIUSdesk/rdcore/tree/main/rd/classic/src/view/nas https://github.com/RADIUSdesk/rdcore/blob/main/cake3/rd_cake/src/Controller/NasController.php
So I should have a way to enable / include it checked in (into Github) by Monday.
Hi everyone,
I checked the code and it is there
https://github.com/RADIUSdesk/rdcore/tree/main/rd/classic/src/view/nas https://github.com/RADIUSdesk/rdcore/blob/main/cake3/rd_cake/src/Controller/NasController.php
So I should have a way to enable / include it checked in (into Github) by Monday.
That's great. Thanks
Actually you should be able to activate them even in the current code Just remove the comments (for root user) https://github.com/RADIUSdesk/rdcore/blob/main/cake3/rd_cake/src/Controller/DashboardController.php#L795
And then for the other normal Access Providers https://github.com/RADIUSdesk/rdcore/blob/main/cake3/rd_cake/src/Controller/DashboardController.php#L1513
Let us know if this works for you
Seems to work fine, thanks very much.
@dirkvanderwalt
Works, but some issues:
- Can't delete added "NAS Devices"
- Kick doesn't work for CoovaChilli COA port 3799 (data saved in optional info)
To kick or disconnect I added in public function "kickActive" file RadacctsController.php
shell_exec("echo User-Name='".$ent->username."' | radclient -c '1' -n '3' -r '3' -t '3' -x '127.0.0.1:3799' 'disconnect' 'testing123'");
@dirkvanderwalt Works, but some issues:
- Can't delete added "NAS Devices"
- Kick doesn't work for CoovaChilli COA port 3799 (data saved in optional info)
To kick or disconnect I added in public function "kickActive" file RadacctsController.php
shell_exec("echo User-Name='".$ent->username."' | radclient -c '1' -n '3' -r '3' -t '3' -x '127.0.0.1:3799' 'disconnect' 'testing123'");
Can you give me example? I've add line like this
shell_exec("echo User-Name='".$ent->username."' | radclient -c '1' -n '3' -r '3' -t '3' -x '".$ent-> nasipaddress.:3799"' 'disconnect' 'secret'");
but I still cant kick the user, I use .$ent->nasipaddress. to determine which NAS, because I have many Mikrotik NAS.
shell_exec("echo User-Name='".$ent->username."' | radclient -c '1' -n '3' -r '3' -t '3' -x '".$ent-> nasipaddress.:3799"' 'disconnect' 'secret'");
ther right is
shell_exec("echo User-Name='".$ent->username."' | radclient -c '1' -n '3' -r '3' -t '3' -x '".$ent-> nasipaddress.":3799' 'disconnect' 'secret'");
for now i can kick the client
Hi.
Is there a way to dynamically pull secret from database for radclient? It is useful if we have different secrets for each client.
[EDIT] if anyone is interested, the code for dynamic pull of secrets from database is(paste this function instead of default kickActive):
public function kickActive(){
$this->loadModel('Nas');
//__ Authentication + Authorization __
$user = $this->_ap_right_check();
if(!$user){
return;
}
$some_session_closed = false;
$count = 0;
$msg = 'Could not locate session';
$data = ['title' => 'Session Not Found', 'message' => $msg, 'type' =>'warn'];
$req_q = $this->request->getQuery();
foreach(array_keys($req_q) as $key){
if(preg_match('/^\d+/',$key)){
$ent = $this->{$this->main_model}->find()->where(['Radaccts.radacctid' => $key])->first();
$qr = $this->Nas->find()->where(['Nas.nasname' => $ent->nasipaddress])->first();
$count++;
if($ent->acctstoptime !== null){
$some_session_closed = true;
}else{
shell_exec("echo User-Name='".$ent->username."', Framed-IP-Address='".$ent->framedipaddress."' | radclient -c '1' -n '3' -r '3' -t '3' -x '".$ent->nasipaddress.":3799' 'disconnect' '".$qr->secret."'");
$data = $this->Kicker->kick($ent); //Sent it to the Kicker
}
}
}
if($count >0){
$data = ['title' => 'Disconnect Sent', 'message' => 'Disconnect Instructions Sent', 'type' =>'info'];
}
if(($some_session_closed)&&($count>0)){
$msg = 'Sessions Is already Closed';
if($count > 1){
$msg = 'Some Sessions Are already Closed';
}
$data = ['title' => 'Session Closed Already', 'message' => $msg, 'type' =>'warn'];
}
$this->set([
'success' => true,
'data' => $data
]);
$this->viewBuilder()->setOption('serialize', true);
}
Best regards, Aleksa.