Community discussions

MikroTik App
 
alkos
just joined
Topic Author
Posts: 1
Joined: Wed Feb 22, 2006 1:06 pm

How to kickoff pppoe user remotely

Wed Feb 22, 2006 1:39 pm

Since SNMP is RO, is there a way to kickoff online user?
Not from CLI, or is there a way to start script remotely and pass through paramteres.

Thanx,
Aleksandar
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Wed Feb 22, 2006 6:27 pm

If trying to disconnect them from a RADIUS server, you could look into the "incoming RADIUS" feature on RouterOS - it's made for that purpose. Search the forums here, this has been discussed.

Or you could of course make scripts that telnet/ssh into the router to execute the necessary console commands (that has been discussed here in great detail, too).

Best regards,
Christian Meis
 
airnet
Frequent Visitor
Frequent Visitor
Posts: 83
Joined: Thu Feb 09, 2006 12:46 pm

Thu Mar 02, 2006 2:15 pm

You could start with this simple perl example


#!/usr/bin/perl
# command line usage: perl this-script.pl pppoe_username
# Works with MT 2.8
# For MT 2.9 you need to change a couple of the commands but fundamentally works the same

use Net::Telnet;

# Set Variables
$login = "someuser";
$password = "xxxxxx";
$host = "ip.add.re.ss";

$t = new Net::Telnet ( Timeout=>10, Errmode=>'die');

# Login
$t->open($host);
$t->waitfor('/Login: $/i');
$t->print($login);
$t->waitfor('/Password: $/i');
$t->print($password);
$t->waitfor('/identity_goes_here] > $/i');
# Run commands
$t->print('interface pppoe-server');
$t->print('remove [find user='.$ARGV[0].']');
$t->print('..');
$t->print('..');
# Logout
$t->print('quit');

Who is online

Users browsing this forum: surek and 31 guests